In a distance-vector protocol each router repeatedly tells its neighbours how far it believes it is from every network, and each neighbour adds the cost of the link and keeps the smallest offer. It settles in as many rounds as the longest path has hops, but after a failure it can count upward slowly: on a line of three routers the survivors bounce a lost route between them for 15 rounds until both reach the infinity value of 16 used by RIP-style protocols. Split horizon with poisoned reverse stops that simple case, but not loops through three or more routers.

Part of Networking

The Bellman-Ford family of routing protocols (RIP and its relatives): how they converge, why they count to infinity after a failure, and the countermeasures.

Each Router Knows Only Its Neighbours’ Distances, Not The Map

A distance-vector router does not know the topology. It knows what each neighbour claims. Every round it takes each neighbour’s advertised distance to a network, adds the cost of the link to that neighbour (one hop in a hop-counting protocol), and keeps the smallest total with the neighbour that offered it as the next hop. Dynamic Routing places this family beside link-state. Its virtue is how little each router has to hold. Its weakness is that good news travels fast and bad news travels slowly, and the worked example shows exactly how slowly.

The examples below assume a simplified model: all routers update in lock-step rounds, each using the values its neighbours advertised in the previous round. Real routers update on timers and send triggered updates, so the pattern is right but the exact round numbers are an idealisation.

What You Need

  • A diagram of the routers and links with a cost on each
  • A pencil — the method is to fill in a table round by round, which is also how to check that a real protocol is doing what it should
  • A known infinity value — RIP-style protocols treat 16 hops as unreachable (general knowledge, not from the other articles; the reason is explained below)

Method: Work A Distance-Vector Protocol By Hand

Step 1: Write each router’s distance to the target network Start with the router that owns the network at 0, every other at infinity.

Step 2: Each round, recompute from the neighbours’ previous values New distance = the smallest of (neighbour’s advertised distance + 1).

Step 3: Stop when a round changes nothing That is convergence.

Step 4: Repeat after removing a link That is how you find the failure behaviour of your own topology.

Worked Example 1: Settling From Cold

A line of four routers A-B-C-D with network X attached to D, all links cost 1. Round 0: D = 0, others at infinity. Round 1: C = 0 + 1 = 1. Round 2: B = 1 + 1 = 2. Round 3: A = 2 + 1 = 3. A is 3 hops from D, and it took 3 rounds: one round per hop on the longest path.

Worked Example 2: Counting To Infinity

A line of three routers A-B-C with network X attached to C, links cost 1. Settled: C = 0, B = 1, A = 2. Now the link B-C fails. B can no longer hear C. A still advertises “X is 2 away”, and B believes it, as A’s offer is the only one: B sets 2 + 1 = 3 via A. Next A hears B’s 3 and sets 3 + 1 = 4. Each router keeps believing the other. With the lock-step model:

RoundA’s distanceB’s distance
start21
123
243
345
465
567
687
789
8109
91011
101211
111213
121413
131415
141615
151616

At round 15 both routers hold 16, which the protocol treats as unreachable, and the route is finally withdrawn. Until then, traffic for X bounces between A and B until its time-to-live runs out (Packet Structure). This is why the protocol picks a small infinity: with 16 the counting stops after 15 rounds; with a large value it would run far longer. The side effect is a hard limit: the longest usable path is 15 hops.

If updates are sent every 30 seconds (the RIP default, general knowledge), 15 rounds take 15 x 30 = 450 s, or 7.5 minutes of black-holed traffic. That figure depends on the assumed interval.

Split Horizon With Poisoned Reverse Stops The Two-Router Loop But Not Longer Ones

  • Split horizon — never advertise a route back out of the interface you learned it from. A learned X from B, so A tells B nothing about X. In the example B has nothing to believe after the failure, and the loop never starts
  • Poisoned reverse — advertise it back, but as infinity. Same result, faster, because B hears 16 straight away
  • Triggered updates and hold-down timers — send a change immediately instead of waiting for the next round, and refuse to accept a worse-looking route for a while after one dies (general knowledge)

With poisoned reverse the example resolves in two rounds: round 1, B hears 16 from A, so B = 16; round 2, A hears B’s 16, so A = 16.

None of these fix loops that run through three or more routers: A hears from B, B from C, C from A. Split horizon only watches one hop. Distance vector is therefore reliable on small trees and simple rings and unsafe on a tangled mesh, which is where Link State earns its extra memory.

Common Mistakes

  • Expecting a failure to be absorbed in one round — good news (a new route) is quick, bad news (a lost route) is slow
  • Building a chain longer than the infinity value — nothing beyond 15 hops is reachable
  • Turning off split horizon “to see what happens” on a live network — you will find out

What’s Next

  • Learn next: Link State — a map-based protocol that does not count to infinity
  • Combine with: Routing Tables — where each result ends up