RIPv2 Basics: Hop Count, Timers, and Loop Prevention

RIPv2 Basics: Hop Count, Timers, and Loop Prevention

RIPv2 is the protocol people learn first and dismiss fastest — but its timers and loop-prevention tricks are exactly the mechanisms that reappear, dressed up, in every distance-vector design since. This walk-through takes RIPv2 from “it counts hops” to the parts that actually bite in production: the count-to-infinity problem and the four timers that paper over it.

1. RIPv1 vs RIPv2 — what actually changed

RIPv2 is still a distance-vector protocol that advertises its whole table periodically, but it fixed the three things that made RIPv1 unusable on real networks: it carries the subnet mask in every route (so VLSM and CIDR work), it sends updates to multicast 224.0.0.9 instead of broadcast, and it supports authentication.

RIPv1 vs RIPv2NET BY MERIPv1Classful — no subnet mask in updatesBroadcast 255.255.255.255No authenticationRIPv2Classless — carries subnet mask (VLSM/CIDR)Multicast 224.0.0.9Plaintext or MD5 authentication

2. The metric is hop count — and it is small

RIPv2 ranks routes by a single number: how many routers a packet crosses. The best path is simply the fewest hops, regardless of link speed — a 10 Mbps path of 2 hops beats a 10 Gbps path of 3. The ceiling is the whole design: 15 hops is the maximum, and 16 means unreachable (infinity). That small ceiling is not a limitation bolted on; it is the mechanism that stops routing loops from counting upward forever.

RIPv2 hop-count ceilingNET BY ME1…141516reachable (1-15)16 = infinity (unreachable)The low ceiling bounds the count-to-infinity problem — not an accident

3. How updates move

Each router floods its entire routing table to its neighbors every 30 seconds over UDP port 520, to multicast 224.0.0.9. There is no neighbor relationship and no acknowledgement — a router simply trusts what it hears and adds one hop. Simplicity is the point, and also the weakness: with no handshake, convergence rides entirely on timers.

RIPv2 periodic updatesNET BY MER1R2R3full table / 30sfull table / 30sUDP 520 · multicast 224.0.0.9 · each hop adds +1 to the metric

4. The four timers

Because there is no handshake, four timers govern every route’s life. Update (30 s) paces advertisements. Invalid (180 s) marks a route unusable if no update refreshes it. Hold-down (180 s) then refuses worse news about that route, giving the network time to agree it is gone. Flush (240 s) finally removes it. Those numbers are why RIPv2 converges in minutes, not milliseconds.

RIPv2 timersNET BY MEUpdate30sInvalid180sHold-down180sFlush240s

5. Count-to-infinity — the problem everything else fixes

Here is the failure the whole protocol is built around. A network goes down; before the news reaches everyone, a router still advertising the dead route feeds it back to the router that just lost it. Each bounce adds a hop, and the two routers count upward — 2, 3, 4… — believing they still have a path. Without a ceiling they would count forever; with one, they count to 16 and finally declare it dead.

Count-to-infinityNET BY MER1“I reach Net X in 3”R2“then I reach it in 4”stale route (+1)bounced back (+1)Metric climbs 3 -> 4 -> 5 … -> 16 = unreachable. The ceiling ends the loop.

6. Split horizon and poison reverse

The first defense is split horizon: never advertise a route back out the interface you learned it on — if R2 learned Net X from R1, it does not tell R1 about Net X. Poison reverse strengthens it: R2 does advertise it back, but with a metric of 16 (poisoned), explicitly saying “do not use me to reach this.” Poisoning is louder and faster than silence, at the cost of larger updates.

Split horizon and poison reverseNET BY MER1 (owns Net X)R2Net X, metric 1Net X, metric 16 (poison reverse)Split horizon alone would simply stay silent on the return path

7. Triggered updates and hold-down

Waiting 30 seconds to announce a failure is too slow, so a triggered update fires immediately when a metric changes — the bad news races ahead of the periodic clock. Hold-down then does the opposite for good news: after a route is marked down, the router ignores any update offering a worse-or-equal metric for the hold-down period, so a stale advertisement cannot resurrect a route that is genuinely gone.

Triggered updates and hold-downNET BY METriggered updatechange -> advertise NOW, don’t wait 30sspeeds the spread of bad newsHold-downignore worse-or-equal news for the timerblocks stale routes from reappearing

8. What RIPv2 added for the real world

Beyond classless masks and multicast, RIPv2 carries three fields that matter operationally: a next-hop field (so a router can point traffic at a better gateway on a shared segment it is not itself using), a route tag (a label to mark routes redistributed from another protocol, so they can be filtered or re-exported cleanly), and MD5 authentication (so a rogue device cannot inject routes). Those are the features that let RIPv2 survive at the edges of networks that otherwise run OSPF or EIGRP.

RIPv2 operational fieldsNET BY MENext-hop fieldpoint at a better gatewayRoute tagmark redistributed routesMD5 authreject rogue updates

Takeaways

RIPv2 is worth understanding not because you will design with it, but because its problems are universal: a metric needs a ceiling, bad news must travel faster than good news, and a protocol with no handshake must lean on timers. Every modern IGP solves these more elegantly — but RIPv2 is where the questions were first asked plainly.

Generic, vendor-neutral fundamentals from my own study and lab work. No client- or employer-specific configuration.

Mokrane ASSAM

Comments are closed.