GATE CS 2024 Set 1 — Question 65

NAT+2 / -0HardIPv4 Packet & FragmentationNetwork Layer: AddressingComputer Networks

Computer Networks → Network Layer: Addressing → IPv4 Packet & Fragmentation

Last updated

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 _________

Correct answer

6 to 6

Solution

1.Original Datagram:
  • Total size = 1420 bytes
  • IP Header = 20 bytes
  • Data Payload = 142020=14001420 - 20 = 1400 bytes
2. Fragmentation at Link 1 (MTU = 542 bytes):
  • Maximum IP packet size = 542 bytes
  • Maximum data payload per fragment = 54220=522542 - 20 = 522 bytes
  • Since the Fragment Offset field is in units of 8 bytes, the data length in all but the last fragment must be a multiple of 8.
  • Largest multiple of 8 522\leq 522 is 520520 (65×865 \times 8).
  • Fragments generated:
  • Fragment 1: Data = 520 bytes, Total size = 540 bytes
  • Fragment 2: Data = 520 bytes, Total size = 540 bytes
  • Fragment 3: Data = 1400(520+520)=3601400 - (520 + 520) = 360 bytes, Total size = 380 bytes
3. Fragmentation at Link 2 (MTU = 360 bytes):
  • Maximum IP packet size = 360 bytes
  • Maximum data payload per fragment = 36020=340360 - 20 = 340 bytes
  • Largest multiple of 8 340\leq 340 is 336336 (42×842 \times 8).
  • Each fragment from Link 1 is checked against the new MTU:
  • Fragment 1 (520 bytes data): Needs fragmentation. 520=336+184520 = 336 + 184. (2 fragments)
  • Fragment 2 (520 bytes data): Needs fragmentation. 520=336+184520 = 336 + 184. (2 fragments)
  • Fragment 3 (360 bytes data): Needs fragmentation (since total size 380 > 360). 360=336+24360 = 336 + 24. (2 fragments)
4. Total Fragments at Receiver:
  • Total = 2+2+2=62 + 2 + 2 = 6 fragments.

More questions on Network Layer: Addressing

Practice GATE CS PYQs with adaptive difficulty

Timed practice, skill tracking, and AI explanations — free to start.

Start practicing free