Network layer (Open System Interconnection Layer 3) specifies the packet structure and processing used to carry the data from one host to another host. Operating without regard to the data carried in each packet allows the network layer to carry packets for multiple types of communications between multiple hosts. The network layer (OSI Layer 3) provides four services to permit end devices to exchange data across the network.
Addressing end devices
Addressing to End devices must be configured. Without a unique IP address, there is no concept of data transmission across the network. Addressing End device is necessary for identification of the devices on the network.
Another important service of the network layer is to encapsulate the protocol data unit (PDU) from the transport layer (Layer 4) into a packet. The encapsulation method adds IP header information, such as the IP address of the source and destination hosts.
The network layer provides routing to direct packets to a destination host on another network. Router made it possible that the packet of one network travel to another network. The job of the router is to direct the packet to its best path toward the destination host. A packet may possibly cross many intermediary devices before reaching the destination host. Each router a packet crosses to reach the destination host is called a hop.
When the packet received at the network layer (Layer 3) of the destination host, the host checks the IP header of the packet. If the destination IP address and the IP address of the header matches. Then the IP header is removed from the packet. Removing of IP Header process is called De-encapsulation. After the packet is de-encapsulated by the network layer, the resulting Layer 4 PDU is passed upwards to layer 4 or transport layer.