This layer is the third layer of the OSI model, and it is the lowest layer that manages end to end transmission and provides services to the transport layer. The network layer’s primary role is to route the messages associated with the higher protocol layer above it and across the network (the network which links the distributed DTEs systems).
The Network Layer can operate both in a connectionless-mode as well as in a connectionoriented mode. In LANs, the frame is addressed and routed between nodes attached to the same LAN using their point of attachment address.
The network layer is also known as the inactive layer or Null layer because of its lack of functionality in local area networks. If the network comprises several interconnected networks instead of a single LAN, then the network layer protocol is more complicated. It is entirely a software layer.
The goal of network layer to support logical services to several users linked to multiple networks. Hence, the services supported should be autonomous of the basic technology. In this way, the client’s use of the service requires inconvenience with the network’s physical execution to send their messages.
The main functions implemented by the network layer are as follows −
Routing − When a packet influences the router's input connection, the router will transfer the packets to the router's output connection. For instance, should forward a packet from S1 to R1 to the next router, S2.
Logical Addressing − The data link layer executes the physical addressing, and the network layer performs logical addressing. It can use it to determine between source and destination system.
Internetworking − This is the network layer’s central role that provides a logical connection between different networks types.
Fragmentation − Fragmentation breaks the packets into the minimal single data units that traverse through multiple networks.
Security services − The network layer offers security by utilizing a session element between the source and destination host. The network layer in the source host encodes the payloads of datagrams being transmitted to the destination host. In this layer, the destination host would then decode the payload.
Network Connection − When the Network layer receives a call request from the transport layer, it establishes a network connection across the subnetwork. For this, it makes use of data link connections. The end system’s network layer interacts with the network layer of the subnetwork access point for this purpose.
Error Detection − The network layer uses error detection functions to ensure that the quality of service provided over the network connection is maintained. Most of the errors are detected and corrected at the data link layer. The residual errors, Network Layer, notifies any. It relies on the quality of service provided, and the network layer incorporates the mechanism for error recovery.