The most reliable and efficient udp packet size?

The maximum size of UDP payload that, most of the time, will not cause ip fragmentation is

MTU size of the host handling the PDU (most of the case it will be 1500) -
size of the IP header (20 bytes) -
size of UDP header (8 bytes)

1500 MTU - 20 IP hdr - 8 UDP hdr  = 1472 bytes

@EJP talked about 534 bytes but I would fix it to 508. This is the number of bytes that FOR SURE will not cause fragmentation, because the minimum MTU size that an host can set is 576 and IP header max size can be 60 bytes (508 = 576 MTU – 60 IP – 8 UDP)

By the way i’d try to go with 1472 bytes because 1500 is a standard-enough value.

Use 1492 instead of 1500 for calculation if you’re passing through a PPPoE connection.

Leave a Comment