TCP/IP Model and Layer 3 Networking (Routing)
Layer 3 of the TCP/IP model is where network-level communication happens. It is responsible for logical addressing, routing decisions, and delivering packets across different networks.
While lower layers move data locally, Layer 3 enables global connectivity — allowing packets to travel from one network to another across routers, subnets, and autonomous systems.
This article explains how Layer 3 works, how routing actually happens, and why it is foundational to modern networking.
Where Layer 3 Fits in the TCP/IP Model
In the TCP/IP model, Layer 3 is known as the Internet Layer. It sits above the Link Layer and below the Transport Layer.
- Link Layer — local delivery (Ethernet, ARP)
- Internet Layer (Layer 3) — routing and IP addressing
- Transport Layer — end-to-end communication (TCP, UDP)
Layer 3 does not guarantee delivery — it focuses on getting packets to the correct destination network.
IP Addressing: The Foundation of Routing
What an IP Address Represents
An IP address is a logical identifier assigned to a network interface. It identifies both the network and the host within that network.
Routers forward packets based on network prefixes — not individual devices.
IPv4 vs IPv6
- IPv4 — 32-bit addressing, limited address space
- IPv6 — 128-bit addressing, hierarchical and scalable
Despite IPv6 adoption, routing concepts remain fundamentally the same.
How Routing Actually Works
Packet Forwarding Process
- A packet arrives at a router interface
- The destination IP is extracted
- The routing table is consulted
- The best matching route is selected
- The packet is forwarded to the next hop
This process happens independently for every packet — routing is stateless at the IP layer.
Routing Tables and Longest Prefix Match
Routing tables contain network prefixes and associated next hops. When multiple routes match, routers use longest prefix match to choose the most specific route.
More specific routes always win over broader ones.
This mechanism enables hierarchical routing and efficient aggregation of networks.
Static Routing vs Dynamic Routing
Static Routing
Static routes are manually configured and do not adapt automatically to network changes.
- Simple and predictable
- No protocol overhead
- Not scalable
Dynamic Routing
Dynamic routing protocols exchange routing information automatically.
- OSPF — internal routing (link-state)
- BGP — inter-network routing (path-vector)
Dynamic routing enables resilience, redundancy, and scalability.
Common Layer 3 Protocols
- IP — packet addressing and delivery
- ICMP — error reporting and diagnostics
- IPsec — secure IP communication
- Routing protocols — OSPF, BGP, RIP
These protocols work together to provide reachability, visibility, and control.
Common Layer 3 Problems
- Incorrect subnetting
- Missing or incorrect routes
- Asymmetric routing
- Routing loops
- Misconfigured gateways
Most connectivity issues originate at Layer 3.
Why Layer 3 Still Matters
Even in cloud-native and software-defined environments, Layer 3 routing remains essential.
VPC routing, Kubernetes networking, VPNs, and the public internet all rely on the same core IP routing principles.
Final Thoughts
Layer 3 is the heart of networking. It enables global connectivity by moving packets across networks in a scalable and resilient way.
For engineers, a strong understanding of IP routing is non-negotiable — it is the foundation on which all higher-level networking depends.