Module 11: Routing Deep Dive
Routing is how packets find their way from source to destination across interconnected networks. This module takes you from basic routing concepts to understanding how the entire internet’s routing works.Estimated Time: 4-5 hours
Difficulty: Intermediate to Advanced
Prerequisites: Module 9 (IP Addressing), Module 10 (NAT)
Difficulty: Intermediate to Advanced
Prerequisites: Module 9 (IP Addressing), Module 10 (NAT)
11.1 What is Routing?
Routing is the process of selecting a path for traffic across one or more networks.The Fundamental Question
When a packet arrives at a router, the router asks:“Where should I send this packet next to get it closer to its destination?”
Routers vs Switches
| Device | Layer | Uses | Connects |
|---|---|---|---|
| Switch | Layer 2 | MAC addresses | Devices in same network |
| Router | Layer 3 | IP addresses | Different networks |
11.2 The Routing Table
Every router (and every computer!) has a routing table - a set of rules determining where to send packets.Viewing Your Routing Table
- Windows
- Linux/Mac
Sample Routing Table
How Routing Decisions Work
When a packet needs to be sent:Find Matching Routes
Multiple routes may match (e.g., 10.0.0.0/8 and 10.1.0.0/16 both match 10.1.1.1).
11.3 Default Gateway
The default gateway is the “route of last resort” - where packets go when no specific route matches.Your Home Network
11.4 Static vs Dynamic Routing
Static Routing
Routes are manually configured by an administrator.- Simple, predictable
- No routing protocol overhead
- Full control
- Doesn’t scale (imagine configuring 1000 routes manually)
- No automatic failover
- High maintenance
- Small networks
- Stub networks (single exit point)
- Specific traffic engineering
Dynamic Routing
Routers automatically discover routes and share information using routing protocols.- Automatic failover
- Scales to massive networks
- Self-healing
- More complex
- Convergence time
- Protocol overhead
11.5 Interior vs Exterior Gateway Protocols
The internet is divided into Autonomous Systems (AS) - networks under single administrative control.| Type | Protocols | Use Case |
|---|---|---|
| IGP (Interior Gateway Protocol) | OSPF, EIGRP, RIP, IS-IS | Within an organization |
| EGP (Exterior Gateway Protocol) | BGP | Between organizations, internet backbone |
11.6 OSPF (Open Shortest Path First)
OSPF is the most common IGP in enterprise networks.How OSPF Works
- Neighbor Discovery: Routers find each other using Hello packets
- Database Synchronization: Routers share their view of the network (LSAs)
- SPF Calculation: Each router runs Dijkstra’s algorithm to find shortest paths
- Routing Table: Results populate the routing table
OSPF Areas
Large networks are divided into areas to reduce complexity:OSPF Metrics
OSPF uses cost as its metric, based on bandwidth:11.7 BGP (Border Gateway Protocol)
BGP is the routing protocol of the internet. Every ISP, cloud provider, and major network uses BGP.BGP Basics
- Path Vector Protocol: Routes include the full AS path
- AS Numbers: Every organization has a unique ASN (e.g., Google is AS15169)
- Peering: Organizations agree to exchange routes
BGP in Action
Why BGP Matters
Multi-homing
Connect to multiple ISPs for redundancy. BGP handles failover.
Traffic Engineering
Control which path traffic takes (incoming and outgoing).
IP Announcements
Tell the internet “this IP range belongs to me.”
Internet Stability
BGP misconfiguration can (and has) broken the internet.
BGP Hijacking
11.8 Route Summarization (Aggregation)
Instead of advertising many specific routes, advertise one summary:- Smaller routing tables
- Faster convergence
- Less memory/CPU usage
11.9 Routing in the Cloud (AWS VPC Example)
Cloud networks use routing tables extensively:VPC Route Table Structure
Route Table Entries Explained
| Destination | Target | Meaning |
|---|---|---|
| 10.0.0.0/16 | local | Traffic within VPC, route locally |
| 0.0.0.0/0 | igw-xxx | Default route to Internet Gateway |
| 0.0.0.0/0 | nat-xxx | Default route to NAT Gateway |
| 172.16.0.0/12 | pcx-xxx | Route to VPC Peering Connection |
| 192.168.0.0/16 | vgw-xxx | Route to VPN Gateway (on-prem) |
11.10 Traceroute: See Routing in Action
Traceroute shows the path packets take:How Traceroute Works
Uses TTL (Time To Live) manipulation:- Send packet with TTL=1 → First router decrements to 0, sends back “Time Exceeded”
- Send packet with TTL=2 → Second router decrements to 0, sends back error
- Continue until destination reached
11.11 Common Routing Problems
1. Routing Loops
- TTL (limits hops)
- Split Horizon (don’t advertise routes back where you learned them)
- Route Poisoning
2. Black Holes
Route exists but destination is unreachable:3. Asymmetric Routing
11.12 Key Takeaways
Longest Prefix Wins
More specific routes (longer prefix) always take precedence.
Default Gateway
0.0.0.0/0 is the catch-all route for unknown destinations.
BGP Runs the Internet
Every major network exchange uses BGP to share routes.
Cloud = Software Routing
VPC route tables are just software-defined routing.
Next Module
Module 12: DNS Deep Dive
Master the Domain Name System - the phonebook of the internet.