IPFragmentation Example
IPFragmentation Example
Scenario:
• An IPv4 datagram has a size of 4000 bytes, including a 20-byte IP header.
• The network's MTU is 1500 bytes.
Step-by-Step Process:
1. Determine the Data Size in Each Fragment:
• The MTU is 1500 bytes, but this includes the IP header (20 bytes).
• Maximum payload (data) size per fragment = 1500−20=1480 bytes.
2. Calculate the Number of Fragments Needed:
• Original data size = 4000−20=3980 bytes.
• Number of fragments = ⌈3980 / 1480 ⌉=3.
3. Break Down the Datagram into Fragments:
• Each fragment will have:
• A 20-byte IP header.
• A payload of data (except the last fragment, which may be smaller).
Fragment Details:
1. Fragment 1:
• Offset: 0 (since this is the first fragment).
• Data size: 1480 bytes.
• Total size: 20+1480=1500 bytes.
• Flags: More Fragments (MF) = 1.
2. Fragment 2:
• Offset: 1480/8=185 (in 8-byte units).
• Data size: 1480 bytes.
• Total size: 20+1480=1500 bytes.
• Flags: More Fragments (MF) = 1.
3. Fragment 3:
• Offset: 2960/8=370 (in 8-byte units).
• Data size: 3980−2960=1020 bytes.
• Total size: 20+1020=1040 bytes.
• Flags: More Fragments (MF) = 0 (indicating this is the last fragment).