GATE / CS ARCHIVE

GATE CSE 2013 / QUESTION 37

IPv4 last-fragment byte range

Computer Networks · IP Addressing, Fragmentation & Address Resolution · Full GATE CSE 2013 paper

GATE 2013, Q37 2 marks · MCQ
Report issue

IP Addressing, Fragmentation & Address Resolution

Question 37, GATE 2013: IPv4 has MF=0, HLEN=10, total length 400 bytes and fragment offset 300. Choose position and first/last payload byte indexes. A last, 2400, 2789; B first, 2400, 2759; C last, 2400, 2759; D middle, 300, 689.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Step through it (4 steps)

MF=0 indicates the last fragment; its positive offset shows it is not the sole initial fragment. The first payload byte has zero-based index 300×8=2400. HLEN10 means 40 header bytes, leaving 400−40=360 payload bytes. The last byte index is 2400+360−1=2759. Therefore C.

The fragment offset unit is 8 bytes, not 1byte, so offset 300 starts at original payload byte2400. HLEN counts 32-bit words:10 words=40 bytes of header. Subtracting that from total length 400 leaves 360payload bytes. Inclusive indexing makes the final byte2400+359=2759. MF=0 says no more fragments follow; because the offset is nonzero, this is a final fragment rather than a complete unfragmented datagram beginning at 0.

Original paper, page 8 · Answer key