Where is the Don't Fragment Bit of the IP Flags used?

前端 未结 3 2059
醉梦人生
醉梦人生 2021-02-08 16:07

I am curious to know where the \"Don\'t Fragment\" [DF] Bit of the IP Flags is used. As fragmentation is invisible to higher layers and they don\'t care too.

I am also l

3条回答
  •  日久生厌
    2021-02-08 16:44

    Fragmentation is not always invisible to all upper layers. Some early (and probably even current) micro-controller TCP/IP stacks did not implement the full capabilities such as fragmentation handling. Use of the flag in that situation would ensure that the packet arrived in its original form instead of a lot of fragments which the other end couldn't handle.

    In addition, when using UDP, it's not necessary for all the fragments to arrive at the destination so, preventing fragmentation means the message either arrives or doesn't arrive - there is no possibility that only a bit of the UDP datagram will reach the destination. I can't recall how long the TCP/IP stack held on to unassembled IP packets waiting for missing fragments, but use of the DF flag meant there were no unnecessary resources tied up during that time.

    Finally, you can use it for testing behavior of network infrastructure, such as what happens when you get a packet that's bigger than the maximum transmission unit (DF will prevent that packet from being fragmented to 'squeeze through' the hole).

提交回复
热议问题