GATE Daily

Tuesday27 October 2026

Past sets27 Oct 2026Networks

IP fragmentation: GATE CS question with solution

Q.10

A host sends one UDP datagram carrying 2928 bytes of application data over IPv4. The UDP header is 8 bytes and every IPv4 header is 20 bytes (no options). The datagram must cross a link whose MTU is 1000 bytes, including the IP header. The DF bit is not set. Assume the router fragments greedily: while the remaining data does not fit in one fragment, it emits the largest fragment allowed and repeats on the rest; once the remaining data fits within the MTU, it sends it as the last fragment.

Which ONE of the following gives the number of IP fragments and the fragment offset field value of the last fragment?

One try. It counts in your 27 Oct 2026 set.
Show solution
RememberIPv4 non-final fragments carry (MTU - IP header) rounded down to a multiple of 8 data bytes; the last fragment may use the full MTU - IP header. The transport header counts as data, and the offset field is the starting data byte divided by 8.

Solution MCQ · 1 mark · −⅓ if wrong

Answer: (C) 4 fragments, offset 366

Method.

  1. Data that IP must carry: UDP header + application data bytes.
  2. Room in one fragment: data bytes. A non-final fragment must carry a multiple of 8 data bytes (the offset field counts 8-byte units), so a non-final fragment carries at most . The last fragment has no such restriction and may carry up to 980.
  3. Split greedily: after two fragments of 976, bytes remain. That is more than 980, so it cannot go as the last fragment; send another 976-byte fragment, leaving bytes for a fourth, final fragment. Fragments carry bytes: 4 fragments.
  4. The last fragment starts at data byte ; the offset field is .

The trap. Each slip lands on a different option. Forgetting that the UDP header is data to IP leaves 2928 bytes, and after two 976-byte fragments the remaining 976 fit in a final fragment (3 fragments, offset 244). Allowing 980 bytes in non-final fragments gives (3 fragments, offset 245). Reporting the start position in bytes gives 2928 instead of 366. Note the asymmetry in step 2: only non-final fragments are rounded down to a multiple of 8, so always check whether the remainder fits in the full before adding one more fragment.

What was tested. The fixed rules of IPv4 fragmentation: the transport header is data to IP, non-final fragments carry a multiple of 8 data bytes, the final fragment may use the full room, and the offset field counts 8-byte blocks.

Copied. Paste it into the new chat.Too long to send. Copy the question and solution by hand.