GATE / CS ARCHIVE

GATE CSE 2024 SET 1 / QUESTION 65

Fragment each existing fragment at the next MTU

Computer Networks · IP Addressing, Fragmentation & Address Resolution · Full GATE CSE 2024 Set 1 paper

GATE 2024 Set 1, Q65 2 marks · NAT
Report issue

IP Addressing, Fragmentation & Address Resolution

Question 65, GATE 2024: An IPv4 datagram totals 1420 bytes including a 20-byte header. It traverses a sender-to-router link with MTU 542, then a router-to-receiver link with MTU 360. Assuming ordinary permitted fragmentation and 20-byte fragment headers, how many fragments reach the receiver?
Tap to enlarge
Answer & solution

Official answer: 6

Step through it (8 steps)

Approach: MTU includes each fragment's header. Nonfinal payload boundaries must align to eight-byte units, and the intermediate router fragments existing fragments rather than reassembling the original datagram.
1. Original payload is 1420−20=1400 bytes. On the first link, raw payload capacity is 542−20=522 bytes. Round down to a multiple of 8: floor(522/8)×8=520 bytes.
2. The sender creates payloads 520,520,360, each with a 20-byte header. Their original-data starting offsets are 0,520,1040 bytes.
3. On the second link, raw capacity is 360−20=340 bytes, with aligned nonfinal capacity floor(340/8)×8=336 bytes. Each 520-byte payload splits into 336+184; the 360-byte payload splits into 336+24.
4. Six payload fragments arrive: 336,184,336,184,336,24. Their starting offsets, in eight-byte units, are 0,42,65,107,130,172. Only the last has no more-fragments flag; total payload still sums to 1400.
Answer: 6. Applying ceil(1400/336)=5 directly at the second link incorrectly assumes that the router reassembles and repacks the first-link fragments. Normal IPv4 forwarding leaves reassembly to the final destination, and fragmentation presumes DF is unset.

Original paper, page 36 · Answer key