UDP order of packets with direct connection

If i have two systems (A and B) running on LAN(INTRANET) which are directly connected. There are no routers in the middle. In this case, if system A sends a few UDP packets every few milliseconds to system B:

Is it possible that system B receives the packets in a different order?

Please note that I’m not asking whether to use TCP or UDP. I’m interested in whether the above scenario will have packets out of order – I’m aware that UDP packets are not guaranteed to arrive in order.

1

Yes it is possible.

This could be hardware and driver dependent, and might be very different depending on what other types of packets are being sent over the line at the same time.

How are internal packet buffers handling the incoming send requests? You can’t know. It could be using parallel buffers that fill up in odd ways. Since the spec doesn’t have a guarantee, there would be no reason for the implementer to bother keeping things in sync (esp. considering the speed gains with lack of overhead).

A windows box might decide to send a NTP time update request and a network share scan, and then while in the middle of that, dropbox could make a request for local folders. Now any data in buffers are suspect.

You could send millions of packets and not experience this issue. But it is a possibility. The chances of it happen may be small, but it will happen.

The only real way to guarantee that these aren’t going to cause problems is if you are running your own OS and have explicit knowledge on how the hardware performs and have the driver source code and the UDP api’s source code.

UDP packets are not guaranteed to arrive in order. You should use TCP for this.

3

It is possible. I have observed such behaviour on direct connection (no hub or switch) between two machines. In my case it happened only when application sent datagrams one after another without any delay between them. In this case it would happen with high probability (over 1/30).
I should note that this behaviour was hardware dependent – It would occur only on one particular line of Kontron’s computers.
Also it would occur only when application went datagrams as fast as possible – after artifially delaying next datagram for 1 millisecond I could not observe this any longer.

They don’t have to arrive at all nor in order.

I assume you’re hoping that this is not the case due to the simplicity of the setup but there is still an underlying bus system and things like both computers trying to send at the same time can happen.

Of course it won’t with switched ethernet but you will have to destroy several layers of abstraction to answer your question in any other way than “maybe not”.

Yes, it might be that the application on system B receives the UDP packets in a different order than they were sent by the application on system A. If both systems are connected to the same network segment, the likelihood of it occurring is small, but will never be negligible.

What also can happen is that packets get lost, for example because there was a collision between two packets on a switch or hub connecting the systems.

In the software world, we deal with certainties and statistically impossible scenarios before deciding to use a given solution. Whether the packets can/will arrive reliably and what you plan on doing to handle that contingency, has everything to do with whether or not you should use that solution.

Anyways, no they will not arrive in order (or at all) and if you use it, you have to deal with it in your transport layer(s)–like the way RTP does it or something of that nature.

Though order or arrival is not guarranted by the specification, in your context I see no device that could reorder the packets or destroy them (provided that no other network traffic is present).

Just in case, you can build up a test that you run during a couple of hours and that sends packets with an incrementing sequence number in the body and that fails as soon as the sequence number of a received packet does not match the number of packets received so far.

4

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật