IPv4 Datagram Fragmentation and Delays
Why IPv4 Datagram Fragmentation required?
Different Networks may have different maximum transmission unit (MTU), for example due to differences in LAN technology. When one network wants to transmit datagrams to a network with a smaller MTU, the routers on path may fragment and reassemble datagrams.
How is Fragmentation done?
When a packet is received at the router, destination address is examined and MTU is determined. If size of the packet is bigger than the MTU, and the ‘Do not Fragment (DF)’ bit is set to 0 in header, then the packet is fragmented into parts and sent one by one. The maximum size of each fragment is the MTU minus the IP header size (Minimum 20 bytes and Maximum 60 bytes).
Each fragment is converted to a packet and the following changes happen in the datagram header:
- The total length field is changed to the size of the fragment.
- The More Fragment bit (MF bit) is set for all the fragment packets except the last one.
- The fragment offset field is set, based on the number of fragment that is being set and the MTU.
- Header Checksum is re-calculated.
Example: For a data packet of 4000 bytes and MTU of 1500 bytes, we have actual data of 3980 bytes that is to be transmitted and 1480 bytes is the maximum data size that is permissible to be sent. So, there would be 3 fragments:
For the first fragment, data size = 1480 bytes, offset = 0 and MF flag = 1
For the second fragment, data size = 1480 bytes, offset = 185(1480/ 8) and MF flag = 1
For the third fragment, data size = 1020 bytes, offset = 370 (2960/8) and MF flag = 0
An important point to be noted here is that all fragments would be having same identification number, thus indicating that all the fragments belong to the same parent data packet.
Processing delay: Time taken by the routers to process the data packet header.
Queuing delay: Time taken by the data packet in routing queues.
Transmission delay: Time taken to load a data packet onto the transmission channel Dt = N/R,
N: Number of bits to be transmitted
R: Rate or transmission speed of the channel
Propagation delay – Time taken by the data packet to reach from source to destination
Dp = D/S,
D: Distance between the source and the destination
S: is the speed of propagation
Below questions have been asked in previous GATE exam on above topics.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above