GATE / CS ARCHIVE

GATE CSE 2018 / QUESTION 54

IPv4 fragment offset

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

GATE 2018, Q54 2 marks · NAT
Report issue

IP Addressing, Fragmentation & Address Resolution

Question 54, GATE 2018: An IPv4 packet is 4500 bytes including a 20-byte IP header and 40-byte TCP header. Router MTU is 600 bytes; each fragment has a 20-byte IP header and the first offset is zero. Find the third fragment’s stored offset.
Tap to enlarge
Answer & solution

Official answer: 144

Step through it (4 steps)

Method

Fragment offset is measured in eight-byte units from the original IP payload start, not from the original IP header. A full fragment may hold 580 payload bytes by MTU, but a nonfinal fragment must end on an eight-byte boundary, so round down to 576. The first occupies payload bytes 0–575, the second 576–1151, and the third starts at 1152. Their stored offsets are 0,72,144. The TCP header travels as part of the first payload, without a new TCP header in later fragments.

Solution

Each fragment has room for 600−20=580 payload bytes. Nonfinal payload lengths must be multiples of 8, so use 576 bytes per full fragment. The third fragment starts after 2*576=1152 bytes of original IP payload, giving stored offset 1152/8=144. The40-byte TCP header is part of the IP payload and is not repeated or subtracted from every fragment. Fragmentation is assumed permitted, as the question prescribes outgoing fragments.

Original paper, page 22 · Answer key