Skip to main content
GameDev.net gamedev.net
🔒 Locked

Max UDP packet payload?

Started by SymLinked Nov 4, 2007 at 3:26 PM 1 replies 22.9k views
Original Post
SymLinked
SymLinked
I keep hearing everything from 61 to 64 kb. But as soon as I go above 1400-1500 bytes somewhere, packets stop arriving on the other end. Searching the forums show a post or two by people claiming that most routers drop UDP datagrams that are larger than 1400 bytes in size. I'm trying to transfer files using our guaranteed UDP layer (TNL) and this has proven to be very troublesome. Can someone shine some light on this?
swiftcoder
swiftcoder
Maximum packet size of UDP may well be ~60k, that sounds about right, but I do not know for sure. However, the MTU of ethernet (and hence the internet in general) is 1500 bytes, so the IP layer will split your UDP packet into 1500 byte blocks.

UDP guarantees that if the packet arrives, the entire packet arrived. I am a bit sketchy about how they ensure this, but it should mean that you are safe to shoot 60k packets.

but if routers are dropping oversized UDP packets, there isn't that much you can do...
Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]
hplus0603
hplus0603
The size of a UDP packet is stored in a two-byte field, which means the maximum size representable is 65535 bytes.

If routers drop IP fragments, then you have to send something less than the MTU. You can typically get away with 1400 bytes MTU on most networks, although the most conservative setting would be slightly above 512 bytes.

Packets don't need to be large to get good throughput, though. Just send more of them at a time (using pipelined acknowledgments).
enum Bool { True, False, FileNotFound };

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.