Question

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)

Network path showing Source connected to Router-1 (MTU=5000 bytes), which connects to Router-2 (MTU=3000 bytes), which connects to Destination.
Official answer and solution
Official answer
7
From
Official GATE 2025 answer key

Solution

Fragment the 15000-byte payload first at Router-1 (MTU = 5000 B, 20 B IPv4 header, payload multiple of 8 B) and then fragment each resulting datagram at Router-2 (MTU = 3000 B).

Assume the standard 20-byte IPv4 header. In IPv4 fragmentation, every non-final fragment's data payload must be a multiple of 88 bytes:

  1. At Router-1 (MTU=5000\text{MTU} = 5000 bytes):
    • Maximum data per fragment =⌊5000−208⌋×8=⌊49808⌋×8=622×8=4976= \lfloor \frac{5000 - 20}{8} \rfloor \times 8 = \lfloor \frac{4980}{8} \rfloor \times 8 = 622 \times 8 = 4976 bytes.
    • Dividing the 1500015000-byte message payload: 15000=3×4976+7215000 = 3 \times 4976 + 72.
    • Thus Router-1 outputs 4 fragments with data payloads of 4976,4976,4976,4976, 4976, 4976, and 7272 bytes.
  2. At Router-2 (MTU=3000\text{MTU} = 3000 bytes):
    • Maximum data per fragment =⌊3000−208⌋×8=⌊29808⌋×8=372×8=2976= \lfloor \frac{3000 - 20}{8} \rfloor \times 8 = \lfloor \frac{2980}{8} \rfloor \times 8 = 372 \times 8 = 2976 bytes.
    • Each of the three 49764976-byte fragments splits into 2 fragments of data sizes 29762976 bytes and 4976−2976=20004976 - 2976 = 2000 bytes.
    • The 4th fragment (7272 bytes of data + 2020 bytes of header =92≤3000= 92 \le 3000 bytes) is not fragmented further (1 fragment).

Total fragments delivered to the destination =(3×2)+1=7= (3 \times 2) + 1 = 7.

Final answer

7

Common trap

Dividing 1500015000 directly by Router-2's payload capacity (⌈15000/2976⌉=6\lceil 15000 / 2976 \rceil = 6) instead of fragmenting sequentially through Router-1 and then Router-2.

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

Source

Paper
GATE 2025 Computer Science and Information Technology - Session 1 (CS1)
Question
57 of 65
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.