In the text book Computer Networking James F.Kurose Fifth Ed, ch4 mentioned
the ip fragments must be in multiples of 8 bytes, and because the Flags in the IP header takes 3 bits. I don't understand why ip fragmentation must be in multiples of 8 bytes.
Every fragment except the last must contain a multiple of 8 bytes of data.
Fragment Offset can hold 8192 (2^13) units but the datagram can't have 8192 * 8 = 65536 bytes of data because "Total Length" field of IP header records the total size including the header and data.
An IP header is at least 20 bytes long, so the maximum value for "Fragment Offset" is restricted to 8189, which leaves room for 3 bytes in the last fragment.
Hope this helps.
Note that Fragment Offset field is expressed in 8-byte units, not in bytes. This is the reason why the payload size inside each of the fragment, except the last fragment, must be multiple of 8 bytes.
As the Fragment Offset is coded on 13bits, it results that its range is between 0 and 8191 units of 8 bytes. However, because the Total Length takes into account also the IP Header, the Fragment Offset maximum limit is in fact 8189 units, not 8191 units, see below:
Total Length being coded on 16 bits it means it is limited to 65535 bytes. Then, as the IP header is at least 20 bytes it results that the Payload is limited to maximum 65535 bytes - 20 bytes = 65515 bytes. Dividing these 65515 bytes in 8-byte units it results that there could be maximum 8189 units, hence Fragmentation Offset is limited to maximum 8189 units.
An IP fragment having the Fragment Offset value set to this maximum value of 8189, could have a payload of maximum 3 bytes:
Maximum 65535 bytes - minimum 20 bytes - (8189 units * 8 bytes per unit) = maximum 3 bytes
Rurre
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With