A Guide to the Network Layer | OSI Model Layer 3

The OSI model is one of the most important parts of understanding network operations. The third layer – the network layer – is crucial to transferring data packets between different networks. In this article, we’ll cover what the network layer is and its functions, the network layer protocols, and the issues one may encounter at the third layer.

What is the network layer?

The network layer is the third layer in the OSI model. It provides a space for the router functionality necessary for a computer networking system. Routers operate at the third layer as it handles the routing of data.

Layer 3 is positioned between the transport layer and the data link layer. It responds to requests from the transport layer and subsequently issues requests to the data link layer. Though network-to-network connection essentially makes the Internet, layer 3 also provides necessary structure to the web as we know it.

It's connection-oriented, providing the functional means for sending data back and forth between different networks. The layer is responsible for determining the best route to move data from the source to the destination based on various factors, including network conditions, IP addresses, and service priority.

The transport layer, the fourth layer, passes data segments through the network layer, which is the third layer. Then, the third layer transmits received segments from the device to another device located on a different network.

A visual breakdown of the location of the network layer in the OSI model

What happens in the third layer?

OSI model layer 3 depends on layers above and below it to accomplish tasks. After data arrives at the layer, it breaks down into data packets. The layer then sends those data packets to the correct location on outgoing transmissions. It also receives incoming transitions.

The network provides data packets with the destination address. The addresses then route packets to their destination via the best possible delivery path.

Furthermore, routers function at this level. Along with providing routing services within an internetwork, they keep track of all traffic. Other essential components include switches, bridges, and firewalls.

OSI model layer 3 also places the sender and receiver’s IP address in the header in the network channel. Internet protocols for IPv4 and IPv6 operate at this layer.

Functions of the network layer

Layer 3 has several key functions. The network layer functions include inter-networking, logical addressing, routing and encapsulation, fragmentation and re-assembly, and error handling.

Inter-networking

Inter-networking is the layer’s primary responsibility. It provides network connections between multiple devices on a network, allowing for data transfer, communication, and other essential functions.

Logical addressing

Logical addressing, the term for IP addressing done in the third layer, identifies each device uniquely on the Internet. This then allows each data packet to reach its destination. The third layer of the OSI model fulfills this via logical addresses.

Ideally, each node must have a logical address in order to communicate using either IPv4 or IPv6. The addresses are assigned dynamically or statically via DHCP servers. The third layer header also contains IP addressing information, including source and destination addresses.

Routing and encapsulation

Routing involves moving data packets from source to destination. At this layer, routers direct messages to the right place. The network layer establishes routing paths for all data packets. It also sends data down to the data link layer in a process called encapsulation.

Fragmentation and re-assembly

The network layer delivers data between networks. It encapsulates the data, then transfers it to layer 2. However, in cases where the message being sent is too large, the layer divides messages into fragments that are sent individually and re-assembled at arrival.

Error handling

Though this layer manages error control, it relies heavily on the Internet Control Message Protocol for diagnostics. Ultimately, it ensures that packets arrive at the correct destination. If the data experiences any loss or corruption during the transfer process, the network layer detects and resends the damaged data to guarantee a complete packet transfer.

Network layer protocols

All the connections, addressing, routing, and error control processes are implemented at layer 3 using various protocols. IP (Internet Protocol) and ICMP (Internet Control Message Protocol) are two of the most widely-used protocols at the network layer.

IP packetizes data, forwards data, and delivers packets. Data segments received from the upper layer are thus converted into packets by the Internet protocol.

ICMP reports errors; it’s used by network devices like routers to communicate and diagnose network connectivity issues.

Other protocols include:

  • IGMP (Internet Group Management Protocol), which provides support for dynamic multicasting
  • RIP (Routing Information Protocol), which is a dynamic routing protocol
  • OSPF (Open Shortest Path First), which is a dynamic routing protocol
  • IPSec (Internet Protocol Security), which authenticates and encrypts data packets to secure them on the network layer
  • NAT (Network Address Translation), which maps one IP address to another

Network layer issues

For those who deal with this layer often, it’s beneficial to understand the issues one may encounter. For example, too many packets routed in the subnet can get into another’s way, creating bottlenecks. This unfortunately causes network congestion issues that can delay communication across the network.

Furthermore, the layer 3 infrastructure is inherently vulnerable to a long list of external attacks because it’s exposed on the Internet. Cybercriminals launch DDoS (Direct Denial-of-Service) attacks to overwhelm network devices like routers with the intent of stopping data transmission. Protecting a network from outside attacks is crucial, especially when it comes to preserving layer 3.

Frequently asked questions

What is a packet?

A packet is a unit of data. Data collected from the transport layer breaks down into small pieces – packets – for quick transmission from the network layer. 

Where is the network layer located in the OSI model?

The network layer is located between the data link layer and the transport layer as layer 3 in the OSI model.

What are the other layers in the OSI model?

Besides the network layer, there are six layers in the OSI model: the physical layer, the data link layer, the transport layer, the session layer, the presentation layer, and the application layer.