A real-life situation
Three routers and seven static routes were easy. Now the company has grown to 30 sites. Every new LAN means logging in to every router to add a route. And when a link fails, a floating static route only helps if the failure is right next to the router. Someone will get it wrong. This is the point where routers should tell each other about networks.
What dynamic routing is
With dynamic routing, routers run a routing protocol: a set of rules for sharing route information. Each router announces the networks it knows. Its neighbours learn them, pick the best paths, and pass them on. When something changes, the routers update each other and recalculate.
The time it takes for all routers to agree on the new best paths after a change is called convergence. Fast convergence means a short outage.
- 1. R3 announces its LAN to both neighbours. No one types a route on R1 or R2.
- 2. R1 picks the best path: through R2, over the faster links. The backup link is known but not used.
- 3. The R2–R3 link fails. R2 tells its neighbours the path is gone. A static route on R1 would never have noticed this.
- 4. Converged: R1 recalculates and moves traffic to the backup link, within seconds.
Static or dynamic?
| Static routing | Dynamic routing | |
|---|---|---|
| Setup | Every route by hand | Enable the protocol; routes are learned |
| Reacts to failures | Only local ones | Yes, anywhere in the network |
| Router CPU and memory | Almost none | Some, for the protocol |
| Predictability | Total: you chose every path | Paths follow the protocol's rules |
| Best for | Small networks, stubs, default routes | Anything that grows or needs automatic failover |
Most real networks mix both: a dynamic protocol inside, with a static default route toward the ISP.
Two ways to sort protocols
By where they run. An autonomous system (AS) is a network run by one organisation. An IGP (interior gateway protocol) routes inside one AS. An EGP (exterior gateway protocol) routes between ASes. Today the only EGP in use is BGP.
By how they work:
| Type | How it works | Analogy | Examples |
|---|---|---|---|
| Distance vector | Each router tells its neighbours the networks it knows and how far away they are. It only knows what its neighbours told it. | Road signs: "Leeds, 40 km, this way" | RIP, EIGRP (an advanced version) |
| Link state | Every router learns every link in the area, builds a full map, and calculates its own shortest paths. | Everyone holds the same full map | OSPF, IS-IS |
| Path vector | Routes carry the list of ASes they passed through. Choices follow policy, not just distance. | Travel plans by country, with rules about which ones to avoid | BGP |
Why it works this way
Distance-vector protocols are simple but each router sees only second-hand information, which can make them slow to notice bad news. Link-state protocols use more memory, because every router holds the full map, but they react faster and can't be fooled by a neighbour's stale view. That trade-off is why link-state OSPF is the usual IGP in enterprise networks today, and why it gets its own lesson next.
How to verify it
show ip protocols lists every routing protocol running on a router and its key settings. This output is based on Cisco documentation, not run on a lab device.
R1#show ip protocols *** IP Routing is NSF aware *** Routing Protocol is "ospf 1" Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Router ID 1.1.1.1 Number of areas in this router is 1. 1 normal 0 stub 0 nssa Maximum path: 4 Routing for Networks: 10.0.12.0 0.0.0.3 area 0 10.0.13.0 0.0.0.3 area 0 192.168.1.0 0.0.0.255 area 0 Routing Information Sources: Gateway Distance Last Update 2.2.2.2 110 00:04:51 3.3.3.3 110 00:04:51 Distance: (default is 110)
Check yourself
Which protocol type gives every router a full map of the network?
Which protocol connects different organisations' networks across the internet?
What does 'the network has converged' mean?