In an IPv4 datagram, the M bit is 0, the value of HLEN is 10, the value of…
20132013
In an IPv4 datagram, the M bit is 0, the value of HLEN is 10, the value of total length is 400, and the fragment offset value is 300. The position of the datagram, and the sequence numbers of the first and the last bytes of the payload, respectively, are
- A.
Last fragment, 2400 and 2789
- B.
First fragment, 2400 and 2759
- C.
Last fragment, 2400 and 2759
- D.
Middle fragment, 300 and 689
Attempted by 186 students.
Show answer & explanation
Correct answer: C
Concept
In IPv4 fragmentation, three header fields locate a fragment's payload. The HLEN (header length) field counts the header in 4-byte words, so the header size in bytes is HLEN × 4, and the payload size is total length − header size. The fragment offset field counts in 8-byte units, so the first payload byte's sequence number is offset × 8. The M (More Fragments) bit is 0 only in the last fragment and 1 in every earlier one.
Application
Position from the M bit: M = 0, so this is the last fragment.
Header size: HLEN = 10, so header = 10 × 4 = 40 bytes.
Payload size: total length − header = 400 − 40 = 360 bytes.
First payload byte: fragment offset × 8 = 300 × 8 = 2400.
Last payload byte: first byte + payload − 1 = 2400 + 360 − 1 = 2759.
Cross-check
The byte span runs 2400 to 2759 inclusive, which is 2759 − 2400 + 1 = 360 bytes — exactly the payload size computed from total length minus header. The non-zero offset (2400) also confirms this is not the first fragment, and M = 0 fixes it as the last. Hence: last fragment, with first and last payload bytes 2400 and 2759.
A video solution is available for this question — log in and enroll to watch it.