Network Layer of OSI Model
What is Network Layer of OSI Model
The network Layer controls the operation of the subnet. The main aim of this layer is to deliver packets from source to destination across multiple links (networks). If two computers (system) are connected on the same link, then there is no need for a network layer. It routes the signal through different channels to the other end and acts as a network controller.
It also divides the outgoing messages into packets and to assemble incoming packets into messages for higher levels.
Need for Network Layer
To solve the problem of delivery through several links, the network layer was designed. The network layer is responsible for host-to-host delivery and for routing the packets through the routers or switches
The network layer at the source is responsible for creating a packet from the data coming from another protocol (such as a transport layer protocol or a routing protocol). The header of the packet contains, among other information, the logical addresses of the source and destination. The network layer is responsible for checking its routing table to find the routing information (such as the outgoing interface of the packet or the physical address of the next node). If the packet is too large, the packet is fragmented.
The network layer at the switch or router is responsible for routing the packet. When a packet arrives, the router or switch consults its routing table and finds the interface from which the packet must be sent. The packet, after some changes in the header, with the routing information is passed to the data link layer again.
The network layer at the destination is responsible for address verification; it makes sure that the destination address on the packet is the same as the address of the host. If the packet is a fragment, the network layer waits until all fragments have arrived, and then reassembles them and delivers the reassembled packet to the transport layer.
Functions of Network Layer
- It translates logical network address into physical address. Concerned with circuit, message or packet switching.
- Routers and gateways operate in the network layer. Mechanism is provided by Network Layer for routing the packets to final destination.
- Connection services are provided including network layer flow control, network layer error control and packet sequence control.
- Breaks larger packets into small packets.