← 🌐 IP Addressing & Network Layer
Subtopic 4 of 5

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

  1. Payload per fragment = ⌊(MTU − header)/8⌋ × 8.
  2. Offset field = bytes before the fragment / 8; MF = 1 except on the last.
  3. Number of fragments = ⌈data / payload per fragment⌉.
  4. 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).
fragmenttotal lengthpayloaddata bytesoffset field (×8)MF
15965760 to 57501
2596576576 to 1151721
35965761152 to 17271441
45965761728 to 23032161
55965762304 to 28792881
65965762880 to 34553601
75965763456 to 40314321
84684484032 to 44795040
Fragments8
Payload per fragment (multiple of 8)576
Last fragment size468

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

Remember: Payload multiple of 8. Offset = start/8. Fragment count = ⌈data/payload⌉. Only the destination reassembles.
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.