Understanding the Network Layer: How Data Finds Its Way Across the Internet.
Unit 4 : Network Layer
Prn:25070126501
Introduction
Today, we rely heavily on the internet for many tasks, like sending messages, watching videos, taking online classes, and browsing websites.But have you ever thought about how all that information gets to the right place It’s because different layers of computer networks work together to move data from one device to another.
One of these layers is the Network Layer, which is the third layer in the OSI model.
Its main job is to handle IP addresses and figure out the best path for sending data between different networks.Routers use this information to send data packets to their correct destination.
In this blog, I’ll cover key ideas about the Network Layer, such as Virtual Circuit Networks, Datagram Networks, IPv4, IPv6, ICMP, and routing protocols like RIP, OSPF, and BGP.
These topics will help you understand how data moves across networks and how devices connect and communicate over the internet.
Virtual Circuit Network
A Virtual Circuit Network is a packet-switching network where a logical path is established between the source and destination before data transmission begins.
Although the path appears like a dedicated connection, the physical network resources can still be shared with other communications.
Three phases of Virtual Circuit communication.
The three phases are:
- Setup: Establishes the route between source and destination.
- Data Transfer: All packets use the established route.
- Teardown: The virtual circuit is released after communication
Datagram Network
Unlike a virtual circuit, a Datagram Network is connectionless. Each packet is treated as an independent unit and can follow a different route to the destination.
For example, if a message is divided into four packets — A, B, C and D — the packets may travel through different routers.
Datagram Routing Diagram.
This diagram Network Routing, where data packets travel from a source to a destination through different routers.
- Source: Sends the data packets.
- Router 1: Directs packets through different available paths.
- Router 2 and Router 3: Provide alternative routes for data transmission.
- Router 5: Receives packets from both paths and forwards them to the destination.
- Packet Routing Assignments: Packets A and C use Route 1, Packet B uses Route 2, and Packet D uses Route 3.
Internet Protocol and IP Packets
The Internet Protocol (IP) provides the addressing and routing mechanism required to move packets from a source device to a destination device.
Every network interface using IP has an IP address that helps identify where packets should be delivered.
Internet Protocol and IP Packets
When we use the internet to look up websites, watch videos, or send messages, data has to move from one device to another.
The Internet Protocol (IP) makes this possible by giving data addresses and helping it find its way.It helps routers know where a packet is going and where to send it next.
Every device or network connection that uses IP has an IP address.
This address helps tell where the data is coming from and where it needs to go.For example, when we visit a website on our laptop, the data is split into smaller parts called packets and sent through different routers until it reaches the right place.
What Is an IP Packet?
An IP packet is a small piece of data that moves across a network.
It has two main parts: the IP header and the payload.
- IP Header
The header has the information needed to send the packet correctly.
It includes the source IP address, the destination IP address, and other details that help control the packet.Routers look at this information to figure out where to send the packet.
2.Payload
The payload holds the actual data being sent.
It could be part of a webpage, a message, or any other information that an application wants to send.
IPv4 Addressing
IPv4 is a 32-bit addressing system. An IPv4 address is divided into four 8-bit sections called octets.
Traditional IPv4 classful addressing divides addresses into Class A, B, C, D and E. The Network Layer slides also explain the network part, host part and subnet number of an IPv4 address. Unit 4 (1)
IPv4 Datagram Header
The IPv4 header contains important fields such as:
- Version
- Header Length
- Total Length
- Identification
- Flags
- Fragment Offset
- Time To Live (TTL)
- Protocol
- Header Checksum
- Source IP Address
- Destination IP Address
The TTL field helps prevent packets from continuously circulating through the network
IPv6 — The Next Generation of IP
The growth of Internet-connected devices created the need for a much larger address space. IPv6 uses 128-bit addresses, compared with IPv4’s 32-bit addresses.
IPv6 addresses are written using hexadecimal numbers separated by colons.
Example:
2001:0db8:0000:0000:0000:ff00:0042:8329
IPv6 Addressing.
The three addressing methods covered in the slides are:
- Unicast: One sender to one destination.
- Multicast: One sender to multiple destinations.
- Anycast: One sender to one member of a group, generally the most suitable or nearest one.
ICMP — Network Error Reporting and Diagnosis
Internet Control Message Protocol (ICMP) works at the Network Layer and is mainly used for error reporting and network diagnostics.
Ping
Ping is a network diagnostic tool that uses ICMP Echo Request and Echo Reply messages to check whether a destination responds. It also measures the round-trip time.
Get Amit Sharad pawar’s stories in your inbox
Join Medium for free to get updates from this writer.
For example, if a website is not opening, Ping can help us check whether its server responds. However, no reply does not always mean the server is offline, as a firewall may block ICMP messages.
Traceroute
Traceroute helps us identify the routers through which packets travel to reach a destination. It displays the network hops and their response times, which can help locate delays or connection problems.
Common ICMP Messages
- Echo Request and Echo Reply: Used to test connectivity.
- Destination Unreachable: Indicates that a destination cannot be reached.
- Time Exceeded: Sent when a packet’s TTL expires.
- Redirect: Suggests a more suitable route.
- Parameter Problem: Reports an issue with an IP header field.
Security Risks
ICMP can sometimes be misused in attacks, such as ICMP floods, which send excessive messages to overwhelm a target. Firewalls and traffic monitoring can help reduce these risks.
Routing Algorithms
A routing algorithm determines an appropriate path for transferring packets from a source to a destination.
Link State Routing
In Link State Routing, routers build a view of the network topology and use this information to calculate the shortest paths.
The process includes:
- Discover neighbors.
- Exchange Link State Advertisements (LSAs).
- Build the Link State Database (LSDB).
- Run the Shortest Path First algorithm.
- Update the routing table.
The slides describe Dijkstra’s algorithm as commonly used for shortest-path calculation.
BGP — Routing the Global Internet
Border Gateway Protocol (BGP) is a path-vector routing protocol used for communication between Autonomous Systems (AS).
The Internet contains thousands of interconnected networks. BGP helps these networks exchange information about reachable routes and select suitable paths.
BGP Working
- AS A: The first independent network.
- BGP Peering: Establishes communication between routers in different autonomous systems.
- Route Information: Shares information about reachable networks and available routes.
- AS B and AS C: Learn routes from neighboring systems and use them to forward packets.
Real-World Applications
The concepts of the Network Layer are used every day:
1. Web browsing: IP addresses and routers help deliver website data.
2. Video streaming: Packets travel through multiple networks to deliver video content.
3. Network troubleshooting: Ping and traceroute help administrators identify connectivity problems.
4. Enterprise networks: OSPF can help organizations select efficient internal routes.
5. Internet service providers: BGP allows different autonomous systems to exchange routing information.
6. Modern Internet addressing: IPv6 provides a much larger address space for the growing number of connected devices.
Conclusion
The Network Layer is one of the most important parts of computer networking because it determines how data is addressed, routed and delivered across interconnected networks.
Virtual Circuit and Datagram networks demonstrate two different approaches to packet delivery. IP provides the basic addressing and routing mechanism, while IPv4 and IPv6 provide different addressing systems. ICMP supports error reporting and network diagnosis. Routing algorithms and protocols such as RIP, OSPF and BGP help routers determine appropriate paths for data.
Understanding the Network Layer therefore helps us understand what happens behind the scenes whenever we browse a website, send a message, stream a video or access an online service.
Key Takeaways
Network Layer = Addressing + Routing + Packet Forwarding
- Virtual Circuit: Fixed logical path.
- Datagram: Each packet can take its own path.
- IPv4: 32-bit addressing.
- IPv6: 128-bit addressing.
- ICMP: Error reporting and diagnostics.
- RIP: Distance-vector routing.
- OSPF: Link-state routing.
- BGP: Routing between autonomous systems.
Virtual Circuit and Datagram Networks — GeeksforGeeks https://www.geeksforgeeks.org/computer-networks/virtual-circuit-and-datagram-networks/
. Internet Protocol (IPv4) — RFC Editor https://www.rfc-editor.org/rfc/rfc791.html
. IPv6 Protocol — RFC Editor https://www.rfc-editor.org/rfc/rfc8200.html
. Internet Control Message Protocol (ICMP) — RFC Editor https://www.rfc-editor.org/rfc/rfc792.html
. Routing Algorithms in Computer Networks — GeeksforGeeks https://www.geeksforgeeks.org/computer-networks/routing-algorithms-in-computer-network/
. Distance Vector Routing — GeeksforGeeks https://www.geeksforgeeks.org/computer-networks/distance-vector-routing-dvr-protocol/
. OSPF Routing Protocol — RFC Editor https://www.rfc-editor.org/rfc/rfc2328.html
. Border Gateway Protocol (BGP) — RFC Editor https://www.rfc-editor.org/rfc/rfc4271.html
Author Information
Name: Amit Pawar
Course: B.Tech — Artificial Intelligence and Machine Learning
Institute: Symbiosis Institute of Technology (SIT), Pune
Subject: Computer Networks
Topic: Unit 4 — Network Layer







