How does RIP work, and what is the count-to-infinity problem?
HardConceptRouting Protocols
Answer
RIP (Routing Information Protocol) is a distance-vector protocol that uses hop count as its metric. Every 30 seconds, each router sends its table to its neighbours and adopts any shorter route, using the Bellman-Ford rule: cost via a neighbour = neighbour's cost + 1.
- RIP allows at most 15 hops, and 16 means infinity (unreachable), so it suits only small networks.
- Count to infinity: after a link fails, routers can keep advertising the dead route to each other, adding 1 each time, while packets loop between them.
- Fixes: split horizon (never advertise a route back to the neighbour it was learned from), poison reverse (advertise it back with cost 16) and triggered updates (announce changes immediately instead of waiting 30 seconds).
Example: Chain A – B – C: B reaches C in 1 hop, and A in 2 hops via B. Then the B–C link fails.
B: link to C is down, but A advertises "C in 2" -> B sets C = 3 via A
A: B now advertises "C in 3" -> A sets C = 4 via B
B: A advertises "C in 4" -> B sets C = 5 via A
...the count continues until it reaches 16 (unreachable)
With split horizon, A never tells B about a route it learned from B, so B marks C unreachable at once.