3.1.1. Static vs. Dynamic Routing
Static Routing: Manually configured by administrators. You specify: "To reach network X, send packets to next-hop Y."
| Pros | Cons |
|---|---|
| Simple to configure | Doesn't adapt to failures |
| Predictable behavior | Doesn't scale to large networks |
| No routing protocol overhead | Manual updates required |
| Secure (no routing updates to spoof) | Administrator must know topology |
Default route (0.0.0.0/0): A catch-all route, usually static, used when no more specific route matches—the "gateway of last resort". Because /0 is the least specific prefix possible, any other matching route wins. At the other extreme, a host route (/32) matches exactly one address.
Dynamic Routing: Routers automatically discover routes by exchanging information with neighbors.
| Protocol | Type | Algorithm | Use Case |
|---|---|---|---|
| BGP | Path vector | Best path selection based on policies | Internet routing, between organizations |
| OSPF | Link state | Dijkstra (shortest path first) | Enterprise internal routing |
| EIGRP | Advanced distance vector | DUAL (Diffusing Update Algorithm) | Cisco environments |
| IS-IS | Link state | Dijkstra (shortest path first) | Large service-provider networks |
| RIP | Distance vector | Bellman-Ford (hop count) | Legacy and very small networks |
BGP (Border Gateway Protocol): The protocol that makes the internet work. Routes between autonomous systems (organizations). Makes decisions based on policies (business relationships) not just metrics. It is also what an organization runs when it connects to two or more ISPs for redundancy (multihoming).
OSPF (Open Shortest Path First): An open standard (RFC 2328 for IPv4), so it is supported across router vendors—the usual choice for a mixed-vendor network. Every router builds a complete topology map. All routers have the same view and independently calculate shortest paths. Changes propagate quickly because routers share link-state information, not just distances.
EIGRP (Enhanced Interior Gateway Routing Protocol): Cisco-developed protocol combining benefits of distance-vector (simplicity) and link-state (fast convergence). Uses composite metric based on bandwidth and delay.
IS-IS (Intermediate System to Intermediate System): A link-state protocol that works like OSPF (every router builds the full map and runs Dijkstra), found mostly in large service-provider networks.
RIP (Routing Information Protocol): The original distance-vector protocol. Routers share their whole routing table with neighbors, and the metric is simply hop count, with 15 hops as the maximum (16 means unreachable). That limit and its slow convergence are why RIP is now legacy. RIPng is the IPv6 version of RIP and is still distance-vector.
Interior vs. exterior gateway protocols: An IGP routes inside one autonomous system (one organization's network): OSPF, EIGRP, IS-IS and RIP are all IGPs. An EGP routes between autonomous systems: BGP is the EGP of the internet.
Route redistribution: When one network runs two routing protocols (say OSPF in one part and EIGRP in another), a border router running both can inject the routes learned by one protocol into the other. Don't confuse it with route summarization/aggregation (advertising many prefixes as one) or route filtering (blocking some routes from being advertised).
How each protocol measures the best path (its metric):
| Protocol | Metric | Lower is better because... |
|---|---|---|
| RIP | Hop count | Fewer routers to cross |
| OSPF | Cost, derived from interface bandwidth (cost = reference bandwidth ÷ interface bandwidth) | Faster links have lower cost, so OSPF prefers the path with the lowest total cost |
| EIGRP | Composite of bandwidth and delay (by default) | Considers both link speed and delay |
| BGP | Path attributes and policy, such as AS path length | Chosen by business policy, not just speed |
⚠️ Exam Trap: OSPF does not use hop count. A two-hop path over fast links beats a one-hop path over a slow link, because OSPF adds up link costs.