๐บ๏ธ How Routing Works
How data finds its way across the entire internetโฑ ~3 min
When you drive from New York to Los Angeles, your GPS doesn't have one single road โ it picks the best route based on current traffic, road quality, and distance. A router does the same thing with data packets: it looks at the destination IP, checks its 'map' (routing table), and forwards the packet toward the best next stop. It doesn't deliver it all the way โ it just passes it to the next router, which does the same thing.
The Routing Table โ the router's map
Every router holds a routing table: a list of known networks and which direction to send packets for each. When a packet arrives, the router matches the destination IP to the most specific route in the table.
| Destination | Next Hop | Interface | How learned |
|---|---|---|---|
| 192.168.1.0/24 | Directly connected | eth0 | Connected |
| 10.0.0.0/8 | 192.168.1.254 | eth0 | Static |
| 172.16.0.0/12 | 192.168.1.253 | eth0 | OSPF |
| 0.0.0.0/0 | 203.0.113.1 | eth1 | Default gateway |
Static vs Dynamic Routing
- โขAdmin manually enters every route
- โขPredictable โ no surprises
- โขZero overhead โ no routing protocol traffic
- โขBreaks if network changes (no auto-update)
- โขPerfect for: small networks, point-to-point links
- โขRouters share route info automatically
- โขSelf-healing โ adapts to failures in seconds
- โขSmall overhead for protocol messages
- โขScales to massive networks
- โขPerfect for: enterprise, ISPs, the internet
The Three Routing Protocols That Matter
- โข๐ข OSPF (Open Shortest Path First) โ the most widely used Interior Gateway Protocol (IGP). Each router builds a complete map of the network (called the LSDB โ Link State Database) and uses Dijkstra's algorithm to calculate the shortest path. Open standard, supported by all vendors. Fast failover โ reroutes around failures in seconds. Used in enterprise networks and data centers.
- โขโก EIGRP (Enhanced Interior Gateway Routing Protocol) โ originally Cisco-proprietary; Cisco announced plans to open it in 2013 and it was formally published as an informational standard (RFC 7868) in 2016. A hybrid protocol that combines the best of distance-vector and link-state: it only sends updates when something changes (not full table dumps), converges extremely fast, and uses bandwidth and delay as its primary metrics. EIGRP is common in Cisco-heavy enterprise networks and is a key topic in CyberPatriot's Cisco Networking challenge and Cisco certifications (CCNA).
- โข๐ BGP (Border Gateway Protocol) โ the protocol that runs the entire internet. Every ISP, cloud provider, and large company uses BGP to announce which IP ranges they own. Unlike OSPF and EIGRP (which optimize for speed), BGP makes routing decisions based on policies โ business agreements between networks. When BGP fails, huge parts of the internet go down (see: Facebook 2021 outage).
| Protocol | Type | Used Where | Metric | Convergence |
|---|---|---|---|---|
| OSPF | Link-state (open standard) | Enterprise, data centers | Cost (based on bandwidth) | Fast โ seconds |
| EIGRP | Hybrid (Cisco, partially open) | Cisco enterprise networks, CyberPatriot | Bandwidth + Delay | Very fast โ sub-second |
| BGP | Path-vector (policy-based) | The internet โ between ISPs and cloud providers | AS path + policies | Slow by design โ minutes |
A company's main router fails. With OSPF enabled, what happens to network traffic?