Course contents

Chapter 8: RoutingLesson 11 of 16

Why dynamic routing?

How can a router find another path when a cable fails? Let's follow one destination through a working path, a backup path and a disconnection.

Intermediate · 7 min read

Technical definition

Dynamic routing is a method of building routing tables in which routers run a routing protocol to share information about the networks they can reach, choose the best paths, and recalculate them automatically when the topology changes.

How can PC1 keep reaching the server after a link fails?

PC1 needs to reach the server behind R3. R1 can send through R2 or use its direct link to R3. Static routes can describe both paths, but the router still needs evidence that a path has failed. A routing protocol shares reachability changes so routers can recalculate usable paths without an operator editing every route.

This explorer uses a triangle: R1–R2–R3 plus a direct R1–R3 backup link. There is no ISP or default route in this example. PC1 uses R1 as its gateway, and the server at 192.168.3.10 is on R3's LAN. The next lesson uses a separate chain with an ISP exit; do not carry the triangle's backup-link settings into that lab.

What dynamic routing is

With dynamic routing, routers run a routing protocol: a set of rules for sharing route information. Configuration determines which interfaces participate, which neighbours can form and which information is advertised. Different protocols exchange different information; enabling one does not automatically advertise every network.

Automatic recovery still needs a usable alternative path.OSPF (Open Shortest Path First) is the routing protocol used by this explorer. Use the controls to change the links. The result shows R1's route after OSPF has processed the change, not the transition itself.

Change a link; compare R1's settled route to the server
Use R2: total cost 30R1–R2 costs 10, R2–R3 costs 10 and R3's LAN costs 10. The direct R1–R3 link costs 50, so its total to the LAN would be 60. PC1 192.168.1.10/24 sends to server 192.168.3.10/24. Grey lines are Ethernet links; blue arrows show the selected forwarding path. A red cross and dashed red link indicate failure.R1R2R3PC1192.168.1.10/24Server192.168.3.10/24Gi0/110.0.12.1/30Gi0/010.0.12.2/30Gi0/110.0.23.1/30Gi0/010.0.23.2/30Gi0/310.0.13.1/30Gi0/210.0.13.2/30Gi0/0192.168.1.1/24Gi0/1192.168.3.1/24Cost 10Cost 10Direct link · cost 50R3 LAN interface cost: 10
OSPF area 0; costs are explicitly assigned for this example. Subnet prefixes are /30 on router links and /24 on the LANs. Host gateways are .1 on each LAN. Routes, ARP and permitting policies are otherwise ready; no NAT, default route or other protocol is included. Grey: link; blue: selected path; red cross/dashes: failed link.
Use R2: total cost 30

O 192.168.3.0/24 [110/30] via 10.0.12.2, GigabitEthernet0/1

R1–R2 costs 10, R2–R3 costs 10 and R3's LAN costs 10. The direct R1–R3 link costs 50, so its total to the LAN would be 60.

What happens during convergence

Convergence means the participating routers have settled on routing information consistent with the current topology and policy. Their routing tables need not be identical: each router has a different position in the network.

In OSPF, the link-state database (LSDB) holds the area's topology information. After that information changes, a router can run shortest path first (SPF), its path-calculation algorithm, to update eligible routes. That calculation uses configured link costs; it does not measure the time a web request takes.

Diagram
A failed link triggers work before forwarding can settle
A failed link triggers work before forwarding can settle
A failed link triggers work before forwarding can settleIn this simplified OSPF sequence: detect the failure, flood updated link-state information, calculate a usable path and update forwarding. The result may be a replacement route or no route. The diagram does not assign a fixed convergence time.1 · DetectInterface event or neighbour timeout2 · ShareFlood the changed link state3 · CalculateRun SPF and find a usable path4 · InstallUpdate routing and forwarding
Detection, information propagation, path calculation and forwarding installation all contribute to convergence time. Packets may be lost during the transition; a second usable path is required for failover.

Static and dynamic side by side

Diagram
Static and dynamic side by side
Static and dynamic side by side
Static routingDynamic routing
ConfigurationConfigure destination routes and next hopsConfigure protocol participation, neighbours and policy
Failure evidenceInterface/next-hop resolution; object tracking can add remote probesInterface events and neighbour information within the protocol's scope
Ongoing workMaintain routes and any tracking configurationMaintain neighbour relationships and process routing changes
Read each row across: the left box names the item, the others describe it.

Static and dynamic routing can coexist. A small branch might use a static default route towards its ISP while learning internal LANs through OSPF. IP SLA with object tracking can remove a tracked static route when a remote probe fails; static routing is not limited to noticing failures on the adjacent cable.

IGP or EGP, distance vector or link state

By where they run. An autonomous system (AS) is a group of networks under a common routing administration. An IGP (interior gateway protocol) routes inside one AS. An EGP (exterior gateway protocol) routes between ASes. Today the only EGP in use on the internet is BGP (Border Gateway Protocol). Its internal form, internal BGP (iBGP), can also carry BGP routes within the same AS.

Diagram
Inside a network and across its boundary are different jobs
Inside a network and across its boundary are different jobs
Inside a network and across its boundary are different jobsR1 and edge router R2 belong to company AS 64500 and exchange internal routes with an IGP such as OSPF. R2 exchanges routes with ISP-A in AS 64501 using eBGP. These are protocol relationships, not physical interface or cabling details.Company · AS 64500ISP · AS 64501R1R2 · edgeISP-AIGP · OSPFeBGPLearn internal LAN destinationsExchange routesbetween ASes
A logical view: the edge router can run an IGP and BGP together. BGP can also run between routers in the same AS as iBGP. Many small sites use a default route without running BGP. AS numbers are documentation examples.

What routing information does each family exchange?

Distance-vector protocols learn destinations and distances through neighbours. Link-state protocols share topology information so each router can calculate paths. Path-vector BGP includes an autonomous-system path and uses routing policy to select routes. A BGP path is not a map of every physical link between those organisations.

EIGRP (Enhanced Interior Gateway Routing Protocol) is an advanced distance-vector protocol that uses DUAL (Diffusing Update Algorithm) to select loop-free paths and coordinate recalculation. It does not use the algorithm of RIP (Routing Information Protocol). OSPF and IS-IS (Intermediate System to Intermediate System) use link-state information; while an update is spreading, routers can temporarily hold different views. Choose a protocol based on the network design and platform support, rather than assuming one family is immune to stale information.

Diagram
Protocols exchange different kinds of routing information
Protocols exchange different kinds of routing information
Protocols exchange different kinds of routing informationRIP distance vector advertises destination and hop count to a neighbour. OSPF link state floods link descriptions within an area so routers can calculate paths. BGP path vector carries AS paths and other attributes, evaluated with policy. EIGRP is an advanced distance-vector protocol and uses DUAL rather than RIP's algorithm.R1R2Distance vector · RIP example192.168.3.0/24 · distance: 2 hopsR1 learns reachability from R2.R1Link state · OSPF exampleLink descriptions → area LSDB → SPFRouters calculate from a shared area map.R164501 → 64500Path vector · BGP examplePrefix + AS path + other attributesApply policy and check for AS loops.
These are information views rather than cabling diagrams. A protocol family does not guarantee a particular recovery speed. EIGRP uses DUAL and can converge quickly; BGP selection includes policy and attributes beyond AS-path length.

Try a failure and prove the recovery

Start the explorer with All links up. Its route to the server uses R2 at 10.0.12.2 with cost 30. Select R2–R3 down: after convergence, R1 uses R3 at 10.0.13.2 through Gi0/3 with cost 60. The more expensive route is useful because it still reaches the same destination. Select Both paths down and explain why no routing protocol can manufacture a missing physical path. Finish with All links up to restore the initial state.

In an equivalent isolated IOS/IOS XE lab, compare show ip route 192.168.3.10, show ip ospf neighbor and show ip interface brief before and after a controlled interface shutdown. Use no shutdown on the interface you disabled, then check that the preferred route and end-to-end test return. The explorer is a limited teaching model; it does not run these commands or prove the server's return path, gateway or firewall policy.

What show ip protocols tells you

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.

Example output · based on Cisco documentation; exact format varies by platform and software version
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)
OSPF process 1 lists two routing information sources. The dotted values in the Gateway column are router IDs, not interface addresses. Use show ip ospf neighbor to check adjacency state. "Maximum path: 4" means up to four equal-cost paths can be used at once.

In practice, this is a good first command on an unfamiliar router: it shows the running routing processes and their settings. Then useshow ip route 192.168.3.10 to check the installed route for this destination and show ip interface brief to check interface addresses and status.

Test yourself on routing protocols

Predict · scenario 1

Which protocol family builds a shared topology map within an OSPF area?

Predict · scenario 2

Which protocol connects different organisations' networks across the internet?

Predict · scenario 3

What does 'the network has converged' mean?

Predict · scenario 4

R2–R3 fails, but the direct R1–R3 link remains usable. After OSPF converges, which next hop does R1 use for 192.168.3.10 in the diagram?

Cisco references: tracked static-route failover, OSPF and EIGRP convergence, and EIGRP and DUAL.