The Wayback Machine - https://web.archive.org/web/20241008141644/https://www.geeksforgeeks.org/fragmentation-network-layer/
Open In App

Fragmentation at Network Layer

Last Updated : 03 Oct, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Prerequisite – IPv4 Datagram Fragmentation and Delays 

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. 

Fragmentation at the network layer occurs when a data packet is too large to be transmitted over the network and needs to be broken down into smaller fragments. For a deeper understanding of how fragmentation works and its implications for network efficiency, the GATE CS and IT – 2025 course provides detailed explanations and real-world examples that illustrate the process and its challenges. 

  • Since there are 16 bits for total length in IP header so, the maximum size of IP datagram = 2 16 – 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(log 2 65515) = 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 2 16 /2 13 = 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 % 

 

  

GATE Practice question – 

  1. GATE CS 2013 | Question 65
  2. GATE-CS-2014-(Set-3) | Question 38
  3. GATE-CS-2015 (Set 2) | Question 65
  4. GATE-CS-2016 (Set 1) | Question 63
  5. GATE CS 2018 | Question 37


Previous Article
Next Article

Similar Reads

Difference Between Network Layer Protocols and Application Layer Protocols
Prerequisite: Basics of Computer Network In the world of computer networking, protocols are the set of rules that govern communication between devices. These rules dictate how devices should send and receive data over a network. Protocols are typically organized into layers, with each layer serving a specific purpose and working in conjunction with
6 min read
Why Flow Control is Used in Both Data Link Layer and Network Layer?
OSI model was established in1947 by international standard organization is a multinational body dedicated to worldwide agreement on international standards.ISO standard covers all the aspects of network communications is the Open System Interconnection model.It was introduced in the late 1070s. an open system is a set of protocols that allows any t
6 min read
Cisco Discovery Protocol (CDP) and Link Layer Discovery Protocol (LLDP) in Data Link Layer
Layer 2 or the Datalink layer provides physical addressing and access to media. It defines how data is to be formatted for transmission and how access to the network is to be controlled. It also provides error detection, ensuring data on higher layers is formatted correctly for transmission. Cisco Discovery Protocol (CDP) and Link Layer Discovery P
2 min read
Which Layer Called Error Detection Layer?
Answer: The Data Link layer is often referred to as the error detection layer.And, Transport Layer is also responsible for error detection and recovery in data communication. Error DetectionThe Data Link layer is responsible for transferring data frames between adjacent network nodes. During this process, it employs error detection techniques to en
1 min read
Difference Between Secure Socket Layer (SSL) and Transport Layer Security (TLS)
SSL stands for Secure Socket Layer while TLS stands for Transport Layer Security. Both Secure Socket Layer and Transport Layer Security are the protocols used to provide security between web browsers and web servers. The main difference between Secure Socket Layer and Transport Layer Security is that, in SSL (Secure Socket Layer), the Message diges
4 min read
Difference between layer-2 and layer-3 switches
A switch is a device that sends a data packet to a local network. What is the advantage of a hub? A hub floods the network with the packet and only the destination system receives that packet while others just drop due to which the traffic increases a lot. To solve this problem switch came into the picture. A switch first learns, by flooding the ne
5 min read
Why Star network is More Efficient in Network Fault Tolerance in Place of Bus Network?
Answer: Star networks offer better fault tolerance than bus networks because a single point of failure in a star network (the central hub) affects only the connected device, while a fault in a bus network can disrupt communication for all devices on the bus.Advantages of Star Topology Over Bus Topology Individual Connection Points: In a star networ
2 min read
IPv6 Fragmentation Header
Prerequisite - Internet Protocol version 6 (IPv6) Header In IPv4 fragmentation is done whenever required, at destination or at routers whereas in IPv6 only source is supposed to do fragmentation but not routers. This can only be done when source knows path Maximum Transmission Unit (MTU). In Ipv6 "do not fragment" bit is always 1 where case is not
4 min read
Introduction to Fragmentation
Fragmentation is an important function of network layer. It is technique in which gateways break up or divide larger packets into smaller ones called fragments. Each fragment is then sent as a separate internal packet. Each fragment has its separate header and trailer. Sometimes, a fragmented datagram can also get fragmented further when it encount
3 min read
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. In IPv4, when a packet is larger than the Maximum
5 min read
What is Fragmentation of a Packet?
The process of dividing the packet into smaller parts referred to as fragments when the maximum segment size of the network is smaller than the packet size is called fragmentation of a packet. The fragmented packets can be sent simultaneously with different routes to the different ports of the destination. The destination then performs the reassemb
3 min read
Difference Between Fragmentation and Compaction
In an operating system, memory management plays a vital role in maximum CPU utilization, when space is allocated to a process there is some loss of memory(fragmentation) leads to inefficient use of memory, and to reduce this loss one of the techniques (compaction) is used to optimize memory space. What is Fragmentation?Fragmentation occurs when the
4 min read
Difference between Internal and External fragmentation
Memory fragmentation is a prevalent problem in operating systems that can result in the inefficient use of memory resources. There are two types of fragmentation: internal and external, and they both have an impact on memory allocation and use. In this article, we are going to study the difference between Internal and External fragmentation in deta
4 min read
Network Layer in OSI Model
OSI stands for Open Systems Interconnection. It was developed by the ISO – ‘International Organization for Standardization‘, in the year 1984. It is a 7-layer architecture with each layer having specific functionality to perform. All these 7 layers work collaboratively to transmit the data from one person to another across the globe. What is a Netw
10 min read
Supernetting in Network Layer
Supernetting is the opposite of Subnetting. In subnetting, a single big network is divided into multiple smaller subnetworks. In Supernetting, multiple networks are combined into a bigger network termed a Supernetwork or Supernet. In this article, we'll explore the purpose and advantages of supernetting, along with essential considerations for its
4 min read
Traceroute in Network Layer
Consider a situation when you are not able to access a website and can access other websites. You would want to know if this is a problem with your network, some intermediate network, or with the webserver. How do you figure it out? You can use Traceroute. What is a traceroute? Traceroute is a widely used command-line utility available in almost al
2 min read
Design Issues in Network Layer
The Network layer is majorly focused on getting packets from the source to the destination, routing error handling, and congestion control. Before learning about design issues in the network layer, let's learn about its various functions. Addressing: Maintains the address at the frame header of both source and destination and performs addressing to
5 min read
Network Layer Protocols
Network Layer is responsible for the transmission of data or communication from one host to another host connected in a network. Rather than describing how data is transferred, it implements the technique for efficient transmission. In order to provide efficient communication protocols are used at the network layer. The data is being grouped into p
9 min read
Network Layer Services- Packetizing, Routing and Forwarding
The network Layer is the third layer in the OSI model of computer networks. Its main function is to transfer network packets from the source to the destination. It involves both the source host and the destination host. Key among these services are packetizing, routing, and forwarding. Packetizing involves encapsulating data into packets suitable f
8 min read
Differences between Wireless Adhoc Network and Wireless Sensor Network
1. Wireless Adhoc Network: A wireless ad-hoc network is a wireless network deployed without any framework or infrastructure. This incorporates wireless mesh networks, mobile ad-hoc networks, and vehicular ad-hoc networks. Its history could be traced back to the Defense Advanced Research Project Agency (DARPA) and Packet Radio Networks (PRNET) which
3 min read
Difference between Next Generation Network and Traditional Network
1. Next Generation Network : In short Next Generation Network is termed as NGN which is packet based network used for both telephony and data. It uses multiple broadband and Quality of Services (QoS) enabled transport technologies to establish advance communication system. NGN can handle multiple type of services/traffic such as voice, audio, video
5 min read
Difference between Network Administrator and Network Engineer
1. Network Administrator :A network administrator is a someone in an organization whose job is to manage organization's computer network. They also do jobs like on-site server organization , software networking and also placing the network in there correct position which is also called as Network Integrity. Those are the main thing in their job to
3 min read
Difference Between Network Security and Network Administration
In the world of information technology, there are two important and distinct roles that are often confused: network security and network administration. While these two jobs may be closely related, they require different sets of skills and responsibilities. It’s significant to understand the differences between network security and network administ
5 min read
Difference Between Network Management and Network Monitoring
Pre-requisites: Areas of Network Management Network management and Network monitoring are two important functions in maintaining the performance and security of a network. While they are often used interchangeably, they are distinct concepts with different goals and methods. Network management refers to the process of controlling, configuring, and
3 min read
Difference Between Network Congestion and Network Latency
Network congestion refers to a situation in which a network experiences an excessive amount of traffic, resulting in a reduction of available bandwidth and increased delays for network users. This can occur in both wired and wireless networks and can have a significant impact on the performance and reliability of the network. Congestion can occur d
9 min read
Basic Network Attacks in Computer Network
Many people rely on the Internet for many of their professional, social and personal activities. But there are also people who attempt to damage our Internet-connected computers, violate our privacy and render inoperable the Internet services. Given the frequency and variety of existing attacks as well as the threat of new and more destructive futu
7 min read
How Does a Network Topology Affect Your Decision in Setting up a Network?
Answer: Different Network Topology offer different costs, security, reliability, etc. So we choose one of the network topology as a blueprint for setting up our network according to the features that we required.By Network Topology we get to know how different nodes are connected in the network. There are different types of network topology like Bu
2 min read
How does a Network Interface Card (NIC) Facilitate Connectivity in a Wired Network?
Answer: A network interface card (NIC) facilitates connectivity in a wired network by providing an interface between the physical layer which provides the physical connection with the cables and the data link layer which provides reliable communication channel. The NIC converts the digital data into electrical data so that it can be transferred usi
2 min read
Difference Between Network Topology and Network Protocols
Network Topology and Network Protocols are closely related but distinct concepts in the field of computer networking. Network Topology refers to the physical and logical arrangement of devices on a network, while Network Protocols refer to the rules and standards that govern the communication between devices on a network. Understanding the differen
5 min read
Difference between Software Defined Network and Traditional Network
Whenever it comes to networks, new trends keep on adding up and thus it becomes essential to know about the dissimilarities that SDN Networks and Traditional Networks possess. Given the ever-increasing need for the expansion, fault tolerance, and resource optimization of the networks that connect today’s business environments, organizations, and IT
7 min read