Introduction
Every link has a maximum transmission unit (MTU): the largest IP datagram, header included, that one link-layer frame can carry. Ethernet's is 1500 bytes; other links have larger or smaller ones. A datagram crossing several links may meet one whose MTU is smaller than the datagram. IPv4 then lets the router fragment it: split the data into pieces, give each piece its own IP header, and send the pieces as separate datagrams. They travel independently and are reassembled only at the destination host.
Three header fields make this work: identification (which datagram a fragment belongs to), the MF flag (more fragments follow) and the fragment offset (where this fragment's data starts, in 8-byte units). The DF flag forbids fragmentation; a router that would need to fragment a DF datagram drops it and reports back. The tasks are to find the number of fragments, each fragment's length, offset and MF bit, and the reverse: what a given fragment says about the original datagram.
Prerequisites
- IPv4 Addressing and Header: the identification, flags, offset, IHL and total-length fields and their units.
Core concepts
What each fragment carries
| Field | In each fragment |
|---|---|
| Identification | Copied from the original: the same in all fragments |
| Source, destination, protocol | Copied |
| Total length | This fragment's header plus its own data |
| MF | 1 in every fragment except the one holding the end of the original data; that one copies the original's MF |
| Fragment offset | Original offset plus (this fragment's first data byte) / 8 |
| Header checksum | Recomputed |
The two size rules
- Fits the MTU: header plus data MTU, so data MTU header length.
- Multiple of 8: every fragment except the last carries a multiple of 8 data bytes, because the next fragment's offset must be a whole number of 8-byte units.
So the largest data per fragment is
with bytes for a header without options. The last fragment is exempt from rule 2, so it may carry up to bytes, which exceeds when is not a multiple of 8. Only the data is split; the original header is not part of any fragment's data.
Reassembly
The destination collects fragments with the same (source, destination, protocol, identification), places each fragment's data at byte , knows the total size once it has the fragment with MF = 0, and delivers the datagram when every byte is present. If any fragment is lost, a reassembly timer expires and the whole datagram is discarded: IP never retransmits a single fragment.
Don't fragment and path MTU
If DF = 1 and the datagram exceeds the next link's MTU, the router discards it and returns ICMP Destination Unreachable with code 4, "fragmentation needed and DF set". Path MTU discovery (RFC 1191) uses this: the source sends with DF set and lowers its datagram size whenever such a message comes back, so that it never needs fragmentation.
How it works: fragmenting a datagram
A datagram of total length 5140 bytes (20-byte header, 5120 data bytes, identification 777) meets a link with MTU 1420. Then .
| Fragment | Data bytes | Data range | Total length | Offset | MF |
|---|---|---|---|---|---|
| 1 | 1400 | 0 to 1399 | 1420 | 0 | 1 |
| 2 | 1400 | 1400 to 2799 | 1420 | 175 | 1 |
| 3 | 1400 | 2800 to 4199 | 1420 | 350 | 1 |
| 4 | 920 | 4200 to 5119 | 940 | 525 | 0 |
Number of fragments . The four fragments put header bytes on the link instead of 20, so 60 extra bytes.

Mathematical explanation
For data bytes, header and MTU :
The first fragments carry each and the last carries the rest, which may be up to . The shortcut gives the same count except when and exceeds a multiple of by 1 to bytes (the 0 to 7 bytes of slack the last fragment may use), where it counts one fragment too many; so the two always agree when is a multiple of 8 (, as for MTU 1500 or 1420), and Example 1 shows a case where they differ.
Extra header bytes .
Reading a fragment backwards. A fragment with offset , total length and header holds data bytes to . It is the first fragment exactly when and MF = 1, the last when MF = 0 and , and a middle one when and MF = 1. From the last fragment, the original data length is .
Loss. If each fragment is lost independently with probability , the datagram survives with probability : fragmentation multiplies the loss rate roughly by for small .
Worked examples
Example 1: an MTU that is not 20 plus a multiple of 8
3000 data bytes, MTU 1006. , and , not 986.
| Fragment | Data | Total length | Offset | MF |
|---|---|---|---|---|
| 1 | 984 | 1004 | 0 | 1 |
| 2 | 984 | 1004 | 123 | 1 |
| 3 | 984 | 1004 | 246 | 1 |
| 4 | 48 | 68 | 369 | 0 |
Using 986 would give offsets of 123.25, which cannot be written.
With 2954 data bytes instead, the fragments are 984, 984 and 986 (RFC 791 cuts off bytes only while the rest does not fit): the last may use all 986 bytes the MTU allows, so . The shortcut is wrong here.
Example 2: fragmenting a fragment
Fragment 1 of the main example (1400 data bytes, offset 0, MF 1) and fragment 4 (920 data bytes, offset 525, MF 0) meet a link with MTU 620, so .
| From | Pieces (data, offset, MF) |
|---|---|
| Fragment 1 | (600, 0, 1), (600, 75, 1), (200, 150, 1) |
| Fragment 4 | (600, 525, 1), (320, 600, 0) |
Offsets stay relative to the original datagram. Every piece of fragment 1 has MF = 1, including its last, because more of the original follows; only the last piece of fragment 4 has MF = 0.
Example 3: from one fragment to the original
A fragment arrives with IHL 5, total length 420, offset 300 and MF 0. Its data is 400 bytes, bytes 2400 to 2799. It is the last fragment, so the original carried 2800 data bytes and had total length 2820 (with a 20-byte header).
Example 4: loss amplification
With per fragment and fragments, the datagram is lost with probability , almost four times the per-fragment rate.
Example 5: a header with options
A datagram with IHL 6 (a 24-byte header) carries 3000 data bytes to a link with MTU 1500. If every fragment carries the 24-byte header, : data 1472, 1472 and 56 bytes, offsets 0, 184 and 368, MF 1, 1 and 0, total lengths 1496, 1496 and 80. RFC 791 copies an option into every fragment only if the option's copied flag is set. If it is not set, only the first fragment has the 24-byte header and the later ones have 20 bytes, which gives data 1472, 1480 and 48 with offsets 0, 184 and 369. A question with options must say which case applies.
Example 6: total length is not data length
A datagram of total length 4000 bytes (20-byte header) meets MTU 1500. Its data is 3980 bytes: fragments of 1480, 1480 and 1020 data bytes, total lengths 1500, 1500 and 1040, offsets 0, 185 and 370. Treating 4000 as the data length gives a wrong last fragment of 1040 data bytes.
Important properties and observations
- Routers fragment, hosts reassemble. No router reassembles; fragments may take different paths.
- Any fragment can be fragmented again; offsets always refer to the original data.
- The header is replicated, not split. Each fragment's total length includes its own header.
- Identification groups fragments, together with source, destination and protocol.
- Minimum sizes. Every IPv4 module must forward a datagram of 68 bytes without further fragmentation, and every host must accept a reassembled datagram of 576 bytes (RFC 791).
Common misconceptions.
- "Offset counts bytes." It counts 8-byte units.
- "Fragment data is MTU minus 20." Only if that is a multiple of 8; otherwise round down to one, except in the last fragment.
- "The last piece of any fragment has MF = 0." Only if that piece ends the original datagram.
- "Lost fragments are retransmitted." The whole datagram is lost; any recovery is up to TCP.
- "The original header is counted as data." The data excludes the header.
Related material. IPv6 routers never fragment; only the source may, using a fragment extension header, after path MTU discovery.
GATE examination perspective
- Fragment table. Compute first, rounding down to a multiple of 8; then sizes, offsets (bytes / 8), total lengths (data + 20) and MF bits.
- Reverse questions. From offset, total length and MF: data range, position (first, middle, last), original length.
- Two-stage fragmentation. Offsets relative to the original; MF inherited by the last sub-fragment.
- Count of fragments and overhead. when is a multiple of 8; otherwise remember the last fragment may hold up to bytes. Extra bytes .
- DF set. Discard plus ICMP type 3 code 4, not fragmentation.
- Total length or data? Subtract the header first when the question gives the datagram's total length (Example 6).
Summary
Sources
- A. S. Tanenbaum, D. J. Wetherall, Computer Networks, 5th ed., Pearson, 2011: Sections 5.5.5 (Packet Fragmentation) and 5.6.1 (The IP Version 4 Protocol).
- B. A. Forouzan, Data Communications and Networking, 5th ed., McGraw-Hill, 2013: Chapter 19 (Network-Layer Protocols).
- J. Postel (Ed.), RFC 791, Internet Protocol, 1981, Sections 2.3 (Function Description: fragmentation), 3.1 (Internet Header Format, including the copied flag of options) and 3.2 (Discussion: fragmentation and reassembly, the 68-byte and 576-byte minimums), (consulted 2026-11-11).
- J. Postel, RFC 792, Internet Control Message Protocol, 1981 (Destination Unreachable, code 4), (consulted 2026-11-11).
- J. Mogul, S. Deering, RFC 1191, Path MTU Discovery, 1990, Section 2 (Protocol overview), (consulted 2026-11-11).