The Network Layer: Powering Internet Communication

 

The Network Layer: Powering Internet Communication

Unit 4 – Computer Networks


Introduction 

Have you ever wondered how your message travels from your phone to your friend’s device across the world?
The secret lies in the Network Layer, one of the most important layers in the OSI model. It ensures that data finds its way from the sender to the receiver  even across different networks.
In short, the Network Layer acts as the “traffic controller” of the Internet, deciding the best route for each data packet.


What is the Network Layer?

The Network Layer (Layer 3) of the OSI model is responsible for packet forwarding, logical addressing, and routing.
Its main functions include:

  • Logical addressing using IP addresses

  • Routing choosing the best path for data

  • Fragmentation and reassembly of packets

  • Error handling and diagnostics (via ICMP)

It forms the backbone of Internet communication by ensuring every packet reaches the correct destination efficiently.

 
Figure 1: The OSI Model – The Network Layer ensures logical addressing and routing of data packets.



1. Virtual Circuit vs Datagram Network

There are two main methods of delivering packets in a network:

 
Figure 2: Comparison between Virtual Circuit (fixed path) and Datagram Network (dynamic paths).


Feature                     Virtual Circuit NetworkDatagram Network
Connection type       Connection-oriented               Connectionless
Path       Fixed before data transfer               Chosen dynamically for each packet
Reliability       More reliable               Less reliable (handled by upper layers)
Example       ATM, Frame Relay               The Internet (IP)

Example:
In a Virtual Circuit, like a phone call, the route is established before communication begins.
In a Datagram Network, like sending text messages, each packet may take a different path but still reaches the same destination.


2. Internet Protocol (IP)

The Internet Protocol is the key communication protocol of the Network Layer. It defines how data packets are addressed and sent from one device to another.

There are two main versions:

 
Figure 3: IPv4 vs IPv6 addressing format and bit length.

a) IPv4 (Internet Protocol Version 4)

  • Uses 32-bit addressing, providing around 4.3 billion unique addresses.

  • Written as four decimal numbers separated by dots, e.g., 192.168.1.1.

  • Divided into network ID and host ID.

  • Uses header fields like source/destination address, TTL (Time to Live), checksum, etc.

However, due to the rapid growth of the Internet, IPv4 addresses started running out — leading to IPv6.


b) IPv6 (Internet Protocol Version 6)

  • Uses 128-bit addresses, allowing virtually unlimited unique addresses.

  • Written in hexadecimal form, e.g., 2001:0db8:85a3::8a2e:0370:7334.

  • Simplified header structure for faster processing.

  • Provides better security, auto-configuration, and multicasting support.

Example: IPv6 is used in modern networks like IoT (Internet of Things), where billions of devices are connected globally.


3. ICMP (Internet Control Message Protocol)

The ICMP protocol is used by network devices to send error messages and operational information.

Functions of ICMP:

  • Error reporting (e.g., “Destination Unreachable”)

  • Network diagnostics (Ping and Traceroute)

  • Informing routers about congestion or timeouts

Example: When you use the “ping” command, your device sends ICMP Echo Request messages to check if another host is reachable.


4. Routing and Routing Algorithms

Routing is the process of selecting the best path for data to travel from source to destination across interconnected networks.

Routers use routing algorithms to make decisions.

a) Distance Vector Routing Algorithm

  • Each router shares its distance (hop count) to all known destinations with its neighbors.

  • Simple but can lead to slow convergence or routing loops.

  • Example protocol: RIP (Routing Information Protocol).

b) Link-State Routing Algorithm

  • Each router knows the complete network topology.

  • Uses the Dijkstra algorithm to find the shortest path.

  • Example protocol: OSPF (Open Shortest Path First).

FeatureDistance VectorLink State
Knowledge           Neighbor’s information          Full network map
Speed           Slower          Faster
Example             RIP                                         OSPF

5. Routing Protocols

Routing protocols are the rules used by routers to communicate and exchange routing information.

 
Figure 4: Illustration of routing in the Internet using RIP, OSPF, and BGP protocols.

a) RIP (Routing Information Protocol)

  • Based on Distance Vector algorithm.

  • Uses hop count as a metric (max 15 hops).

  • Simple and suitable for small networks.

b) OSPF (Open Shortest Path First)

  • Based on Link-State algorithm.

  • Uses cost as a metric (bandwidth, delay, etc.).

  • Divides the network into areas for efficiency.

  • Commonly used in enterprise networks.

c) BGP (Border Gateway Protocol)

  • Used to connect different autonomous systems (AS) on the Internet.

  • It is the routing protocol of the Internet.

  • Makes policy-based routing decisions between large organizations and ISPs.

Example:
When you access a website hosted in another country, your data travels through multiple BGP routers that determine the best international path.


6. Real-World Applications

  • IPv6 enables large-scale IoT systems like smart homes and connected cars.

  • ICMP helps troubleshoot network issues and monitor connectivity.

  • Routing protocols like BGP keep global Internet traffic running smoothly.

  • OSPF is widely used in corporate networks for internal routing optimization.


7. Summary / Key Takeaways

  • The Network Layer is responsible for logical addressing and routing.

  • Virtual Circuit = connection-oriented; Datagram = connectionless.

  • IPv4 and IPv6 define how data packets are addressed and transmitted.

  • ICMP is vital for error reporting and diagnostics.

  • Routing algorithms (Link-State & Distance-Vector) determine data paths.

  • RIP, OSPF, and BGP are key routing protocols used in real-world networks.

  • Together, these ensure efficient, reliable Internet communication.


References

  • Tanenbaum, A. S., Computer Networks, 5th Edition

  • Forouzan, B. A., Data Communications and Networking

  • Cisco Networking Academy, “Routing Fundamentals”

  • geeksforgeeks.org



Alabhya Sharma

PRN:23070126010
B.Tech (AIML-A)

Comments