Why ip fragments must be a multiple of 8 bytes

In the textbook Computer Network, James F. Kurez Fifth Ed, ch4 mentioned

ip fragments must be a multiple of 8 bytes, and since the Flags in the IP header accept 3 . I don't understand why ip fragmentation should be a multiple of 8 bytes.

+7
source share
4 answers

Each fragment, except the last, must contain a multiplicity of 8 bytes of data.

A fragment offset can contain 8192 (2 ^ 13) units, but a datagram cannot have 8192 * 8 = 65536 bytes of data, because the Total Length field of the IP header records the total size, including the header and data.

The IP header has a length of at least 20 bytes, so the maximum value for the β€œFragment Offset” is limited to 8189, which leaves room for 3 bytes in the last fragment.

Hope this helps.

+11
source

Note that the Fragment Offset field is expressed in 8-byte units, not in bytes. That is why the size of the payload within each fragment, with the exception of the last fragment, must be a multiple of 8 bytes.

Since the fragment offset is encoded by 13 bits, this leads to the fact that its range is in the range from 0 to 8191 units of 8 bytes. However, since the IP header is also taken into account in Total Length, the maximum fragment offset limit is 8189 units, not 8191 units, see below:

A total length encoded in 16 bits means that it is limited to 65535 bytes. Then, since the IP header is at least 20 bytes, this results in the payload being limited to a maximum of 65535 bytes β€” 20 bytes = 65515 bytes. Separating these 65,515 bytes in 8-byte units results in a maximum of 8189 units, so the Fragmentation Offset is limited to a maximum of 8189 units.

An IP fragment having a fragment offset value set to this maximum value of 8189 can have a payload of no more than 3 bytes:

Maximum 65535 bytes - minimum 20 bytes - (8189 units * 8 bytes per unit) = maximum 3 bytes

Rurre

+2
source

What Wayne said, and the fact that the offset is actually used in the end hosts so that they can effectively store fragments in memory efficiently, that is, in a string. The offset shows the relative position of the fragment relative to the entire datagram. That is why the offset must be fragments of IP, must be a multiple of 8 bytes, because what you are actually doing is a shift to the right by 3 bits (hence 13 bits).

0
source

Here ( https://cs.nyu.edu/courses/fall98/G22.2262-001/class11.txt ) it is indicated that: fragment offset is measured in units of 8 bytes (64 bits). This is due to the fact that the fragment displacement field is 3 bits smaller than the full length field. 16 bits (and 2 ^ 3 - 8).

0
source

All Articles