Network Design and Operations
In IPv4, a packet with a total length of 4000 bytes (a 20-byte header and 3980 bytes of data) is split up (fragmented) on a link with an MTU of 1500 bytes. The fragments also have 20-byte headers, and fragmentation is allowed. What is the value of the fragment offset field in the last fragment?
- A185
- B370
- C2960
Show answer and explanation
Answer: B. 370
Each fragment can hold MTU − header = 1500 − 20 = 1480 bytes of data, which is a multiple of 8 and can be used as it is. The 3980 bytes of data are split into three pieces of 1480, 1480 and 1020 bytes. The fragment offset gives the position in the original data in units of 8 bytes, so it is 1480 ÷ 8 = 185 for the second fragment and 2960 ÷ 8 = 370 for the third. The last fragment has a total length of 1040 bytes, and its MF flag is 0 to show that no more fragments follow. The destination puts fragments with the same identification in order of their offsets to reassemble the original packet.
- A. This is the offset of the second fragment.
- B. Correct. It starts at byte 2960 of the data, so 2960 ÷ 8 = 370.
- C. This is the number of bytes from the start itself. The offset field counts in units of 8 bytes.