Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When to set “Don't fragment” flag in IP header?

There is a “Don't fragment” flag in IP header. Could applications set this flag ? When to set this flag and why?

like image 517
lrouter Avatar asked Aug 30 '17 06:08

lrouter


People also ask

Who sets do not fragment bit?

SCTP always sets the DF (Don't Fragment) bit in IPv4 packets.

Should I enable block fragmented IP packets?

You can block fragmented IP packets by cutting your connection with anyone who sends them. However, some benign connections (e.g., mobile devices) use fragmented packets, so disabling them might cause disruptions for your traffic.

Why would an IP packet need to be fragmented?

Fragmentation allows for; Transport layer protocols to be ignorant of the underlying network architecture, reducing overheads. IP And higher layer protocols to work across variable and diverse network paths and mediums without the need and overhead of a path discovery protocol (but see the PMTUD section).

What is the significance of fragment offset in IP header?

Fragmentation Offset: This field helps the destination device to place the fragments in the proper sequence to build the original packet. The fragmentation offset value for the first fragment is always 0. The field is 13 bits wide, so the offset can be from 0 to 8191.


1 Answers

If the 'DF' bit is set on packets, a router which normally would fragment a packet larger than MTU (and potentially deliver it out of order), instead will drop the packet. The router is expected to send "ICMP Fragmentation Needed" packet, allowing the sending host to account for the lower MTU on the path to the destination host. The sending side will then reduce its estimate of the connection's Path MTU (Maximum Transmission Unit) and re-send in smaller segments.This process is called PMTU-D ("Path MTU Discovery").

A fragmentation causes extra overhead on CPU processing to re-assemble packets at the other end (and to handle missing fragments).

Typically, the 'DF' bit is a configurable parameter for the IP stack. I know of ping utility with an option to set DF.

It is often useful to avoid fragmentation, since apart from CPU utilization for fragmentation and re-assembly, it may affect throughput (if lost fragments need re-transmission). For this reason, it is often desirable to know the maximum transmission unit. So the 'Path MTU discovery' is used to find this size, by simply setting the DF bit (say for a ping)

like image 95
Ketan Mukadam Avatar answered Sep 19 '22 13:09

Ketan Mukadam