GATE 2018 CS – Question 64
Consider an IP packet with a length of 4,500 bytes that includes a 20-byte IPv4 header and a 40-byte TCP header. The packet is forwarded to an IPv4 router that supports a Maximum Transmission Unit (MTU) of 600 bytes. Assume that the length of the IP header in all the outgoing fragments of this packet is 20 bytes. Assume that the fragmentation offset value stored in the first fragment is 0.
The fragmentation offset value stored in the third fragment is ________.
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: 144
Explanation
Total packet $=4500$ bytes, of which 20 bytes is the IP header, so the data to be fragmented is $4500-20=4480$ bytes.
MTU $=600$ bytes, so each fragment can carry at most $600-20=580$ bytes of data. Fragment data must be a multiple of 8 bytes (the offset is counted in 8-byte units), so the largest usable size is $576$ bytes.
- Fragment 1: bytes $0$–$575$, offset $0$.
- Fragment 2: bytes $576$–$1151$, offset $576/8=72$.
- Fragment 3: starts at byte $1152$, offset $1152/8=\mathbf{144}$.
More IPv4: Addressing, CIDR, Fragmentation and NAT questions
- GATE 2015 CS (CS1) Q26
- GATE 2016 CS (CS1) Q34
- GATE 2016 CS (CS1) Q63
- GATE 2014 CS (CS2) Q35
- GATE 2014 CS (CS3) Q35
- GATE 2014 CS (CS3) Q36
All IPv4: Addressing, CIDR, Fragmentation and NAT questions →