Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can UDP packet be fragmented to several smaller ones [duplicate]

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?

like image 932
FrozenHeart Avatar asked Aug 02 '16 14:08

FrozenHeart


People also ask

Can a packet be fragmented twice?

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.

Are UDP packets smaller?

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.

Can a fragmented datagram be fragmented again?

Yes, this is possible. Reassembly is possible because each fragment contains an offset which is relative to the original payload, not the fragemented payload.

Can a TCP packet be fragmented?

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.

What is the minimum size of a UDP packet to avoid fragmentation?

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.

What is the size of the payload of a UDP packet?

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.

What caused this UDP packet to be duplicated?

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.

How does Azure vm handle UDP/IP traffic fragmentation?

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.


1 Answers

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.

like image 198
dbush Avatar answered Oct 08 '22 19:10

dbush