Question

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 ________

Official answer and solution
Official answer
6
From
Official GATE 2024 answer key

Solution

Fragment the 1400-byte IP payload across Link 1 (MTU = 542, max payload multiple of 8 is 520 bytes) and then re-fragment each resulting packet across Link 2 (MTU = 360, max payload multiple of 8 is 336 bytes).

The original IP datagram has a 20-byte20\text{-byte} header and 1420−20=1400 bytes1420 - 20 = 1400\text{ bytes} of data payload.

  1. Fragmentation on the first link (MTU1=542 bytes\text{MTU}_1 = 542\text{ bytes}):

    • Maximum data per fragment must be a multiple of 8 bytes8\text{ bytes}:
      ⌊542−208⌋×8=⌊5228⌋×8=65×8=520 bytes\left\lfloor \frac{542 - 20}{8} \right\rfloor \times 8 = \left\lfloor \frac{522}{8} \right\rfloor \times 8 = 65 \times 8 = 520\text{ bytes}
    • The 1400-byte1400\text{-byte} payload is split into 3 fragments with payload sizes:
      • Fragment 1: 520 bytes520\text{ bytes} data (540 bytes540\text{ bytes} total)
      • Fragment 2: 520 bytes520\text{ bytes} data (540 bytes540\text{ bytes} total)
      • Fragment 3: 1400−1040=360 bytes1400 - 1040 = 360\text{ bytes} data (380 bytes380\text{ bytes} total)
  2. Fragmentation on the second link (MTU2=360 bytes\text{MTU}_2 = 360\text{ bytes}):

    • Maximum data per fragment:
      ⌊360−208⌋×8=⌊3408⌋×8=42×8=336 bytes\left\lfloor \frac{360 - 20}{8} \right\rfloor \times 8 = \left\lfloor \frac{340}{8} \right\rfloor \times 8 = 42 \times 8 = 336\text{ bytes}
    • Each of the 3 fragments arriving at the router exceeds MTU2=360 bytes\text{MTU}_2 = 360\text{ bytes} (even Fragment 3 has total size 360+20=380 bytes>360 bytes360 + 20 = 380\text{ bytes} > 360\text{ bytes}!) and is further fragmented:
      • Fragment 1 (520 B520\text{ B} data) →2\rightarrow 2 fragments (336 B+184 B336\text{ B} + 184\text{ B} data)
      • Fragment 2 (520 B520\text{ B} data) →2\rightarrow 2 fragments (336 B+184 B336\text{ B} + 184\text{ B} data)
      • Fragment 3 (360 B360\text{ B} data) →2\rightarrow 2 fragments (336 B+24 B336\text{ B} + 24\text{ B} data)

Total fragments delivered at the receiver =2+2+2=6= 2 + 2 + 2 = 6.

Final answer

6

Common trap

Thinking the 3rd fragment (with 360 bytes of payload) fits inside Link 2's MTU of 360 bytes, overlooking its 20-byte IP header (total size 380 bytes > 360 bytes), which would give 5.

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

Source

Paper
GATE 2024 Computer Science and Information Technology - Set 1 (CS1)
Question
65 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.