What is a Network Layer in OSI Model?
Computer systems use seven layers described by the Open Systems Interconnection (OSI) model to communicate over a network. A network layer is located at Layer 3 of the OSI communications model and primarily functions to transfer data between networks. To accomplish network layer functions, network layer protocols package data with the appropriate address information, select the appropriate network routes and forward the packaged data to the transport layer (layer 4).
There are two main functions of the network layer. One is to decompose segments into network packets and reassemble them on the receiving end.
Alternatively, packets can be routed by determining the best path across a physical network using network addresses (usually Internet Protocol addresses).
Function of Network Layer
The network layer is concerned with the third layer of the OSI model, which handles packetization, routing, and addressing of information packets. We have discussed these functions of the network layer below in brief.
- Internetworking: An important function of the network layer is to provide a logical connection between different types of networks.
- Addressing: Each device on the internet must be uniquely identified. This is similar to a telephone system. The address used at the network layer should uniquely and universally describe a computer's connection.
- Routing: Multiple routes can be chosen from a source to a destination. The network layer determines what route to take based on various factors.
- Packetizing: Packetizing is the process by which a network layer protocol called IP (Internetworking Protocol) encapsulates packets received from the upper layer protocol.
Protocols in the Network Layer of the OSI Model
In addition to IP, various other protocols are widely used at the network layer today, which implement the functions of the network layer.
Internet Protocol (IP): To deliver packets, IP defines packet structures that encapsulate the data based solely on IP addresses in the headers. Moreover, it defines the addressing methods used to identify the source and destination of the datagram.
Here are a few examples of Layer 3 protocols. These protocols route networks dynamically, communicate securely, translate networks, and implement network redundancy.
- Open Shortest Path First (OSPF) is a dynamic routing protocol.
- Routing Information Protocol (RIP) is a dynamic routing protocol.
- Network Address Translation (NAT) translates and manages one IP address into another.
- Internet Protocol Security (IPsec) is a secure network protocol suite that uses authentication and data encryption.
- Hot Standby Router Protocol (HSRP) is a network path redundancy protocol. Virtual Router Redundancy Protocol (VRRP) is a network path redundancy protocol.
Network Layer Design Issues
For designing a network layer and supporting the functions of the network layer, there are some challenges and details we need to consider and adhere to. The issues with the design of the network layer are listed below:
- Routing packets is a major design decision at the network layer. It determines how each packet is sent from one location to another.
- A route can be based on static tables or highly dynamic; packets can have a predefined route or be changed regularly.
- At some point, if too many packets are available in the subnet, they will get in each other's way, causing bottlenecks.
- The service quality at the network layer is determined by delays, transmission times, and jitter.
- Packets can encounter many problems during their transit from one network to another, such as one network may use a different addressing scheme than another.
- Different protocols are needed for two networks to communicate.
Advantages of Network Layer Services
Below is a list of some of the advantages and merits the network layer offers:
- Data packets are easily transported through packetization services at the network layer.
- The packetization of data communication systems also eliminates single points of failure.
- Routers create collision and broadcast domains in the network layer to reduce traffic.
- The forwarding method moves data packets between nodes in a network.
Disadvantages of Network Layer Services
Below is a list of some of the disadvantages of the network layer:
- The network layer design lacks flow control.
- There is sometimes congestion in a network due to too many datagrams, overburdening the routers or the network, which can cause some routers to drop some datagrams, and some important information to be lost.
- Due to fragmented data packets, indirect error control is ineffective at the network layer due to the lack of proper error control mechanisms.