Networking – UDP Packet Order with Direct Connection

networkingprotocolsockets

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.

Best Answer

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.

Related Topic