The Network Layer Explained
The primary functions of the network layer include defining logical addresses, determining optimal paths to reach destinations based on these addresses, and facilitating connections between various media types such as Ethernet, fiber-optic, serial, and Token Ring.
Logical Addressing
The network layer assigns logical addresses to network components. These addresses are known as IP addresses. IP addresses enable grouping devices and identifying specific components within the network. Each IP address consists of two parts: a network component and a host component. The network component serves as a group identifier, shared by all members of the group, while the host component uniquely identifies individual devices within the group. Both components are combined in an IP address.
To distinguish between the network and host components, a subnet mask is used with the IP address. The subnet mask separates the network portion from the host portion of the IP address.IP addresses represent both network and host components numerically and are 32 bits in length. For readability, these addresses are divided into four octets, separated by periods. 1.1.1.1, 2.2.2.2, 10.0.0.1, 192.168.1.1, and 172.168.0.1 are a few examples IP addresses. This format is referred to as dotted decimal notation.
An IP address is written with a subnet mask, which is also 32 bits in length. Subnet masks can be represented in two formats: dotted decimal notation and slash notation. In dotted decimal notation, a subnet mask is written in the same format as an IP address. 255.0.0.0, 255.255.0.0, and 255.255.255.0 are examples of the subnet mask. In slash notation, the number of network bits in the IP address is indicated after a slash. /24, /16, and /8 are examples of subnet masks in slash notation.
Routing
Devices with different network IDs cannot communicate directly. To transfer information between such devices, a router is required. A router connects distinct networks and forwards data packets between them in a process known as routing. A router functions in this layer and provides routing.
When a device transmits a data packet, it includes the destination device's IP address and sends the packet to the default gateway router. The default gateway router connects the local network segment to other networks. Upon receiving a packet, the router examines the destination IP address, uses its routing table to make a forwarding decision, and forwards the packet to the appropriate destination network.
Routers store route information in routing tables. Upon receiving a data packet, a router compares the packet's destination address with entries in its routing table to determine the appropriate route. If a matching route is found, the router forwards the packet. If not, it discards the packet. This process is called a routing decision. It occurs whenever a router receives a data packet.
Connecting Different Media Types
The physical layer transports data. To move data between two devices, many media types are used, such as Ethernet, FDDI, fiber-optic, and radio signals. Every media type uses different encapsulation techniques.
Media Type
A data packet encapsulated by a media type cannot be de-encapsulated by another media type. Routers can encapsulate and de-encapsulate data packets for all media types. If a source and destination are connected through different media types or belong to different network architectures, a router is used to connect them.

This tutorial is part of the tutorial series "Networking reference models explained in detail with examples". Other parts of this series are the following.
Chapter 1 What is a Networking Model Explained
Chapter 2 OSI Model Advantages and Basic Purpose Explained
Chapter 3 Difference between original and modern TCP/IP models
Chapter 4 Similarities and Differences between the OSI and TCP/IP models
Chapter 5 Adjacent-layer and same-layer interactions
Chapter 6 Data Encapsulation and De-encapsulation Explained
Chapter 7 OSI Seven Layers Model Explained with Examples
Chapter 8 TCP/IP Reference Model Explained
Chapter 9 Application layer in the OSI and TCP IP layers models
Chapter 10 Presentation layer and Session layer of the OSI model
Chapter 11 The Transport Layer Explained
Chapter 12 Segmentation Explained with TCP and UDP Headers
Chapter 13 Connection Multiplexing Explained with Examples
Chapter 14 TCP Features and Functions Explained with Examples
Chapter 15 The Network Layer Explained
Chapter 16 The Data Link and Physical layers Explained
Conclusion
This tutorial introduced the network layer and described the main features and functions. The main functions of the network layer are providing logical addressing, connecting different logical subnets and media types, and enabling routing between different lan segments.
Author Laxmi Goswami Updated on 2026-02-25