IP Fragmentation Calculator
Calculate how an IPv4 packet is fragmented across a smaller MTU. Find the maximum fragment payload, fragment count, fragment offsets, MF flags, per-fragment total length and final transmitted size.
| # | Payload Bytes | Total Length | Offset Units | Offset Bytes | MF | DF | Payload Range |
|---|
—
—
What Is IPv4 Fragmentation?
IPv4 fragmentation occurs when an IP datagram is larger than the Maximum Transmission Unit of the outgoing link and fragmentation is permitted. The original datagram payload is divided into smaller pieces, and each piece receives its own IPv4 header.
The destination uses fields such as Identification, Fragment Offset and the More Fragments flag to reassemble the pieces into the original datagram.
IPv4 Fragmentation Formula
Original Payload =
Original Packet Size
−
IPv4 Header Length
Maximum Raw Fragment Payload =
MTU
−
IPv4 Header Length
Maximum Non-final Payload =
floor(Max Raw Payload / 8) × 8The multiple-of-eight rounding is necessary because the IPv4 Fragment Offset field stores offsets in eight-byte units.
Example: 4000-Byte IPv4 Packet with MTU 1500
Assume a normal 20-byte IPv4 header.
Original Packet:
4000 bytes
Header:
20 bytes
Original Payload:
4000 − 20
= 3980 bytes
MTU:
1500 bytes
Maximum Raw Payload:
1500 − 20
= 1480 bytes
1480 is divisible by 8.
Fragments:
Fragment 1:
Payload = 1480
Offset = 0
MF = 1
Total = 1500
Fragment 2:
Payload = 1480
Offset = 1480 / 8 = 185
MF = 1
Total = 1500
Fragment 3:
Payload = 1020
Offset = 2960 / 8 = 370
MF = 0
Total = 1040IPv4 Fragment Offset
Fragment Offset is a 13-bit field that identifies where a fragment’s data belongs within the original datagram payload.
Fragment Offset Field =
Payload Byte Offset / 8
Example:
Payload begins at byte 1480
1480 / 8
= 185
Fragment Offset = 185Why Must Fragment Payload Be a Multiple of 8?
The offset field does not store an arbitrary byte position. Instead, one offset unit represents eight payload bytes. Consequently, all fragments that have another fragment after them must end on an eight-byte boundary.
The final fragment does not need its payload length to be divisible by eight, because no later fragment needs to begin after it.
IPv4 MF Flag
MF means More Fragments. It indicates whether another fragment follows the current fragment.
| MF | Meaning |
|---|---|
| 0 | No more fragments follow |
| 1 | Additional fragments follow |
For a newly fragmented datagram, every fragment except the last normally has MF=1.
IPv4 DF Flag
DF means Don’t Fragment. If DF is set and the IPv4 packet is larger than the outgoing MTU, a router cannot fragment the packet normally.
Packet:
2000 bytes
MTU:
1500 bytes
DF:
1
Result:
Fragmentation prohibitedIn normal IPv4 forwarding this condition can lead to an ICMP Destination Unreachable message indicating that fragmentation was needed.
IPv4 Header Overhead After Fragmentation
Fragmentation increases transmitted bytes because every fragment receives its own IPv4 header.
Original packet:
4000 bytes
Original header:
20 bytes
3 fragments:
3 × 20 = 60 header bytes
Extra header overhead:
60 − 20
= 40 bytes
Total fragmented transmission:
3980 payload
+
60 headers
=
4040 bytesIPv4 Fragmentation and MTU
The MTU determines the largest IP datagram that can cross a link without fragmentation at that link layer. Ethernet commonly has an MTU of 1500 bytes, although other values are possible.
The MTU applies to each resulting IP fragment’s complete IP packet size, including its IPv4 header.
Re-fragmenting an Existing Fragment
An IPv4 fragment can itself be fragmented again if it encounters a smaller MTU. In that case the new fragment offsets must remain relative to the original datagram, not relative merely to the fragment being split.
Existing offset units:
100
Existing byte offset:
100 × 8
= 800 bytes
New fragment data begins 400 bytes later:
New byte offset:
800 + 400
= 1200
New offset units:
1200 / 8
= 150The calculator’s Existing Fragment Offset field can be used for this scenario.
Maximum IPv4 Fragment Offset
The IPv4 Fragment Offset field contains 13 bits.
Maximum field value:
2^13 − 1
= 8191
Maximum represented byte offset:
8191 × 8
= 65,528 bytesOther IPv4 length constraints also apply, including the 16-bit Total Length field.