← Module 03 · Layer 3: Network

IPv4 Fragmentation

A packet too big for the next link doesn't just fail. A router splits it into fragments, each carrying just enough header information for the destination to put it back together in the right order. IPv6 dropped this mechanism entirely, which is exactly why it's worth understanding on the IPv4 side first.

Why a router ever splits a packet

Every outgoing link has an MTU (Maximum Transmission Unit): the largest frame it'll carry, commonly 1500 bytes on Ethernet. If a router receives an IPv4 packet bigger than the MTU of the link it needs to forward that packet out on, it has two options: drop the packet, or cut it into smaller pieces called fragments and send those separately. Each fragment gets its own full IP (Internet Protocol) header and travels independently, possibly by a different path, and only the final destination host reassembles them. Routers in between never reassemble anything.

It's like moving a wardrobe that won't fit through a doorway: the movers break it into numbered boxes, label where each box belongs in the finished piece, and mark only the very last box as "that's everything." Whoever unpacks it at the other end doesn't need the boxes to arrive in order, just enough labeling to know where each one goes and when the last one has shown up.

ROUTER SPLITS A 3800-BYTE PACKET FOR A 1500-BYTE-MTU LINK Original 3800B payload Router out: MTU 1500 Frag 1 · bytes 0–1479 · Offset 0 · MF=1 Frag 2 · bytes 1480–2959 · Offset 185 · MF=1 Frag 3 · bytes 2960–3799 · Offset 370 · MF=0 HOST reassembles Offset is in 8-byte units. MF=0 only on the last fragment.
A 3800-byte payload can't fit through a 1500-byte-MTU link in one piece, so the router splits it into three fragments. Each one is a fully independent IP packet with its own header.

Flags: More Fragments and Don't Fragment

The IPv4 header's 3-bit Flags field (covered briefly in the IPv4 Header Structure topic) is where the fragmentation logic actually lives:

Fragment Offset: Telling first, middle, and last apart

The 13-bit Fragment Offset field says where in the original payload this particular fragment's data starts, measured in 8-byte units (so a fragment starting at byte 1480 of the original payload carries an offset value of 1480 / 8 = 185). That's what lets fragments be reassembled correctly even if they arrive out of order, since every fragment knows exactly where it belongs regardless of when it shows up.

Combine Offset with MF and every fragment's position becomes unambiguous:

Position in the sequenceFragment OffsetMF flag
Not fragmented at all00
First fragment01
Middle fragment(s)> 01
Last fragment> 00

Offset 0 alone is ambiguous between "not fragmented" and "this is the first fragment," which is exactly why MF exists alongside it. Offset greater than zero combined with MF=0 is the only combination that unambiguously says "reassembly is complete after this one."

HOW DF POWERS PATH MTU DISCOVERY

Most modern operating systems set DF on every outgoing packet by default, which means routers along a real path essentially never fragment anything, they just drop and report. Path MTU Discovery (PMTUD) turns that into a deliberate probing tool: a host sends packets with DF set, and if one hits a link with too small an MTU, the router's Fragmentation Needed reply reports that link's MTU back to the sender, which then resends at a smaller size. Repeat that until nothing gets rejected, and the sender has discovered the smallest MTU anywhere along the path, without a single packet ever actually being fragmented.

WHY THIS TOPIC SITS RIGHT AFTER IPv6

IPv6 removed router-based fragmentation completely. Every IPv6 link is required to support at least a 1280-byte MTU, and if a packet still doesn't fit, the router drops it and sends back an ICMPv6 Packet Too Big message instead of splitting anything, pushing every network onto PMTUD by default. Only the originating host is ever allowed to fragment an IPv6 packet, and only by adding its own Fragment extension header before sending. Everything on this page is IPv4-specific for that reason.