OSI is an acronym for Open Systems Interconnection. It is a conceptual model that defines the standard communication protocols for diverse communication systems. In simple terms, it is a model that enables computer systems from different vendors to communicate with each other using standard protocols.
This model has a seven-layered architecture, where each layer has specific functionality. These layers are Physical, Data Link, Network, Transport, Session, Presentation, and Application.
- Physical layer: Transmits raw bitstreams over a physical medium.
- Data link layer: Defines the format of data on the network.
- Network layer: Decides the physical path for the data to transmit.
- Transport layer: Uses TCP and UDP protocols to transmit data.
- Session layer: Maintains connections and controls ports and sessions,
- Presentation layer: Ensures that the data is in a usable format. Data encryption takes place in this layer.
- Application layer: Applications and users can access the network services.
All the layers mentioned above function together to transmit data from one computer system to another.
In this article, we are going to discuss the network layer in detail. Also, we shall introduce you to the different functions and services of the network layer.
So, let us get started!
What is Network Layer?
The network layer is the third layer of the OSI model. It is responsible for transmitting data packets from the source to the destination. In other words, it provides data routing paths for communication between two systems across multiple links or networks.
Moreover, this layer is responsible for handling the service requests from the transport layer and forwarding them to the data link layer. It also manages network traffic issues, such as switching, routing, and congestion of data packets.
Layer 3 of the OSI model is present in both the source and the destination networks. On the sender side, this layer accepts a data packet from the transport layer, divides and encapsulates it in a datagram, and forwards it to the data link layer. On the receiver side, this layer decapsulates the datagram, extracts the data packets, and transmits it to the corresponding transport layer.
The following are the key functions of the network layer of the OSI model:
- Routing: This function determines the best optimal path from all the available paths to transfer data packets from the source to the destination.
- Logical Addressing: The network layer of the OSI model adds the logical addresses of both the sender and the receiver to the header of each data packet. The primary purpose of logical addressing is to distinguish between the source and the destination systems.
- Internetworking: This function establishes the logical connection between two devices connected to different networks.
- Fragmentation: This function divides the large data packets from the transport layer into several small packets so that they can travel through different networks to the destination.
Services of the Network Layer
Layer 3 of the OSI model provides only two primary services, namely packetizing and routing and forwarding.
Packetizing is the process of encapsulating data received from the transport layer into network-layer packets at the source and decapsulating the payload from the network-layer packets at the destination. Here, payload refers to the data received from the upper layer.
Initially, the source host adds the header to the data packets (received from the transport layer) with the logical addresses of the source and destination in it. Also, it adds all other information to the header of the payload that the network layer protocol requires it to have. Later, it transmits the payload to the data link layer.
On the other side, the destination host receives the network-layer packets from the data link layer, decapsulates them, and delivers them to the transport layer.
In this entire process, the routers cannot change or modify the local addresses of the source host and the destination host.
2. Routing and Forwarding
Routing and forwarding are two different services that are directly associated with each other.
There are multiple routes from the source to the destination in a network. It is the responsibility of the network layer to determine the best optimal path or route for data packets to travel between the source and the destination, and we refer to this process as routing.
Forwarding refers to the action of a router that it applies to the data packets received on one of its interfaces. Generally, a router uses a decision-making table to apply the action on data packets. This table is also referred to as the forwarding table and sometimes the routing table.
Whenever a router receives a data packet from one of its attached networks, it forwards that data packet to another attached network.
Advantages of the Network Layer Services
- Packetizing makes it easy to transmit the data packets from the source to the destination.
- It eliminates the single points of failure in data communication systems.
- Routers in the network layer significantly reduce the network traffic by creating collision and broadcast domains.
- The forwarding service enables the transfer of data packets from one host to another in a network.
Services to be Expected from The Network Layer
The following are the services that the network layer should provide:
1. Error Control
It is possible to implement the error control mechanism in the network layer but is not recommended to do so. This is because data packets are fragmented at each router in the network, which makes error checking inefficient.
2. Flow Control
The flow control mechanism controls the amount of data the source can send to the destination without overloading. If the sender generates data at a very higher rate than the receiver’s capability to consume it, the receiver will get overloaded with the sender’s data. To avoid the overloading of data at the receiver’s side, the receiver should send the feedback to the sender that it is overwhelmed with data.
3. Congestion Control
When the sender transmits the number of datagrams to the receiver beyond the capacity of the network or router, congestion occurs. Here, a datagram is a transfer unit associated with the packet-switched network. It consists of the header and payload sections.
If the congestion continues, there may be a situation where the source system may collapse, and no datagrams are delivered.
Network Layer Protocols
The network layer supports various protocols. The following are some of the most popular protocols:
ARP is an acronym for Address Resolution Protocol. The primary function of the protocol is to map a dynamic IP address to a permanent MAC address (physical machine address) in a local area network (LAN). It translates 32-bit addresses to 48-bit addresses and vice-versa. This is because the IP addresses in IPv4 are 32 bits; however, MAC addresses are 48 bits.
Moreover, this protocol works in layer 2 and layer 3 of the OSI model. MAC addresses are present on layer 2 (Data Link Layer), while IP addresses are on layer 3 of the OSI model.
Reverse Address Resolution Protocol is the full form of RARP. When a host or a physical machine in a local area network (LAN) wants to know its IP address, it can use the reverse address resolution protocol. It sends the device’s physical address to a specialized RARP server actively listening to RARP requests and is present on the same LAN as that of the device.
ICMP stands for Internet Control Message Protocol. The network devices, such as routers, in layer 3 of the OSI model use this protocol to diagnose network communications issues. They use ICMP to produce error messages to the source IP address when some network issues prevent the delivery of data packets.
In simple words, the primary intent of this protocol is to verify whether the data packets are reaching the desired destination or not. Moreover, ICMP is useful in error reporting and testing. It is also useful in distributed denial-of-service (DDoS).
IGMP is an acronym for Internet Group Message Protocol. This protocol enables various devices to share a single IP address in order to receive the same data. The hosts and adjacent routers use IGMP to enable multicast communication on the networks that use the Internet Protocol version 4 (IPv4). There can be single or multiple senders and receivers in multicast communication.
5. IPv4 and IPv6
Internet Protocol (IP) is a protocol that enables the transfer of data from one computer to another on the internet. Alternatively, Internet Protocol (IP) is a set of rules for routing and addressing data packets so that they can travel across networks and reach the correct destination.
The two versions of IP are IPv4 and IPv6 . IPv4 is a 32-bit addressing scheme, while IPv6 is a 128-bit addressing scheme.
The network layer is the third layer of the OSI model which is responsible for transmitting data packets from the source to the destination. It determines the best optimal route for each data packet to travel from the source host to the destination host. In addition, the network layer performs other functions, such as internetworking, logical addressing, and fragmentation.
When it comes to services, this layer of OSI offers packetizing and routing, and forwarding. However, it has to improve its error control, flow control, and congestion control services.
Hopefully, you found this article helpful in gaining a better understanding of the network layer of the OSI model. Feel free to leave your queries in the comments section below, if any.
People are also reading: