Sub topic 7
Convergence and Why It Matters
This chapter assumes you know basic IP addressing and subnetting, what a routing table is, how longest-prefix match picks a route, and the graph terms node, edge, weight, and shortest path. It also assumes you have seen the Bellman-Ford update from the previous chapters.
What convergence means
A network is converged when every router's routing table agrees with the real topology and no router has a pending update to send or process. At that point, every router holds routes that together form loop-free paths to every reachable destination.
Convergence is a state. Convergence time is how long the network takes to reach that state after something changes, such as a link failing, a router rebooting, or a cost being edited. While the network is unconverged, routers disagree about the topology.
Why it matters
During convergence, packets can be:
- Dropped, because a router still points at a dead next hop (a black hole).
- Looped, because two routers each think the other is the way to the destination. Each pass decrements the IP TTL, so the packet dies after at most 255 hops, and meanwhile it consumes bandwidth on both links.
- Delayed or reordered, because paths change mid-flow.
For a web page load, a few seconds of loss is an annoyance. For voice, trading, or a payment system, it is an outage. Convergence time sets how much disruption a single failure causes.
The pieces of convergence time
Convergence time after a failure is the sum of several stages. Each protocol family spends its time in different places.
| Stage | What happens | Typical contributors |
|---|---|---|
| Detection | A router notices a neighbor or link is gone | Interface carrier loss, missed hellos, dead timer, BFD |
| Propagation | News of the change reaches other routers | Periodic update timers (distance-vector), flooding delay (link-state) |
| Computation | Routers recompute best routes | Bellman-Ford step, or a full Dijkstra run |
| Installation | New routes are written to the forwarding table | Hardware programming of the FIB |
Detection often dominates. A router that relies on a 180-second timeout to declare a neighbor dead cannot converge faster than 180 seconds, no matter how fast its algorithm is.
Convergence in distance-vector protocols
In a distance-vector protocol, a router knows only what its neighbors tell it. News of a change travels one hop per update round. Two things follow.
- Good news travels fast, bad news travels slowly. A new, cheaper route spreads in a number of rounds equal to the network diameter. A lost route is harder, because routers keep believing stale advertisements from each other (the count-to-infinity problem in the next chapter).
- Timers set the pace. RIP sends full updates every 30 seconds by default. In the worst case, a change waits almost one full interval before being sent, and then crosses one hop per interval. A 10-hop path can need minutes.
Triggered updates, which send a change immediately instead of waiting for the timer, shorten this. They do not remove the hop-by-hop nature of the spread.
A worked example
Take a chain A - B - C - D with every link cost 1, and a round-based model where all routers advertise at once. A new router D joins. Here are the rounds after D first advertises itself.
| Round | B learns | C learns | A learns |
|---|---|---|---|
| 1 | D at cost 1 | ||
| 2 | D at cost 2 | ||
| 3 | D at cost 3 |
Starting from D's neighbor C, news moves one hop per round. With a 30-second timer, A learns about D up to about 90 seconds after C does. Triggered updates would cut this to a few link delays.
You can simulate this with the update function from the earlier material. This script runs synchronous rounds on the chain and counts how many rounds the tables need to stop changing.
INFINITY = 16
def dv_update(me, link_cost, table, neighbor, advertised):
changed = False
for dest, adv in advertised.items():
if dest == me:
continue
new = min(link_cost + adv, INFINITY)
cur = table.get(dest)
if cur is None:
if new < INFINITY:
table[dest] = (new, neighbor)
changed = True
elif new < cur[0] or cur[1] == neighbor:
if (new, neighbor) != cur:
table[dest] = (new, neighbor)
changed = True
return changed
def advertise(me, table):
out = {me: 0}
for dest, (cost, _) in table.items():
out[dest] = cost
return out
links = {"A": ["B"], "B": ["A", "C"], "C": ["B", "D"], "D": ["C"]}
tables = {r: {} for r in links}
rounds = 0
while True:
snapshot = {r: advertise(r, tables[r]) for r in links}
changed = False
for r in links:
for n in links[r]:
if dv_update(r, 1, tables[r], n, snapshot[n]):
changed = True
if not changed:
break
rounds += 1
print("round", rounds, "A's table:", tables["A"])
print("converged after", rounds, "rounds")The script prints A's table each round and finishes after three rounds that change something. The count equals the diameter of the chain, which is 3 hops.
Convergence in link-state protocols
A link-state router floods a description of the change to every router, and each router then runs Dijkstra on its own copy of the database. News does not pass through intermediate route computations, so it travels roughly at the speed of flooding, limited by link delays and per-hop processing.
The costs move elsewhere:
- Computation: every router reruns the shortest path first (SPF) calculation. On large networks this takes noticeable CPU time.
- Throttling: to avoid recomputing on every flap, implementations delay SPF with timers (a short initial delay, then exponential backoff). These timers add to convergence time by design.
- Consistency: routers may finish at different moments. For a short window, two routers can hold different databases and forward by different views, which can cause brief micro-loops.
Link-state networks commonly converge in under a second with tuned timers and fast failure detection. Distance-vector protocols with default timers usually take far longer.
Common errors and misunderstandings
- Blaming the algorithm for slow detection. Check the dead or hold timers first. If a neighbor is declared down after 40 seconds, the algorithm is not the bottleneck.
- Assuming "converged" means "optimal". It means consistent with the metric. A badly chosen metric converges to a poor path.
- Tuning timers too low. Very short hello and dead timers detect failures sooner but cause false failures on congested links, which triggers more route changes and instability, called route flapping.
- Forgetting micro-loops. Even link-state networks can loop briefly while routers converge at different times.
Summary of trade-offs
- Distance-vector: simple and light on memory and CPU, but slow and loop-prone during convergence.
- Link-state: faster and more predictable, but needs memory for the full database, CPU for SPF, and careful timer tuning.
The next chapter looks at what goes wrong when distance-vector convergence fails: routing loops and count to infinity.
Exercise
A network of RIP routers uses a 30-second update timer and a 180-second timeout for dead routes. A router in the middle of a 6-hop chain loses its link to the next router, with no triggered updates. Name the stage that most likely dominates convergence time and explain why.
Show answer
Detection and propagation both matter, but if the failure is not signaled by interface loss, detection dominates: the router waits up to 180 seconds for the route's timeout before it treats the route as dead. After that, news still moves one hop per 30-second update interval, so propagation across the remaining hops adds more time. Triggered updates or BFD would shorten these stages.
Exercise
In the simulation script, what number of changing rounds do you expect if the chain is extended to six routers in a line (A to F), and why?
Show answer
Five rounds. In a chain, each router learns about the farthest router one hop per round, so the number of rounds equals the diameter, which is 5 hops for six routers in a line.