IPv4 Fragmentation Numerical Example 1

You’re given a datagram of 4000 bytes. That includes both the IP header and the actual data. Out of this, 20 bytes is the header, so the real data being carried is 3980 bytes.

Understanding the question in simple terms

Now the packet reaches a router, and the next link has an MTU of 1500 bytes. This means the router cannot send any packet larger than 1500 bytes on that link. So it has to break the packet into smaller fragments.

What these terms actually mean

A datagram is just a packet at the IP layer. It contains two parts: a header and the actual data. The header carries control information like source address, destination, and fragmentation details. The rest is your actual payload.

When you hear “actual size” or “payload size,” it means the data part only. So here, total size is 4000 bytes, header is 20 bytes, so payload becomes 3980 bytes.

MTU is the maximum size a network link can carry in one packet. It includes both header and data. So if MTU is 1500 bytes, and the header is 20 bytes, then each fragment can carry only 1480 bytes of data.

That’s why we subtract the header. Every fragment needs its own header, so we must leave space for it.

How the fragments are calculated

Each fragment can carry 1480 bytes of data. So you start splitting the payload step by step.

First fragment takes 1480 bytes
Second fragment takes another 1480 bytes
Remaining data becomes 3980 minus 2960 which gives 1020 bytes for the last fragment

Each fragment also gets a 20-byte header added back

So the total sizes become
First = 1480 + 20 = 1500
Second = 1480 + 20 = 1500
Third = 1020 + 20 = 1040

Understanding offset clearly

Offset tells where the fragment belongs in the original data. It is measured in units of 8 bytes, not normal bytes.

So you take the starting byte and divide by 8

First fragment starts at byte 0 → offset = 0
Second starts at byte 1480 → 1480 ÷ 8 = 185
Third starts at byte 2960 → 2960 ÷ 8 = 370

Final result in table form

Fragment Data Bytes Identification (ID) Offset (Bytes) Offset (/8) MF Flag Total Length
1st Fragment 1480 777 0 0 1 1500
2nd Fragment 1480 777 1480 185 1 1500
3rd Fragment 1020 777 2960 370 0 1040

Final takeaway

Once you understand three things, this type of question becomes easy. First, subtract the header to get payload. Second, divide based on MTU minus header. Third, calculate offset using division by 8.

 

Share: Facebook LinkedIn X

More Study Materials

Useful Resources