Network Layer in OSI Model

Last Updated : 21 Oct, 2026

The Network Layer is the third layer of the OSI model responsible for logical addressing, routing, and end-to-end packet delivery across interconnected networks.

  • Handles logical (IP) addressing of devices
  • Determines optimal routing paths between networks
  • Enables host-to-host communication across multiple networks
29
Network Layer in OSI Model

Note: Unlike the Data Link Layer, which focuses only on node-to-node delivery within a single network segment, the Network Layer ensures that data travels from the source host to the destination host, even if they are located on different networks.

Key Responsibilities

  • Uses logical (IP) addresses to identify source and destination hosts.
  • Encapsulates transport layer segments into packets for efficient transmission.
  • Provides logical delivery of packets from the sender to the intended receiver across interconnected networks on a best-effort basis
  • Forwards packets from an incoming interface to the appropriate outgoing interface based on the destination IP address.
  • Determines the optimal path for packets to travel across multiple networks using routing algorithms and protocols.

Read more about Functions of Network Layer.

Working

  • Each device is assigned a logical address (IP address) for identification and communication within a network.
  • Data from the transport layer is encapsulated into packets, with source and destination IPs attached.
  • Routers analyze the destination address and determine the best available path.
  • Packets traverse the network hop-by-hop, moving across routers until reaching the destination.
  • In IPv4, packets may be fragmented when their size exceeds the outgoing link's MTU.
  • In IPv6, fragmentation is performed only by the source host.
  • At the destination, IPv4 fragments are reassembled into the original packet.
  • If errors occur (e.g., unreachable destination), protocols like ICMP send error messages back to the source.
how_packets_travel_from_here_to_there_
How Network Layer Works

IP Addressing

Subnetting

Covers IP address management using subnetting and VLSM to divide large networks into smaller, manageable subnets and calculate address ranges.

Routing

This subsection explains how data is routed across networks, covering static vs. dynamic routing and routing algorithms.

Network Layer Protocols and Technologies

Covers key Network Layer protocols such as ARP for device discovery, ICMP for error reporting, DHCP for automatic IP assignment, and dynamic routing protocols like RIP, OSPF, and BGP.

Advantages

  • Enables end-to-end communication across multiple networks.
  • Supports scalability by allowing subnetting and hierarchical addressing.
  • Efficiently routes packets using routing algorithms and dynamic routing protocols.
  • Provides inter-networking by connecting heterogeneous networks.

Disadvantages

  • Does not provide end-to-end flow control, so congestion can occur when network resources are overloaded.
  • Provides limited error handling and does not guarantee reliable delivery; reliability is generally handled by upper-layer protocols such as TCP.
  • Routers may drop packets under heavy load, leading to possible data loss.
  • Fragmentation increases processing overhead and may affect performance.

Routing vs Flooding

RoutingFlooding
Uses a routing table to determine the path.Does not require a routing table.
May select the shortest or best path depending on the routing algorithm.Does not specifically select the shortest path.
Generally provides controlled and efficient delivery.Can improve delivery reliability by using multiple paths.
Generates less network traffic.Generates more network traffic.
Generally avoids duplicate packets.May generate duplicate packets.
Comment

Explore