IAE Academy

GATE 2025 CS1 Q.57: solution and answer

GATE 2025 · CS1Q.57 · 2 marks · NAT

Suppose a message of size 15000 bytes is transmitted from a source to a destination using IPv4 protocol via two routers as shown in the figure. Each router has a defined maximum transmission unit (MTU) as shown in the figure, including IP header. The number of fragments that will be delivered to the destination is ________ . (Answer in integer)

GATE 2025 CS1 question 57: A left-to-right chain of boxes joined by arrows: Source, then Router-1 (MTU=5000 bytes), then Router-2 (MTU=3000 bytes)…Tap to open full size
Figure from the GATE 2025 CS1 paper. It is part of the question.
Figure description

A left-to-right chain of boxes joined by arrows: Source, then Router-1 (MTU=5000 bytes), then Router-2 (MTU=3000 bytes), then Destination.

Answer and solution

ANSWER

The destination receives 7 fragments.

Official answer: 7Source: Official answer key, GATE 2025 CS1 (IIT Roorkee)

  1. Take the 15000 bytes as the IP payload, with a 20-byte IP header on every fragment. The source's own link MTU is not given, so the datagram reaches Router-1 whole.

  2. Router-1 (MTU 5000, header included): the largest payload is bytes. Fragment offsets count 8-byte units, so every fragment except the last must carry a multiple of 8. The largest such size is bytes.

  3. Router-1 output: , so the fragments carry 4976, 4976, 4976 and 72 bytes of payload. That is 4 fragments.

  4. Router-2 (MTU 3000): the largest payload is bytes, rounded down to a multiple of 8, which is bytes.

  5. Each 4976-byte fragment is split again: . This gives 2 fragments each, so the three of them give fragments.

  6. The 72-byte fragment already fits within 2980 bytes, so it stays as 1 fragment.

  7. Fragments delivered to the destination: . Router-2 fragments Router-1's fragments and does not reassemble them. Only the destination reassembles.

KEY IDEA

Fragment at each router with the largest payload that fits in the MTU after the 20-byte header and is a multiple of 8. Routers fragment but never reassemble, so Router-2 splits the fragments of Router-1 and only the destination reassembles.

WATCH OUT FOR

Fragmenting the original 15000 bytes directly at 2976 bytes (giving 6 fragments), or forgetting that the 72-byte fragment from Router-1 passes through Router-2 unchanged, or ignoring the multiple-of-8 rule (4980 and 2980 are not multiples of 8).

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

More IPv4 questions