The main function of the network layer or layer 3 of the OSI (Open Systems Interconnection) model is delivery of data packets from the source to the destination across multiple hops or links. It also controls the operation of the subnet.
The functions are elaborated as below −
When data is to be sent, the network layer accepts data from the transport layer above, divides and encapsulates it into packets and sends it to the data link layer. The reverse procedure is done during receiving data.
The network layer is responsible for routing packets from the source host to the destination host. The routes can be based upon static tables that are rarely changed; or they can be automatically updated depending upon network conditions.
Many networks are partitioned into sub-networks or subnets. The network layer controls the operations of the subnets. Network devices called routers operate in this layer to forward packets between the subnets or the different networks.
The lower layers assign the physical address locally. When the data packets are routed to remote locations, a logical addressing scheme is required to differentiate the source system and the destination system. This is provided by the network layer.
This layer also provides mechanisms for congestion control, in situations when too many packets overload the subnets.
The network layer tackles issues like transmission delays, transmission time, avoidance of jitters etc.