The Network Layer provides logical addressing and routing services to deliver packets from source to destination across multiple networks. It handles path determination and packet forwarding between different network segments.
The Network Layer is responsible for end-to-end packet delivery across multiple networks. It provides logical addressing (IP), routing, path determination, and packet forwarding between different network segments.
The Critical Role: While Layer 2 handles local delivery using MAC addresses, Layer 3 enables global internet communication using IP addresses and routing protocols.
Primary Internet Protocol
What you see in Wireshark: Source/destination IP addresses, TTL, protocol type
Every packet on the internet uses IP addressingNext Generation Internet Protocol
What you see in Wireshark: 128-bit addresses, flow labels, hop limits
Solves IPv4 address exhaustion with massive address spaceNetwork Diagnostics & Error Reporting
What you see in Wireshark: Ping requests/replies, error messages, network unreachable
Powers ping, traceroute, and network error reportingDynamic Routing Protocol
What you see in Wireshark: Hello packets, LSA updates, topology advertisements
Routers automatically learn network topology and calculate best pathsInternet Backbone Routing
What you see in Wireshark: Route advertisements, AS paths, network prefixes
How the global internet routes traffic between ISPsIP to MAC Address Mapping
What you see in Wireshark: ARP requests/replies finding MAC addresses
Bridges the gap between Layer 2 (MAC) and Layer 3 (IP)Understanding what's inside every IP packet:
Scenario: Packet traveling from your home (192.168.1.100) to Google (8.8.8.8)
Hop | Router | Network | Action | TTL |
---|---|---|---|---|
1 | Home Router | 192.168.1.0/24 | Forward to ISP | 64 โ 63 |
2 | ISP Gateway | 10.0.0.0/8 | Route to backbone | 63 โ 62 |
3 | Backbone Router | Core Internet | BGP path selection | 62 โ 61 |
4 | Google Router | 8.8.8.0/24 | Deliver to server | 61 โ 60 |
Understanding how networks are divided and organised
CIDR | Subnet Mask | Total IPs | Usable Hosts | Binary Notation | Common Use Case |
---|---|---|---|---|---|
/8 | 255.0.0.0 | 16,777,216 | 16,777,214 | 11111111.00000000.00000000.00000000 | Class A / ISP Networks |
/16 | 255.255.0.0 | 65,536 | 65,534 | 11111111.11111111.00000000.00000000 | Class B / Large Organisations |
/24 | 255.255.255.0 | 256 | 254 | 11111111.11111111.11111111.00000000 | Class C / Small Office/Home |
/25 | 255.255.255.128 | 128 | 126 | 11111111.11111111.11111111.10000000 | Subnet /24 into 2 |
/26 | 255.255.255.192 | 64 | 62 | 11111111.11111111.11111111.11000000 | Subnet /24 into 4 |
/27 | 255.255.255.224 | 32 | 30 | 11111111.11111111.11111111.11100000 | Small Department Networks |
/28 | 255.255.255.240 | 16 | 14 | 11111111.11111111.11111111.11110000 | Tiny Networks (10-15 devices) |
/30 | 255.255.255.252 | 4 | 2 | 11111111.11111111.11111111.11111100 | Point-to-Point Router Links |
/31 | 255.255.255.254 | 2 | 2 | 11111111.11111111.11111111.11111110 | RFC 3021 P2P Links (no broadcast) |
/32 | 255.255.255.255 | 1 | 1 | 11111111.11111111.11111111.11111111 | Single Host / Loopback |
Your company has been assigned 192.168.10.0/24 and needs to create 4 separate subnets for different departments.
How many bits do we need to borrow to create 4 subnets?
How many IP addresses will each subnet contain?
Choose how many subnets you need from a /24 network
Formula | Calculation | Purpose |
---|---|---|
Number of Subnets | 2^n (where n = borrowed bits) | How many subnets you can create |
Hosts per Subnet | 2^h - 2 (where h = host bits) | Usable IP addresses per subnet |
Block Size | 256 - subnet octet | Increment between subnets |
Network Address | All host bits = 0 | First address (not usable) |
Broadcast Address | All host bits = 1 | Last address (not usable) |
Copy these filters directly into Wireshark to analyse subnet traffic
Scenario: You type "www.google.com" in your browser
Step-by-step packet flow when accessing www.google.com
The Network Layer makes global internet communication possible by providing logical addressing and routing.
Think of the Network Layer like the postal system:
Just like the postal system routes mail across the world, Layer 3 routes packets across the internet!