Dynamic routing
Link-state routers share a map; distance-vector routers share directions
Distance-vector protocols pass on distances; link-state protocols such as OSPF flood the topology and each router computes its own paths.
Static routes do not scale, so routers teach each other. There are two families. A distance-vector router listens to its neighbours: R2 says a network is three hops away, so R1 records four, via R2. It never sees beyond its neighbour. A link-state router describes its own links to every router in the area. They all build the same map, and each one works out its own shortest paths on it. OSPF works this way.
Dynamic routing · Going deeper
RIP, EIGRP, OSPF, IS-IS and BGP compared
IGPs route inside an organisation; BGP routes between them. Each protocol has its own metric and administrative distance.
OSPF cost
OSPF follows the lowest total cost, and cost comes from bandwidth
OSPF cost is reference bandwidth ÷ link bandwidth; A reaches E by A–B–E at cost 20.
Every OSPF link has a cost, calculated from its bandwidth: fast links are cheap. Router A wants to reach E. Over B, two ten-gigabit links, it costs twenty. Over D and C, three ten-gigabit links, thirty. Over the one-gigabit link to C, more than a hundred. A runs the shortest-path calculation on its map and installs the path through B.
Convergence
When a link fails, every router recomputes from the same new map
When B–E fails the change is flooded, every router reruns SPF, and A’s path becomes A–D–C–E, cost 30.
Now the link from B to E fails. B and E notice and flood the news to every router in the area. Each router removes the link from its map and runs the calculation again. A’s best path to E is now through D and C, at cost thirty. Because every router started from the same map, they all agree, and no packet is sent round in circles.
Convergence · Going deeper · 1 of 2
Becoming neighbours: states and the hello checks
OSPF neighbours pass from Down to Full. Area, subnet, timers, authentication, stub flag and MTU must all match. The router ID must be unique.
Convergence · Going deeper · 2 of 2
The designated router on a shared segment
The highest OSPF priority, then the highest router ID, becomes DR; the next becomes BDR. Priority 0 never stands.
Administrative distance
When sources disagree, the most trusted one wins
Administrative distance ranks route sources: connected 0, static 1, EIGRP 90, OSPF 110, RIP 120. Lower wins for the same prefix.
A router may hear about the same network from several sources. It cannot compare an OSPF cost with a RIP hop count, so each source has a trust rating, the administrative distance. A directly connected network is zero, a static route one, EIGRP ninety, OSPF a hundred and ten, RIP a hundred and twenty. For the same prefix, the lowest number goes into the table.
BGP
The internet is joined by policy, between autonomous systems
BGP exchanges prefixes between autonomous systems with the AS path each crossed; policy, then the shortest path, decides.
Inside an organisation, OSPF finds the fastest path. Between organisations, the internet runs BGP. Your company is one autonomous system, with its own number. It connects to two internet providers, each another AS. A cloud provider’s network is reachable through both. Each route arrives with the list of autonomous systems it crossed. The path through ISP A is shorter, so, all else being equal, it wins. Business agreements can override that.
First-hop redundancy
Two routers share one gateway address, so hosts never notice a failure
HSRP and VRRP give two routers a shared virtual IP and MAC; the active one forwards, the standby takes over if it fails.
A host has exactly one default gateway. If that router dies, the host is cut off. So two routers share the job. They agree on a virtual gateway address and a virtual MAC address, and every host uses that as its gateway. R1 has the higher priority, so it is active and does the forwarding. R2 listens for R1’s hellos. If they stop, R2 takes over the virtual address within ten seconds, and the hosts never knew there were two routers.
First-hop redundancy · Going deeper
HSRP, VRRP and GLBP compared
HSRP is active/standby with pre-emption off by default; VRRP is master/backup with pre-emption on. show standby brief shows the state.
Lesson complete
You finished “Dynamic routing and OSPF”
Nicely done.