The term fragmentation in computer networks refers to the breaking up of a data packet into smaller pieces in order to fit it through a network with a smaller maximum transmission unit (MTU) than the initial packet size.
What is Fragmentation in Computer Networks?
Fragmentation in networking takes place in the Network Layer. In the network layer, when the maximum size of the datagram exceeds the maximum limit of the frame (Maximum Transmission Unit) at that time fragmentation in networking occurs.
Let’s take an example to understand the fragmentation in computer networks.
In the above example, we have divided the protocol data units of size 6000 bytes into 4 equal-sized (1500 bytes) new protocol data units and these new size fragments are perfect for transferring the data because, for campus and modern ethernet-based offices, 1500 bytes MTU is the standard.
Important points about fragmentation
Below are some important points about fragmentation:
- The maximum size of an IP datagram is 2^16 – 1 = 65, 535 bytes since the IP header has a total length of 16 bits.
- The network layer performs fragmentation at the destination side, typically at routers.
- The identification (16 bits) field in the IP header is used by the receiver to identify the frame. A frame’s individual fragments all share the same identification number.
- The fragment offset field of size 13 bits in the IP header is used for the receiver to identify the sequence of the frame.
- Fragmentation does not require at the source side because of the excellent segmentation by the transport layer.
- The extra header created by fragmentation results in overhead at the network layer.
Why does Fragmentation Require at the Network Layer?
Fragmentation is a technique that is implemented at the network layer because it involves breaking up the original data packet into smaller fragments and adding additional information to each fragment. This information is needed to indicate the order of the fragments and enable the recipient to reassemble the original packet correctly.
There are some factors that arise the requirement of fragmentation:
- Maximum Transmission Unit (MTU): The Maximum Transmission Unit (MTU) is the largest size of a data packet that can be transmitted over a particular network. It represents the maximum amount of data that can be carried in a single packet from one network device to another without the packet being fragmented. A data packet must be divided into smaller fragments before being transmitted over the network if its size exceeds the MTU.
- Bandwidth Utilization: In a network sometimes, large-sized data packets may end up consuming a large amount of network bandwidth. To solve this problem, fragmentation divides the large-sized data packet into small fragments which helps to improve the bandwidth utilization in the network.
- Network Performance: The network performance can be affected by the large-sized data packets. Fragmentation can help to solve this critical problem by dividing the large-sized data packets into small fragments which can be transferred more effectively.
IP Header Fields for Fragmentation:
Now, let’s look at some important fields in the IP header for fragmentation.
- Identification Field (16 bits): To identify the fragments of the same frame this field is used.
- Fragment offset field (13 bits): This field is used to identify the sequence of the fragments in the frame. In most cases, it denotes the number of data bytes before or before the fragment. The largest fragment offset that can be achieved is (65535 – 20) = 65515, where 65535 is the largest datagram size possible and 20 is the smallest IP header size. Since the fragment offset field only has 13 bits, we need ceil(log265515) = 16 bits for a fragment offset. Therefore, in order to efficiently represent, we need to scale the fragment offset field down by 216/213 = 8, which serves as a scaling factor. As a result, all fragments other than the final fragment should have data in multiples of 8, ensuring that the fragment offset equals N.
- More Fragment Field (MF): The size of this field is 1 bit. This field helps to determine whether ant fragments are ahead of this fragment or not. If the value of MF is 1 then there are some fragments ahead of this fragment. If the value of MF is 0 then this fragment is the last fragment.
- Don’t Fragment Field (DF): This is also a 1-bit size field. If the value of the DF field is 1 it means we do not want to fragment the packet.
How to Reassemble the Fragments?
As the packets take different paths in the router so reassembly of the fragments takes place at the destination side, not at the router. We have to take care two facts into consideration while performing the reassembly of the fragments. The first one is that all the fragments may not meet at the router and the second one is that all the fragments may not arrive into the sequence.
|More Fragment Field||Fragment Offset Field||Packet Type|
|1||Equal to 0||The first packet|
|1||Not equal to 0||Intermediate packets|
|0||Not equal to 0||The last packet|
|0||Equal to 0||Invalid Packet|
Algorithm to Reassemble the Fragments
Below is the steps to reassemble the fragments:
- Based on the MF, Fragment offset field, the destination should be able to determine that the datagram is fragmented.
- The destination should identify each fragment that is a part of the same datagram using the Identification field.
- Identify the first fragment where the value of offset is 0.
- Repeat the above steps until the value of MF is 0.
1. Why is fragmentation necessary in computer networks?
Fragmentation is necessary because different networks have different maximum transmission unit (MTU) sizes, which determine the maximum size of data packets that can be transmitted over the network. If a packet is too large to be transmitted over a network, it must be fragmented into smaller packets that can be transmitted and reassembled at the receiving end.
2. What are the disadvantages of fragmentation in computer networks?
Fragmentation can increase network traffic and reduce network performance, as the process of fragmenting and reassembling packets requires additional processing time and resources. It can also increase the likelihood of errors or loss, as fragmented packets are more susceptible to network interference or errors during transmission.
3. Can fragmentation cause packet loss or duplication?
Yes, fragmentation can cause packet loss or duplication. If a fragment is lost or corrupted during transmission, the receiving host will not be able to reassemble the original packet, resulting in data loss. On the other hand, if a fragment is duplicated during transmission, the receiving host may receive two or more identical fragments, resulting in data duplication.
4. How does the fragmentation process differ between IPv4 and IPv6 protocols?
In IPv4, fragmentation is typically done by the sender if a packet is too large to be transmitted over the network. In contrast, in IPv6, fragmentation is typically handled by the network layer, with the sender being responsible for setting the "Don’t Fragment" (DF) bit to ensure that the packet is not fragmented during transmission.
5. How does fragmentation affect the overall efficiency of network communication?
Fragmentation can reduce the efficiency of network communication by increasing the number of packets that need to be transmitted and processed. This can lead to additional network overhead, latency, and delays in data transmission and reception.