In IPv4 Fragmentation, should the first block be necessarily the closest smaller multiple to 8


Is it mentioned in any RFC's that when one is splitting a Datagram into fragments, the bytes in the first fragment should be "the closest multiple of 8" or is it just a standard implementation.
Like for Example: if there whose payload is 10,000 bytes and header is 20 bytes, and going into another link whose MTU is 4000 bytes, then why should the payload be split as 3976, 3976, 2048? Why can't someone split it as lets say 3880, 3880, 2240? (no of fragments is the same)

(Closest Multiple of 8 – If 3980 was supposed to be split then closest multiple of 8 would be 3976…. Similarly it for 4000 it would be 4000 itself)

Best Answer

The Fragment Offset field is three bits smaller than the Total Length field.

2^3 = 8

That means that you must use a multiple of eight. Typically you will use the largest multiple of eight that fits into the new MTU in order to minimize the number of packet fragments that are required to send the packet through the smaller MTU.

Fragmentation is resource intensive, and a router is not going to have an algorithm that looks to see if you can shrink the size of the fragments and still have the same number of packets. That would be even more resource intensive to no end. The purpose of a router is to route packets as fast as possible, not spend cycles trying to find a more even fragment size.

IPv6 has eliminated in-path packet fragmentation as a bad idea, instead requiring PMTUD (which can also be used with IPv4).