Can UDP packet be fragmented to several smaller ones if it exceeds MTU? It seems that MTU fragmentation is about IP layer so I think it can.
If so, what is the recommended max. packet size to send over UDP to avoid fragmentation and why?
When a large MTU environment is Fragmented 2 times, It commonly has a second or third small fragment, one of which will have the MF Bit set. by default, this will be dropped, resulting in mangled or failed packets.
UDP doesn't know anything about MTU. UDP packets can have any size from 8 to 65535 bytes. The protocol layers below UDP either can send a packet of a specific size or will reject to send that packet with an error if too big. The layer below UDP is usually IP, either IPv4 or IPv6.
Yes, this is possible. Reassembly is possible because each fragment contains an offset which is relative to the original payload, not the fragemented payload.
Fragmentation is a necessary function of the TCP/IP suite, as different routers on the Internet (or internally) have different sized network links. Fragmentation dissects the packets into smaller pieces so that they can fit the smaller links as they travel the network.
Any IP datagram can be fragmented if it is larger than the MTU. Whether it contains UDP, TCP, ICMP, etc. does not matter. Most Ethernet networks support a 1500 byte MTU. With the IPv4 header being 20 bytes and the UDP header being 8 bytes, the payload of a UDP packet should be no larger than 1500 - 20 - 8 = 1472 bytes to avoid fragmentation.
With the IPv4 header being 20 bytes and the UDP header being 8 bytes, the payload of a UDP packet should be no larger than 1500 - 20 - 8 = 1472 bytes to avoid fragmentation. This is assuming no IP options exist in the packet. If so, the payload will need to be smaller than that to account for it.
There was a faulty router that duplicated UDP packets. Long story short it was found that some interrupt was raised excessively frequently. That caused the following scenario: It sent the packet and before it marked it as sent... An interrupt was raised.
Because of this is only the first fragmented segment is actually forwarded to the Azure VM behind , therefore breaking the UDP/IP traffic all together. The work around is to ensure that the application sends the smaller packets so that the fragmentation will not happen.
Any IP datagram can be fragmented if it is larger than the MTU. Whether it contains UDP, TCP, ICMP, etc. does not matter.
Most Ethernet networks support a 1500 byte MTU. With the IPv4 header being 20 bytes and the UDP header being 8 bytes, the payload of a UDP packet should be no larger than 1500 - 20 - 8 = 1472 bytes to avoid fragmentation.
This is assuming no IP options exist in the packet. If so, the payload will need to be smaller than that to account for it.
This applies to IPv4 only. IPv6 does not support fragmentation.
You can see also this question regarding MTU for UDP.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With