StudyLover
  • Home
  • Study Zone
  • Profiles
  • Contact us
  • Sign in
StudyLover Fragmentation and Reassembly
Download
  1. PHD Computer Science
  2. Advanced Networking and Protocols
  3. IP Networking Essentials
IP- Datagram : ICP (Internet Cache Protocol)
IP Networking Essentials

Fragmentation 
In IP networking, fragmentation comes into play when an IP datagram (packet) needs to traverse a network with a lower Maximum Transmission Unit (MTU) compared to the size of the datagram itself. MTU defines the largest packet size that a network can handle. Imagine an IP datagram as a large shipment that needs to be broken down into smaller boxes to fit through a narrow tunnel. Fragmentation ensures data gets delivered even when encountering network limitations.

Here's a deeper dive into the process of fragmentation:

The Fragmentation Process:

  1. Datagram Size Check: When a router encounters a datagram exceeding the outgoing network's MTU, it initiates fragmentation.
  2. Fragmentation Occurs: The datagram is divided into smaller pieces called fragments. Each fragment has its own header containing essential information like:
    • Original Datagram Information: Identifies the original datagram the fragment belongs to (e.g., using the Identification field from the original header).
    • Fragment Offset: Indicates the position of the fragment within the original datagram.
    • More Fragment (MF) Flag:  A bit flag that specifies if more fragments follow (set to 1 for all fragments except the last one, and 0 for the last fragment).
    • Fragment Length:  Indicates the size of the data portion within the fragment (excluding the header).
  3. Reassembly: Routers along the data path reassemble the fragments based on the information in their headers. They buffer the fragments until all are received and then combine them in the correct order based on the fragment offsets to recreate the original datagram.
  4. Delivery: The reassembled datagram is then forwarded towards its final destination.

Datagram Fragmentation Considerations:

  • Fragment Size: The fragment size is typically chosen to be slightly smaller than the MTU to account for the additional header information added to each fragment.
  • Increased Processing Overhead: Fragmentation adds processing overhead for both routers (fragmenting and reassembling) and the receiving device (reassembly).
  • Potential for Fragment Loss: If a fragment is lost during transmission, the entire datagram cannot be reassembled at the destination, leading to data loss. Re-transmission protocols like TCP can help recover from such losses.
  • Datagram Lifetime: The Time to Live (TTL) field in the IP header is crucial. If a fragment gets stuck in a loop due to routing issues and exceeds its TTL, it's discarded to prevent network congestion.

When Fragmentation Might Occur:

Fragmentation is most likely to happen in scenarios like:

  • Large File Transfers:  When transferring large files (e.g., videos, software downloads) exceeding the MTU of an intermediate network.
  • Tunneling:  When encapsulating data packets within another protocol for transmission over a specific network (e.g., VPN tunnels might have lower MTUs).
  • Heterogeneous Networks:  When data travels across networks with varying MTU capabilities.

Techniques to Mitigate Fragmentation:

  • Path MTU Discovery (PMTUD):  A mechanism where a source device can discover the minimum MTU along the communication path, allowing it to adjust the datagram size to avoid fragmentation.
  • Jumbo Frames:  Some networks support larger MTUs (Jumbo Frames) to reduce fragmentation needs. However, their use requires compatibility across all network segments.

Understanding Fragmentation is Beneficial:

By understanding IP fragmentation, you gain valuable insights into network communication:

  • Troubleshooting Network Issues:  Fragmentation-related issues can manifest as data loss or delays. Recognizing fragmentation problems can aid in network troubleshooting.
  • Network Design Considerations:  When designing or managing networks, understanding MTU limitations and potential fragmentation scenarios is crucial.
  • Application Development:  For developers working with network-based applications, being aware of fragmentation can help optimize data transmission and handle potential issues.

In conclusion, IP fragmentation is a vital mechanism to ensure data delivery across networks with varying MTU constraints. While it adds some complexity, fragmentation allows for larger data transfers and efficient network utilization. By understanding its workings and potential implications, you gain valuable knowledge for troubleshooting network issues, designing efficient networks, and developing robust network applications.


Reliability

Reassembly is the crucial process in IP networking that follows fragmentation. When an IP datagram (packet) exceeds the Maximum Transmission Unit (MTU) of a network it needs to traverse, it's broken down into smaller fragments for transmission. Reassembly ensures these fragments are put back together at the destination device to recreate the original datagram. Imagine a large shipment that was broken down into smaller boxes to fit through a narrow tunnel; reassembly is like putting those boxes back together at the destination to retrieve the original shipment.

Here's a closer look at the reassembly process:

The Reassembly Process:

  1. Fragment Arrival:  Fragments of a datagram travel independently through the network and might arrive at the destination device in a different order compared to how they were sent.
  2. Fragment Buffering:  The receiving device has a designated buffer to temporarily store incoming fragments. This buffer holds the fragments until all are received for the complete datagram.
  3. Fragment Identification:  The device uses the information within the fragment headers to identify:
    • Original Datagram: The Identification field in the header helps associate the fragment with the original datagram it belongs to.
    • Fragment Order: The Fragment Offset field indicates the position of the data within the original datagram.
  4. In-Order Check: The device checks if all fragments for the datagram have arrived and if they are in the correct order based on their fragment offsets.
  5. Reassembly:  Once all fragments are received and verified, the device reassembles them in the correct order based on the fragment offsets. The data portions from each fragment are combined to recreate the original datagram.
  6. Delivery:  The reassembled datagram is then delivered to the higher-layer protocol (e.g., TCP, UDP) for further processing and application use.

Reassembly Considerations:

  • Fragment Buffer Size:  The receiving device's buffer size needs to be sufficient to hold all fragments for a datagram before they can be reassembled. Limited buffer space could lead to discarding fragments if they arrive faster than they can be processed.
  • Timeout Mechanisms:  The device might have a timeout timer associated with the reassembly process. If all fragments for a datagram aren't received within the timeout period, the reassembly attempt is abandoned, and the datagram is considered lost.
  • Error Handling:  Reassembly might fail due to missing fragments or corrupted data within fragments. Higher-layer protocols like TCP can handle such errors through retransmission mechanisms.

Importance of Reassembly:

Reassembly is essential for ensuring reliable data delivery in IP networking. Without it, fragmented datagrams would remain as individual pieces, rendering the data unusable. Here's why understanding reassembly is beneficial:

  • Troubleshooting Network Issues:  Reassembly problems can manifest as data loss or corruption. Recognizing these issues can help diagnose network problems like packet loss or excessive fragmentation.
  • Network Design Considerations:  When designing networks, it's crucial to consider factors like MTU and potential fragmentation scenarios to avoid excessive fragmentation that could overwhelm receiving devices' reassembly buffers.
  • Application Development:  For developers of network applications, understanding reassembly is important to handle potential data loss or corruption that might occur due to fragmentation issues.

In conclusion, reassembly is the flip side of fragmentation, playing a critical role in ensuring the integrity of data transmission across networks with varying MTU limitations. By understanding the reassembly process and its considerations, you gain valuable knowledge for troubleshooting network connectivity problems, designing efficient networks, and developing robust network applications.

Fragmentation at Network Layer

Fragmentation is done by the network layer when the maximum size of datagram is greater than maximum size of data that can be held in a frame i.e., its Maximum Transmission Unit (MTU). The network layer divides the datagram received from the transport layer into fragments so that data flow is not disrupted. 
 

  • Since there are 16 bits for total length in IP header so, the maximum size of IP datagram = 216 – 1 = 65, 535 bytes. 
     
  • It is done by the network layer at the destination side and is usually done at routers.
  • Source side does not require fragmentation due to wise (good) segmentation by transport layer i.e. instead of doing segmentation at the transport layer and fragmentation at the network layer, the transport layer looks at datagram data limit and frame data limit and does segmentation in such a way that resulting data can easily fit in a frame without the need of fragmentation.
  • Receiver identifies the frame with the identification (16 bits) field in the IP header. Each fragment of a frame has the same identification number.
  • Receiver identifies the sequence of frames using the fragment offset(13 bits) field in the IP header
  • Overhead at the network layer is present due to the extra header introduced due to fragmentation.

the need of Fragmentation at Network Layer:

Fragmentation at the Network Layer is a process of dividing a large data packet into smaller pieces, known as fragments, to improve the efficiency of data transmission over a network. The need for fragmentation at the network layer arises from several factors:

1.Maximum Transmission Unit (MTU): Different networks have different Maximum Transmission Unit (MTU) sizes, which determine the maximum size of a data packet that can be transmitted over that network. If the size of a data packet exceeds the MTU, it needs to be fragmented into smaller fragments that can be transmitted over the network.

2.Network Performance: Large data packets can consume a significant amount of network resources and can cause congestion in the network. Fragmentation helps to reduce the impact of large data packets on network performance by breaking them down into smaller fragments that can be transmitted more efficiently.

3.Bandwidth Utilization: Large data packets may consume a significant amount of network bandwidth, causing other network traffic to be slowed down. Fragmentation helps to reduce the impact of large data packets on network bandwidth utilization by breaking them down into smaller fragments that can be transmitted more efficiently.

Fragmentation at the network layer is necessary in order to ensure efficient and reliable transmission of data over communication networks.

1.Large Packet Size: In some cases, the size of the packet to be transmitted may be too large for the underlying communication network to handle. Fragmentation at the network layer allows the large packet to be divided into smaller fragments that can be transmitted over the network.

2.Path MTU: The Maximum Transmission Unit (MTU) of a network defines the largest packet size that can be transmitted over the network. Fragmentation at the network layer allows the packet to be divided into smaller fragments that can be transmitted over networks with different MTU values.

3.Reliable Transmission: Fragmentation at the network layer increases the reliability of data transmission, as smaller fragments are less likely to be lost or corrupted during transmission.

Fields in IP header for fragmentation –

  • Identification (16 bits) – use to identify fragments of the same frame.
  • Fragment offset (13 bits) – use to identify the sequence of fragments in the frame. It generally indicates a number of data bytes preceding or ahead of the fragment. 
    Maximum fragment offset possible = (65535 – 20)  = 65515 
    {where 65535 is the maximum size of datagram and 20 is the minimum size of IP header} 
    So, we need ceil(log265515) = 16 bits for a fragment offset but the fragment offset field has only 13 bits. So, to represent efficiently we need to scale down the fragment offset field by 216/213 = 8 which acts as a scaling factor. Hence, all fragments except the last fragment should have data in multiples of 8 so that fragment offset ∈ N.
  • More fragments (MF = 1 bit) – tells if more fragments are ahead of this fragment i.e. if MF = 1, more fragments are ahead of this fragment and if MF = 0, it is the last fragment.
  • Don’t fragment (DF = 1 bit) – if we don’t want the packet to be fragmented then DF is set i.e. DF = 1.

Reassembly of Fragments –

It takes place only at the destination and not at routers since packets take an independent path(datagram packet switching), so all may not meet at a router and hence a need of fragmentation may arise again. The fragments may arrive out of order also. 

 

 

Algorithm –

  1. Destination should identify that datagram is fragmented from MF, Fragment offset field.
  2. Destination should identify all fragments belonging to same datagram from Identification field.
  3. Identify the 1st fragment(offset = 0).
  4. Identify subsequent fragments using header length, fragment offset.
  5. Repeat until MF = 0.

Efficiency –

Efficiency (e) = useful/total = (Data without header)/(Data with header) 

Throughput = e * B { where B is bottleneck bandwidth } 

  Example – An IP router with a Maximum Transmission Unit (MTU) of 200 bytes has received an IP packet of size 520 bytes with an IP header of length 20 bytes. The values of the relevant fields in the IP header. 

Explanation – Since MTU is 200 bytes and 20 bytes is header size so, the maximum length of data = 180 bytes but it can’t be represented in fragment offset since it is not divisible by 8 so, the maximum length of data feasible = 176 bytes. 
Number of fragments = (520/200) = 3. 
Header length = 5 (since scaling factor is 4 therefore, 20/4 = 5) 
Efficiency, e = (Data without header)/(Data with header) = 500/560 = 89.2 % 

 

  

IP- Datagram ICP (Internet Cache Protocol)
Our Products & Services
  • Home
Connect with us
  • Contact us
  • +91 82955 87844
  • Rk6yadav@gmail.com

StudyLover - About us

The Best knowledge for Best people.

Copyright © StudyLover
Powered by Odoo - Create a free website