Question

Consider an IP packet with a length of 4,500 bytes that includes a 20-byte IPv4 header and a 40-byte TCP header. The packet is forwarded to an IPv4 router that supports a Maximum Transmission Unit (MTU) of 600 bytes. Assume that the length of the IP header in all the outgoing fragments of this packet is 20 bytes. Assume that the fragmentation offset value stored in the first fragment is 0.

The fragmentation offset value stored in the third fragment is _______.

Official answer and solution
Official answer
144
From
Official GATE 2018 answer key

Solution

Calculate maximum payload per fragment aligned to 8 bytes, and compute offset for the third fragment.

Total length of incoming packet is 4,500 bytes (including 20-byte IP header and 40-byte TCP header). The data payload carried by the IP packet is 4500−20=44804500 - 20 = 4480 bytes.

The router MTU is 600 bytes. With each fragment carrying a 20-byte IP header, the maximum payload per fragment is 600−20=580600 - 20 = 580 bytes.

Because fragment offset is measured in units of 8-byte blocks, fragment data payload size must be a multiple of 8:

Payload per fragment=⌊5808⌋×8=72×8=576 bytes\text{Payload per fragment} = \left\lfloor \frac{580}{8} \right\rfloor \times 8 = 72 \times 8 = 576\text{ bytes}

Trace fragment data ranges and offset values:

  • Fragment 1: bytes 0 to 575 (length 576 bytes). Offset =0/8=0= 0 / 8 = 0.
  • Fragment 2: bytes 576 to 1151 (length 576 bytes). Offset =576/8=72= 576 / 8 = 72.
  • Fragment 3: bytes 1152 to 1727 (length 576 bytes). Offset =1152/8=144= 1152 / 8 = 144.

Therefore, the fragmentation offset value stored in the third fragment is 144.

Final answer

144

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2018 Computer Science and Information Technology (CS)
Question
64 of 65, printed as CS Q.54
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.