The Wayback Machine - https://web.archive.org/web/20240921222611/https://www.geeksforgeeks.org/network-layer-in-osi-model/
Open In App

Network Layer in OSI Model

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

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 Network Layer?

The Network Layer is the 5th Layer from the top and the 3rd layer from the Bottom of the OSI Model. It is one of the most important layers which plays a key role in data transmission. The main job of this layer is to maintain the quality of the data and pass and transmit it from its source to its destination. It also handles routing, which means that it chooses the best path to transmit the data from the source to its destination, not just transmitting the packet. There are several important protocols that work in this layer.

Layers of OSI Model

Data is transmitted in the form of packets via various logical network pathways between various devices. In the seven-layer open system interconnection paradigm, the network layer is the third layer. It offers routes for data packet transfers across the network. The network layer is also responsible for organising and controlling the available paths for data transfer.

Functions of Network Layer

Network Layer serves various important functions in the data transport mechanism. It is also responsible for the routing mechanism in which it selects the best path to transfer the data from source to it’s destination. It divides the entire data into smaller packets which eases the transfer procedure. It is also responsible for attaching the logical address to the devices between which the data transmission is happening, so that the packets reach correct destination and the destination can confirm that it is the same packet it was looking for. Some of the most important functions of the network layer is given below.

Functions of Network Layer

1. Assigning Logical Address

Network layer is solely responsible for assigning logical addresses to devices which are either sending or receiving data packets. It is useful to uniquely identify each devices in a certain network. The data packets sent or received consists the IP address of both the sender device and the receiver device. It is useful to confirm that the packets are sent or received by the desired parties. There are two part in an IP address, a Host ID and Network ID, using the Host ID it can be confirmed that the packets were sent by the authorized sender and it has successfully reached the desired receiver.

2. Routing

Routing is the process of identifying the best path to transmit the packets, Network Layer not only just sends packets from sender to receiver, but also determines the best route to send them. Numerous routers are used to find out the best and safest route to transmit the data packets. Various routing algorithms are used to determine the best path, like link state routing, Distance Vector Routing, Flooding, Random Walk etc. The header of each data packet holds the information regarding the path they need to follow to reach their destination via different routers. Usually there are multiple routers between the sender and the receiver, so the data packets are routed by using all these available routers.

3. Host-to-Host delivery

Host-to-Host delivery also known as Forwarding is the process in which the network layer transmits or forwards the data packets via routers, after determining the best path/route. In some cases it takes more than one router to reach the destination, Network Layer takes care of those too, it forwards packets from each router to the another router until it reaches the destination securely.

4. Logical Subnetting

Network Layer also allows a bigger network to be divided into smaller chunks of network known as Logical Subnetting. It helps the IP addresses to be used more efficiently and less amount of IP address will be wasted. It is also helpful to manage a larger network more efficiently. Due to smaller networks, it would be easier to find the device if any troubleshooting is needed.

5. Fragmentation and Reassembly

Each device / node has a maximum capacity to receive data (it may differ from Node to Node), which is called Maximum Transmission Unit (MTU). If the total size of data packets exceedes that size limit, then those data packets are fragmented into more smaller packets / fragmented so that they can fit the MTU. After fragmentation those packets are being send to the receiver, and at the receiving end all those fragmented packets are rearranged to create the actual data in order. The fragmentation is taken care by the routers.

6. Error Handling

Network Layer also check for errors and handles them. Network Layer uses various error detection techniques like Cylic Redundancy Check (CRC) , Checksums etc. Apart from just detecting, it also handle those errors using different approaches like Forward Error Correction (FEC), Hamming Code, Reed-Solomon Codes etc. It also re-transmit the packets which are either erroneous or didn’t reach the receiver. It uses the ACK messages to determine whether a packet has been successfully reached the receiver or not, if there is a Negative ACK, then it means that there is some error with the packet, and the receiver will ask the sender to resend that packet.

7. Quality of Service (QoS)

Network layer also keep track of the important data or the particular quality of data which is needed to be send first. Based on the QoS settings, it determines and prioritize the important data types which needed to be send first. It ensures that there is no delay in receiving the important data in any condition.

8. Network Address Translation (NAT)

Network Layer also takes care of the Network Address Translation (NAT), means that it converts any private IP address into a public IP address which is required to communicate between the sender and the receiver.

9. Congestion Control

Just like MTU, if there is an excessive load on the network which it can’t handle, the network become congested. Due to which the entire process of sending and receiving data comes to a pause. Congestion can be dealt with using different algorithms like Leaky Bucket Algorithm and Token Bucket Algorithm. In case of the leaky bucket algorithm, whatever might be the speed or amount of data flow into the bucket, the data leaks at a constant rate, which reduces the congestion in the network. In case of the Token Bucket Algorithm, tokens are being added into the bucket one by one, until it has reached the maximum capacity, then one by one according the token sequence each data packet is transmitted.

10. Encapsulation and Decapsulation

Network Layer encapsulates the data coming from the Transport Layer, and also adds important header parts to the packets, which consists of the necessary information like source IP address and destination IP address. After receiving the data packets on the destination side it decapsulates those and make them of original size.

Working of Network Layer

The network layer will initially receive data from the OSI model’s transport layer as part of the data flow between that layer and other OSI levels. These data packets are handled by the network layer by include their source and destination addresses. Additionally, it incorporates the network protocols for proper transfer to the data-link layer over the network channel.

Responsibilities of the Network Layer

In the network channel and communication channel, the network layer is in charge of the responsibilities listed below:

  • It is in charge of managing the network channel’s quickest routing path for the data packet.
  • The network layer packages the data that has been received for transmission.
  • maintains the network traffic in the channel by handling the network layer protocols.

Protocols Used at Network Layer

A protocol is a set of rules for data structuring that enables communication and mutual understanding between two or more devices. At the network layer, a variety of protocols enable connections, testing, routing, and encryption, including:

Problems with the Network layer design

  • The decision of how to direct packets is a pivotal aspect of network layer design. It holds great significance as it sets the groundwork for the protocol governing the transmission of packets between nodes in a network.
  • In the nodes, data transmission can be facilitated through either static tables or dynamic tables. These tables serve as the routes for the transmission of information. The paths may be pre-established or subject to frequent alteration.
  • The smooth flow of data in the network can be disrupted unexpectedly if there is an overwhelming abundance of packets being transmitted or present on the network. Consequently, the network might encounter bottlenecks causing a decline in its performance.
  • Separate protocols are needed to enable communication between the two networks.

Advantages of Network Layer

  • Using the network layer in the OSI paradigm offers a multitude of advantages. Let’s delve into some of these benefits:
  • The network layer takes the data and breaks it down into packets, which makes transmitting the data over the network easier. This process also eliminates any weak points in the transmission, ensuring that the packet successfully reaches its intended destination.
  • Router is the important component of the network layer . Its role is to reduce network congestion by facilitating collisions and broadcasting the domains within the network layer.
  • Used to send data packets across the network nodes, the forwarding method is various.

Disadvantages of Network Layer

  • There is no flow control mechanism provided by the network layer design.
  • There may be times when there are too many datagrams in transit over the network, causing congestion. This could put further strain on the network routers. In some circumstances, the router may lose some data packets if there are too many datagrams. Important data may be lost in the process of transmission as a result of this.
  • Indirect control cannot be implemented at the network layer since the data packets are broken up before being sent. Additionally, this layer lacks effective error control systems.

Difference Between Routing and Flooding

Routing

Flooding

A routing table is required.

No Routing table is required

May give the shortest path.

Always gives the shortest path.

Routing is less reliable

Flooding is more reliable

Traffic is less in Routing

Traffic is more in Flooding

Duplicate packets are not present

Duplicate packet are present

Frequently Asked Question on Network Layer – FAQs

Which is network layer device?

Routers is network layer device. A router is a device that routes data packets based on IP addresses.

What services are offered by Network Layer in general?

Packetizing, Forwarding and Routing are the three general services offered by Network Layer.

Which algorithms are used by network layer when there is a congestion in the network?

Network layer uses algorithms like Token Bucket Algorithm and Leaky Bucket Algorithm to handle congestion.

How does the Network Layer handle fragmentation and reassembly?

The reassembly is done by the destination, or receiving host. For your reference: The receiving host reassembles the fragments. Furthermore, according to further sources: An IP datagram is fragmented and isn’t put back together until it reaches its destination.

What is a subnet?

A network inside another network is called a subnet, or subnetwork. Subnets improve the efficiency of networks. Network communication can travel a shorter distance and avoid going through extra routers by using subnetting to reach its destination.



Similar Reads

What is OSI Model? - Layers of OSI Model
OSI stands for Open Systems Interconnection , where open stands to say non-proprietary. 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. The OSI reference model was developed by ISO - 'International Organiz
15+ min read
Physical Layer in OSI Model
The physical Layer is the bottom-most layer in the Open System Interconnection (OSI) Model which is a physical and electrical representation of the system. It consists of various network components such as power plugs, connectors, receivers, cable types, etc. The physical layer sends data bits from one device(s) (like a computer) to another device(
5 min read
Presentation Layer in OSI model
Prerequisite : OSI Model Introduction : Presentation Layer is the 6th layer in the Open System Interconnection (OSI) model. This layer is also known as Translation layer, as this layer serves as a data translator for the network. The data which this layer receives from the Application Layer is extracted and manipulated here as per the required form
6 min read
Session Layer in OSI model
Prerequisite : OSI Layer Introduction :The Session Layer is the 5th layer in the Open System Interconnection (OSI) model. This layer allows users on different machines to establish active communications sessions between them. It is responsible for establishing, maintaining, synchronizing, terminating sessions between end-user applications. In Sessi
5 min read
Functions of Physical layer in OSI Model
The physical layer is the lowest layer of the OSI model. The physical layer consists of various networking devices such as connectors, receivers, plugs, modems, repeaters, cables, Hubs, etc. The rules and procedures that are defined for interaction between the physical layers are known as physical layer protocols. The physical connections between t
5 min read
Data Link Layer in OSI Model
Below are some common GATE CS topics of data link layer. Carrier Sense Multiple Access (CSMA) Carrier Sense Multiple Access or CSMA method was developed to minimize the probability of collision and thus, to increase the performance. The probability of collision can be minimized if a station senses or reads the medium before trying to use it for sen
3 min read
Transport Layer in OSI Model
The transport layer, or layer 4 of the OSI model, controls network traffic between hosts and end systems to guarantee full data flows. Data volume, destination, and rate are all controlled by transport-layer protocols including TCP, UDP, DCCP, and SCTP. The transport layer is positioned between the network and session layers in the OSI paradigm. Th
7 min read
Which layer of OSI Model is Responsible for Reliable Connections?
Answer: The Transport layer of the OSI model is responsible for reliable connections.Reliable DeliveryThe Transport layer ensures the reliable delivery of data between source and destination hosts, regardless of the underlying network's reliability. Error Detection and CorrectionThe Transport layer uses techniques like checksums and sequence number
1 min read
Application Layer in OSI Model
The Application Layer of OSI (Open System Interconnection) model, is the top layer in this model and takes care of network communication. The application layer provides the functionality to send and receive data from users. It acts as the interface between the user and the application. The application provides services like file transmission, mail
8 min read
Similarities between TCP/IP model and OSI model
Pre-Requisite: Layers of OSI Model, TCP/IP Model OSI Model or Open Systems Interconnection is an architecture of 7 layers in which each layer has its work to perform whereas TCP/IP is a concise version of the OSI Model. TCP/IP Model consists of 4 layers rather than the 7 layers of the OSI Model. There are so many similarities between the TCP/IP mod
5 min read
This is exactly why we still use the OSI model when we have TCP/IP Model
What is the OSI Model?OSI is an acronym for Open Systems Interconnection. The International Organization for Standardization (ISO) created the OSI model (ISO). It's a model for how applications communicate over the internet. In order to facilitate interoperability between diverse devices and applications, the OSI model describes computing functions
10 min read
Difference Between OSI Model and TCP/IP Model
Data communication is a process or act in which we can send or receive data. Understanding the fundamental structures of networking is crucial for anyone working with computer systems and communication. For data communication two models are available, the OSI (Open Systems Interconnection) Model, and the TCP/IP (Transmission Control Protocol/Intern
5 min read
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
Critique of OSI Model and Protocols
Open System Interconnection (OSI) model is reference model that is used to describe and explain how does information from software application in one of computers moves freely through physical medium to software application on another computer. This model consists of total of seven layers and each of layers performs specific task or particular netw
4 min read
How Communication happens using OSI model
The Open System Interconnection (OSI) model is a standard “reference model” created by an International Organization for Standardization (ISO) to describe how software and hardware components involved in network communication divide efforts and interact with each other. The OSI model defines a seven-layer set of functional elements, from physical i
4 min read
Why Does the OSI Reference Model Matter?
OSI (Open Systems Interconnection) model is a reference model that describes the movement of information between software applications in different computer systems. It is a seven-layered model used in computer networking. It is useful for developing new standards while considering the existing networking standards. With dynamically changing needs
3 min read
How OSI Model Works in Real Life Example?
Answer: The OSI model is defined as a framework that helps to understand the network architecture and communication protocols. It provides with the systematic approach for transmission and communication of between the devices connected in the network. Below are the Real life examples: Example 1: Ethernet and Local Area Networks Ethernet is defined
2 min read
OSI Model Full Form in Computer Networking
Introduction : The OSI (Open Systems Interconnection) model is a conceptual framework that defines how computers communicate with each other over a network. It consists of seven layers, each with its own specific function and set of protocols. Starting from the bottom, the first layer is the physical layer, which deals with the physical aspects of
5 min read
Working of ISO-OSI Model
The ISO-OSI (International organization of Standardization - Open System Interconnection) says to group together the functions which are related to each other. The Functions in OSI Model that are needed for proper communication can be divided into 2 types :- 1. Mandatory Functions: Here the implementation of the functions is not optional, i.e., it
7 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
Devices used in each layer of TCP/IP model
Prerequisite - TCP/IP Model, Network Devices 1. Physical Layer - Physical layer of TCP/IP model is responsible for physical connectivity of two devices. Some of the devices used in Physical layers are, Hubs: Hubs are devices commonly used to connect segments of a LAN. It contains multiple input/output ports. when signal is at any input port, this s
4 min read
Fragmentation at Network Layer
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 no
6 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
Article Tags :