GATE CS 2025 Set 1 | Question 57

NAT · 2 marks

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)

Source to Router-1 (MTU = 5000 bytes) to Router-2 (MTU = 3000 bytes) to Destination

Answer

7

Explanation

Use the standard 20-byte IPv4 header. The data in every fragment except the last must be a multiple of 8 bytes, and routers never reassemble: each router only splits the packets it receives.

  • Router-1 (MTU 5000): at most \(5000 - 20 = 4980\) data bytes, i.e. 4976 as a multiple of 8. The 15000 bytes become \(4976 + 4976 + 4976 + 72\): 4 fragments.
  • Router-2 (MTU 3000): at most \(3000 - 20 = 2980\), i.e. 2976 data bytes. Each 4976-byte fragment splits into \(2976 + 2000\), but the last fragment (72 data bytes, 92 bytes with its header) already fits and passes through unchanged.

Fragments delivered \(= 3 \times 2 + 1 = 7\). The tempting \(4 \times 2 = 8\) wrongly splits the small fourth fragment again; even ignoring the multiple-of-8 rule (4980, 4980, 4980, 60) the count is 7.

Answer: 7