Open In App
Related Articles

IPv4 Datagram Fragmentation and Delays

Improve Article
Save Article
Like Article

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. 

In IPv4, when a packet is larger than the Maximum Transmission Unit (MTU) of the network link it needs to traverse, it is fragmented into smaller packets. Each of these fragments contains a portion of the original packet, along with additional information that identifies the fragment’s position in the original packet and how it fits into the sequence of fragments.

Fragmentation can cause delays and other issues in the network. Here are a few ways in which this can happen:

  1. Increased processing overhead: Fragmentation requires additional processing and memory resources from the network devices involved in the transmission. This can increase the processing overhead and introduce additional delays into the network.
  2. Increased likelihood of packet loss: Since each fragment is transmitted separately, there is an increased likelihood of packet loss or corruption during transmission. If any of the fragments are lost or corrupted, the entire packet must be retransmitted, which can introduce additional delays and increase network congestion.
  3. Reassembly delays: The receiver of the fragmented packets must reassemble the original packet before it can be processed. This process can introduce additional delays, particularly if there are delays in receiving all of the fragments or if the fragments arrive out of order.

To minimize these issues, it is generally recommended to avoid fragmentation whenever possible by ensuring that packets are appropriately sized for the network links they will traverse. This can be accomplished through the use of Path MTU Discovery, which allows devices to determine the maximum packet size that can be transmitted without fragmentation on a given network path. Additionally, network administrators can implement Quality of Service (QoS) mechanisms to prioritize traffic and reduce delays caused by congestion.

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:

  1. The total length field is changed to the size of the fragment.
  2. The More Fragment bit (MF bit) is set for all the fragment packets except the last one.
  3. The fragment offset field is set, based on the number of fragment that is being set and the MTU.
  4. 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. 

Delays – 
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

Serialization delay: The time it takes to prepare a packet for transmission, including adding headers and trailers.

Latency: The time it takes for a packet to travel from the sender to the receiver.

Jitter: The variation in the arrival time of packets, causing a delay between when a packet was expected and when it was actually received.

Buffer delay: The time a packet spends waiting in a buffer before it can be transmitted. This can occur when a network device temporarily lacks the resources to process incoming packets.

Store-and-forward delay: The time a packet spends being processed and verified by a network device before being transmitted to the next hop.

Encapsulation delay: The time it takes to add layer 2 and layer 3 headers to a packet, which is necessary for transmission over the network.

Retransmission delay: The time it takes to resend a packet that was not successfully transmitted or received.

Congestion control delay: The time a packet spends waiting due to congestion control mechanisms, such as flow control or random early detection.

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.

  1. GATE CS 2012 | Question 42
  2. GATE-CS-2013 | Question 65
  3. GATE-CS-2014 Set 3 | Question 65


Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above

Level Up Your GATE Prep!
Embark on a transformative journey towards GATE success by choosing Data Science & AI as your second paper choice with our specialized course. If you find yourself lost in the vast landscape of the GATE syllabus, our program is the compass you need.

Last Updated : 25 Apr, 2023
Like Article
Save Article
Similar Reads