2

In IPv4, fragmentation is done by routers on way to the destination if DF(do not fragment) flag is not set in the IP packet.

Once a packet is fragmented, its fragments may take different paths (due to various reasons like topology changes) to the destination.

If, on some link again in the path to destination, one routers find that the link MTU is smaller than the frame size, then either the packet needs to be fragmented or dropped.

Can fragments of a packet be refragmented again? If yes, what will be the value of MF flag in the new individual fragments created by this?

gsinha
  • 323
  • 1
  • 3
  • 15

1 Answers1

4

Yes, they can be refragmented. Every refragment but the last will have the MF flag set. The last fragment will have the same MF flag as the original fragment. So it's just as if they had originally been fragmented that way.

David Schwartz
  • 31,215
  • 2
  • 53
  • 82
  • Suppose the last fragment of the first fragmentation gets fragmented again. When these refragments reach the destination, how will the destination host know that it has received the last fragment(ie, it has received all the refragments/fragments)? I thought that it uses the MF flag to determine this but my logic will not work if multiple refragments have MF flag set. – gsinha Jun 11 '12 at 15:15
  • All fragments except the last have the MF flag set. If you split a fragment whose MF flag is set (a middle fragment) you set the MF flag on all fragments, so still fragments but the last have their MF flag set. If you split the last fragment, you set the MF flag on all fragments but the last, so still all fragments but the last have their MF flag set. – David Schwartz Jun 11 '12 at 16:17
  • [Sorry, there was a typo in the last word of my previous comment] @David: Suppose the last fragment of the first fragmentation gets fragmented again. When these refragments reach the destination, how will the destination host know that it has received the last fragment(ie, it has received all the refragments/fragments)? I thought that it uses the MF flag to determine this but my logic will not work if multiple refragments have MF flag **RESET**. – gsinha Jun 11 '12 at 17:44
  • It can still use the MF flag. All fragments except the last will always have the MF flag set. Only the last fragment ever has the MF flag clear. – David Schwartz Jun 18 '12 at 16:39