Networking Basics ยท 7

๐Ÿ—บ๏ธ How Routing Works

How data finds its way across the entire internetโฑ ~3 min

๐ŸงญRouters are like GPS navigation

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.

DestinationNext HopInterfaceHow learned
192.168.1.0/24Directly connectedeth0Connected
10.0.0.0/8192.168.1.254eth0Static
172.16.0.0/12192.168.1.253eth0OSPF
0.0.0.0/0203.0.113.1eth1Default gateway

Static vs Dynamic Routing

Static 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
Dynamic Routing
  • โ€ข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).
ProtocolTypeUsed WhereMetricConvergence
OSPFLink-state (open standard)Enterprise, data centersCost (based on bandwidth)Fast โ€” seconds
EIGRPHybrid (Cisco, partially open)Cisco enterprise networks, CyberPatriotBandwidth + DelayVery fast โ€” sub-second
BGPPath-vector (policy-based)The internet โ€” between ISPs and cloud providersAS path + policiesSlow by design โ€” minutes
โ˜… FactThe 2021 Facebook outage was caused by a BGP misconfiguration. Facebook accidentally withdrew its own BGP routes โ€” effectively telling the entire internet 'we don't exist.' For 6 hours, Facebook, Instagram, and WhatsApp were completely unreachable โ€” even internally. Facebook engineers couldn't even badge into the buildings because the door access systems were offline.
๐Ÿ”’ SecurityBGP Hijacking is one of the most dangerous attacks on the internet. An attacker (or misconfigured router) announces fake ownership of IP ranges, redirecting traffic through their systems. In February 2008, Pakistan Telecom accidentally announced a more specific BGP route for YouTube's IP space, pulling YouTube's global traffic through Pakistani infrastructure and taking the site offline worldwide for roughly two hours. RPKI (Resource Public Key Infrastructure) was developed specifically to prevent this โ€” it lets networks cryptographically prove they own the IP ranges they announce.
๐Ÿง Quick Checkfirst try = +5 XP

A company's main router fails. With OSPF enabled, what happens to network traffic?

โญ 0 XP๐Ÿ”ฅ 0 days