IAE Academy

GATE 2024 CS1 Q.65: solution and answer

GATE 2024 · CS1Q.65 · 2 marks · NAT

Consider sending an IP datagram of size 1420 bytes (including 20 bytes of IP header) from a sender to a receiver over a path of two links with a router between them. The first link (sender to router) has an MTU (Maximum Transmission Unit) size of 542 bytes, while the second link (router to receiver) has an MTU size of 360 bytes. The number of fragments that would be delivered at the receiver is ______

See the question in the paper

Answer and solution

ANSWER

6 fragments are delivered at the receiver.

Official answer: 6Source: Official answer key, GATE 2024 CS1 (IISc Bengaluru)

  1. The datagram carries bytes of data. Every fragment has its own 20-byte header, and the data in every fragment except the last must be a multiple of 8 bytes (the fragment offset counts in units of 8 bytes).

  2. First link, MTU : each fragment has room for bytes of data. The largest multiple of 8 not above 522 is bytes.

  3. On the first link, . The router therefore receives 3 fragments, with data sizes , and bytes.

  4. Second link, MTU : each fragment has room for bytes of data. The largest multiple of 8 not above 340 is bytes.

  5. A router only fragments; it never reassembles. Each incoming fragment is split on its own. gives 2 fragments, and is a multiple of 8 even though it is not the last fragment overall. The second also gives 2 fragments. gives 2 fragments, the last of which carries the final 24 bytes of the datagram.

  6. The receiver gets fragments, with data sizes . These sum to bytes, which matches the original data.

KEY IDEA

Fragment on the first link with data in multiples of 8 bytes, giving 520, 520 and 360. The router then fragments each of these on its own for the smaller MTU. It never reassembles, so every first-link fragment is split again, and the receiver sees .

WATCH OUT FOR

Ignoring the first link and fragmenting 1400 bytes directly for MTU 360, which gives . Another slip is forgetting that fragment data must be a multiple of 8 bytes and using 340 or 522 instead of 336 or 520.

From the GATE 2024 CS1 paper. Every question of this paper · Download the full paper · All 20 IPv4 questions, with notes

More IPv4 questions