Advertisement

UDP wrong order

Started by September 30, 2002 11:22 AM
12 comments, last by Snakebite 22 years, 4 months ago
I''m wondering how common it is for UDP packets to arrive out of order. Especially in the context of Internet, not a LAN. Anyone have statistics on this?
Yes, It''s real happen. UDP sent without acception. If exist more than 1 way to destination host, router automaticaly balance channels and sends to diferent ways, as result later-sent packets read early.
This happen btw. 2 local networks if "bridge channel" btw. them overloaded. It depend of buffer usage algoritms for router.

Don''t use UDP for WAN, UDP good well only to local network.
Advertisement
In theory, they could arrive out of order, not at all, and in rare cases more than once! To be safe, I would code to handle all those circumstances if you plan to use any protocol, even on a LAN.

I've been told there are some cases as well where the packet ends up garbled. Again, very rare, but possible.


[edited by - Waverider on September 30, 2002 4:11:35 PM]
It's not what you're taught, it's what you learn.
It''s quite common for packets to be duplicated (in my limited experience anyway). I''m pretty sure UDP checksums packets so it guarantees packets are either error free or discarded.
UDP packets aren''t duplicated. UDP doesn''t have reliability control and therefore never send a duplicate packet. And packets are not duplicated at routers.
"And packets are not duplicated at routers. "
This is what multicast is for... and that''s exactly what it does, albeit not duplicated to the same destination.

UDP over the internet, you WILL lose packets, and you will get some packets out of order. The amount of packet loss will depend on the amount of congestion along your route to the source/destination.

Yes, a UDP packet is guaranteed to be delivered in-tact, error-free, IF it arrives at all.
Advertisement
With UDP you can sometimes get two packets merged together as well. Another thing to keep in the back of your mind when coding.
Martin Piper
I personally have sent out 10 packets and seen them arrive at their destination in reverse order.

Packets are dropped all the time.

The UDP checksum is not 100% reliable. Routers have been known to fiddle with packets, corrupt some data because of a bug, and re-checksum the now corrupted data. If lives or money depend on your data use your own checksum as well.

I''ve seen duplicate packets when using a high-level protocol that could ride on top of different lower level protocols. The system would send the data on each of the lower level protocols.

This is the first time I''ve ever seen anybody claim you could get merged UDP packets. I''d like to see proof. There''s a ton of code out there that would break if this was true.

Sorry, I don''t have any actual statistics.

-Mike
-Mike
What kind of proof would you like?
I had to add in code to deal with merged UDP packets when I was running a packet dump. I found, much to my amazement, that two of my UDP packets had been merged.
I can show you the packet hexdumps if you like?
Martin Piper
I don''t buy this merged packet thing either unless it was a router bug or you were using tcp streams and thought it was udp.

___________________________
Freeware development:
ruinedsoft.com
___________________________Freeware development:ruinedsoft.com

This topic is closed to new replies.

Advertisement