Udp Ip Fragmentation and Mtu

Can UDP packet be fragmented to several smaller ones

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.

UDP IP Fragmentation and MTU

Implementations of the IP protocol are not required to be capable of handling arbitrarily large packets. In theory, the maximum possible IP packet size is 65,535 octets, but the standard only requires that implementations support at least 576 octets.

It would appear that your host's implementation supports a maximum size much greater than 576, but still significantly smaller than the maximum theoretical size of 65,535. (I don't think the switch should be a problem, because it shouldn't need to do any defragmentation -- it's not even operating at the IP layer).

The IP standard further recommends that hosts not send packets larger than 576 bytes, unless they are certain that the receiving host can handle the larger packet size. You should maybe consider whether or not it would be better for your program to send a smaller packet size. 24,529 seems awfully large to me. I think there may be a possibility that a lot of hosts won't handle packets that large.

Note that these packet size limits are entirely separate from MTU (the maximum frame size supported by the data link layer protocol).

How to fill the UDP length in the first UDP fragment when UDP package divided to IP fragment?

UDP Length is the length of the UDP header AND the UDP data, in bytes. The fragmentation will/should NOT change this.

[UDP] "Length is the length in octets of this user datagram including this header and the data" --RFC768, an Internet Standard. It is also in the Stevens link referenced: "Referring to Figure 10-2, the UDP Length field is the length of the UDP header and the UDP data in bytes."



Related Topics



Leave a reply



Submit