5.4IP header and fragmentation
The idea
If a datagram is bigger than the link MTU, a router splits it into fragments, each with its own header. Only the destination puts them back together.
Think of it like this: A long banner must pass through a narrow door: you cut it into strips that fit, number them by position, and rebuild it on the other side.
Why it exists
Counting fragments, finding the last fragment size and the offset field is a standard 2-mark question.
How it works
- Payload per fragment = ⌊(MTU − header)/8⌋ × 8.
- Offset field = bytes before the fragment / 8; MF = 1 except on the last.
- Number of fragments = ⌈data / payload per fragment⌉.
- When a later link has a smaller MTU, fragment every fragment again.
Worked example: 4500-byte datagram (20-byte header), MTU 600.
Data 4480. Per fragment = ⌊580/8⌋ × 8 = 576. The third fragment starts at byte 1152, offset 144 (GATE 2018).
Now play with it
- →Set the datagram to 1000, MTU 100 to get 13 fragments (GATE 2016).
- →Run 1420 bytes over MTU 542 and then MTU 360 by hand and check the lab (6 fragments).
| fragment | total length | payload | data bytes | offset field (×8) | MF |
|---|---|---|---|---|---|
| 1 | 596 | 576 | 0 to 575 | 0 | 1 |
| 2 | 596 | 576 | 576 to 1151 | 72 | 1 |
| 3 | 596 | 576 | 1152 to 1727 | 144 | 1 |
| 4 | 596 | 576 | 1728 to 2303 | 216 | 1 |
| 5 | 596 | 576 | 2304 to 2879 | 288 | 1 |
| 6 | 596 | 576 | 2880 to 3455 | 360 | 1 |
| 7 | 596 | 576 | 3456 to 4031 | 432 | 1 |
| 8 | 468 | 448 | 4032 to 4479 | 504 | 0 |
Payload per fragment = ⌊(MTU − header)/8⌋ × 8, because the offset field counts in units of 8 bytes. Every fragment carries its own header; only the last one has MF = 0. A fragment that is fragmented again keeps its offsets relative to the original datagram.
Check yourself
A fragment offset value of 300 means the fragment starts at byte
Exam notes (the dense version)
If a datagram is bigger than the link MTU, a router splits it. Each fragment has its own header (20 bytes with no options). Payload per fragment is a multiple of 8 bytes because the fragment offset field counts in 8-byte units: per = ⌊(MTU − header)/8⌋ × 8. Offset = (bytes before this fragment)/8; MF = 1 on all fragments except the last. Only the destination reassembles; routers may fragment again. Fields changed by a router: TTL and header checksum (and fragmentation fields). Header length (HLEN) is counted in 4-byte words; total length in bytes.
Previous year questions: IP Addressing & Network Layer (26)
PYQs are grouped by topic, so this is the full set for IP Addressing & Network Layer; try the ones that match this subtopic. Open all 26 on the topic page.