RIP Routing Protocol, Count-to-Infinity, and Countermeasures

RIP Routing Protocol, Count-to-Infinity, and Countermeasures

Verified Sources
Nov 3, 2026

Routing Information Protocol (RIP) is a classic distance-vector protocol that computes routes using hop count as its metric and limits the maximum path length to prevent endless loops: RIP “infinity” is 16, so valid routes are at most 15 hops. 2

RIP routers periodically exchange their distance vectors (a list of destinations with their hop-count distance) with neighboring RIP routers. In steady state, each router selects the next hop that yields the minimum hop count to each destination; this distributed process is closely related to the Bellman-Ford relaxation idea used in distance-vector routing.

When topology changes (e.g., a link fails), distance-vector protocols can temporarily exchange inconsistent information, producing a routing loop. A key manifestation of this is the count-to-infinity problem, where routers gradually increase the advertised distance until reaching the protocol’s infinity value.

Footnotes

  1. Routing Information Protocol - Wikipedia - RIP overview, hop-count metric, infinity=16, and loop-prevention mechanisms (split horizon/poison/holddown). ↩

  2. Distance-vector and RIP (KTH lecture slides) - RIP uses metric hop count; infinity=16; split horizon and poison reverse/holddown concepts. ↩

  3. Bellman–Ford algorithm - Wikipedia - Relaxation-based shortest path computation; distance-vector routing uses distributed Bellman-Ford-style ideas. ↩

  4. Distance-vector routing protocol - Wikipedia - Explains count-to-infinity core reasoning and typical mitigations (split horizon/poison reverse/max hops/hold time). ↩

RIP: Split Horizon & Route Poisoning (Loop Mitigation)

How RIP works (distance-vector update logic)

RIP is based on the distance-vector model: each router maintains, for every destination network, an estimated distance (hop count) and a next hop. It periodically sends that vector to neighbors; neighbors update their own tables by considering “neighbor’s distance + 1 hop.” This distributed relaxation process corresponds to Bellman-Ford-style reasoning.

Key protocol facts:

  • Hop-count metric: RIP selects the smallest hop count.
  • Infinity: RIP cannot support paths longer than 15 hops; hop count 16 is treated as unreachable. 2
  • RIP uses distance-vector techniques such as split horizon, route poison reverse, and hold-down to reduce instability. 2

Footnotes

  1. Bellman–Ford algorithm - Wikipedia - Relaxation-based shortest path computation; distance-vector routing uses distributed Bellman-Ford-style ideas. ↩

  2. Routing Information Protocol - Wikipedia - RIP overview, hop-count metric, infinity=16, and loop-prevention mechanisms (split horizon/poison/holddown). ↩ ↩2

  3. Distance-vector and RIP (KTH lecture slides) - RIP uses metric hop count; infinity=16; split horizon and poison reverse/holddown concepts. ↩ ↩2

  4. Distance-vector routing protocol - Wikipedia - Explains count-to-infinity core reasoning and typical mitigations (split horizon/poison reverse/max hops/hold time). ↩

Example: RIP route computation after a failure (and how loops are avoided)

  1. 1
    Step 1

    Assume routers R1, R2, and R3 are neighbors in a line: R1—R2—R3. Destination network D is connected to R3. Initially, R3 advertises D with metric 0, so R2 learns D with metric 1, and R1 learns D with metric 2 (hop count). This matches RIP’s hop-count metric model and “min metric wins” behavior. 2

    Footnotes

    1. Routing Information Protocol - Wikipedia - RIP overview, hop-count metric, infinity=16, and loop-prevention mechanisms (split horizon/poison/holddown). ↩

    2. Bellman–Ford algorithm - Wikipedia - Relaxation-based shortest path computation; distance-vector routing uses distributed Bellman-Ford-style ideas. ↩

  2. 2
    Step 2

    Now assume the link between R2 and R3 fails, so D becomes unreachable through R3. R2 must invalidate its route to D (or set it to infinity=16) and advertise the change. RIP defines infinity as hop count 16. 2

    Footnotes

    1. Routing Information Protocol - Wikipedia - RIP overview, hop-count metric, infinity=16, and loop-prevention mechanisms (split horizon/poison/holddown). ↩

    2. Distance-vector and RIP (KTH lecture slides) - RIP uses metric hop count; infinity=16; split horizon and poison reverse/holddown concepts. ↩

  3. 3
    Step 3

    If R1 and R2 exchange stale information during convergence, R1 might think D is reachable via R2, while R2 temporarily still believes D is reachable via R1 (or via stale routes). Then R1 increases the metric it believes for D (e.g., 2→3→…), and R2 also increases, until the metric reaches RIP infinity 16. This is the count-to-infinity problem in distance-vector routing. 2

    Footnotes

    1. Distance-vector routing protocol - Wikipedia - Explains count-to-infinity core reasoning and typical mitigations (split horizon/poison reverse/max hops/hold time). ↩

    2. Routing Information Protocol - Wikipedia - RIP overview, hop-count metric, infinity=16, and loop-prevention mechanisms (split horizon/poison/holddown). ↩

  4. 4
    Step 4

    To reduce the chance of mutual deception loops between neighbors, RIP uses split horizon and also the technique often described as poison reverse/route poisoning: when a route is learned from a neighbor, it is not advertised back to that neighbor as a valid route; in poison reverse it is advertised with metric infinity. 2

    Footnotes

    1. Distance-vector and RIP (KTH lecture slides) - RIP uses metric hop count; infinity=16; split horizon and poison reverse/holddown concepts. ↩

    2. Distance-vector routing protocol - Wikipedia - Explains count-to-infinity core reasoning and typical mitigations (split horizon/poison reverse/max hops/hold time). ↩

  5. 5
    Step 5

    With poison reverse/route poisoning, when R2 learns that D is unreachable, it can advertise D back to R1 with metric 16 (unreachable), preventing R1 from increasing its metric based on R2’s (stale) belief. With hold-down, routers can also temporarily suppress updates that would otherwise cause oscillation. 2

    Footnotes

    1. Distance-vector and RIP (KTH lecture slides) - RIP uses metric hop count; infinity=16; split horizon and poison reverse/holddown concepts. ↩

    2. Distance-vector routing protocol - Wikipedia - Explains count-to-infinity core reasoning and typical mitigations (split horizon/poison reverse/max hops/hold time). ↩

  6. 6
    Step 6

    Because RIP caps distances at infinity=16 (15 maximum hops), even in the presence of a loop the metric cannot increase beyond the infinity value. This bounds the count-to-infinity process but doesn’t eliminate slow convergence by itself. 2

    Footnotes

    1. Routing Information Protocol - Wikipedia - RIP overview, hop-count metric, infinity=16, and loop-prevention mechanisms (split horizon/poison/holddown). ↩

    2. Distance-vector routing protocol - Wikipedia - Explains count-to-infinity core reasoning and typical mitigations (split horizon/poison reverse/max hops/hold time). ↩

Visualizing the “bounded infinity” idea

RIP’s loop behavior is effectively “counting upward” until the hop-count reaches 16, at which point the route is considered unreachable and discarded/invalidated. 2

Footnotes

  1. Routing Information Protocol - Wikipedia - RIP overview, hop-count metric, infinity=16, and loop-prevention mechanisms (split horizon/poison/holddown). ↩

  2. Distance-vector and RIP (KTH lecture slides) - RIP uses metric hop count; infinity=16; split horizon and poison reverse/holddown concepts. ↩

Count-to-Infinity Problem (why it happens)

In distance-vector routing, routers exchange only distance summaries, not the full path. The core issue: if a router tells a neighbor “I can reach destination X,” the neighbor cannot know whether that path uses itself (i.e., whether it forms part of the neighbor’s route).

A typical scenario:

  1. A link fails.
  2. Router A stops receiving valid advertisements for a destination and should mark it unreachable.
  3. Router B continues to believe the destination is reachable because it has stale info or because it still receives updates implying reachability.
  4. A and B may then keep “passing the blame” by updating the metric upward each round—hence count to infinity—until the protocol’s maximum metric is reached.

This is discussed as a fundamental weakness of Bellman-Ford-style distance-vector routing under asynchronous updates: the algorithm does not inherently prevent loops and suffers from count-to-infinity.

Footnotes

  1. Distance-vector routing protocol - Wikipedia - Explains count-to-infinity core reasoning and typical mitigations (split horizon/poison reverse/max hops/hold time). ↩ ↩2 ↩3

Metric increase in count-to-infinity (bounded by RIP infinity)

Example of hop-count metric growth during a routing loop until it reaches 16 (infinity).

Countermeasures in RIP: what they prevent (and what they don’t)

Pro Tip: Think in “interfaces + stale vectors”

To predict loops, ask: Which neighbor learned the route from which interface, and which neighbor might have stale distance-vector entries for the destination? Most RIP loop mitigations (split horizon/poison reverse/hold-down) target that specific information-exchange gap. 2

Footnotes

  1. Distance-vector and RIP (KTH lecture slides) - RIP uses metric hop count; infinity=16; split horizon and poison reverse/holddown concepts. ↩

  2. Distance-vector routing protocol - Wikipedia - Explains count-to-infinity core reasoning and typical mitigations (split horizon/poison reverse/max hops/hold time). ↩

Warning: Capping metrics helps, but doesn’t guarantee fast convergence

RIP’s infinity=16 prevents unbounded growth, but convergence can still be slow during failures because distance-vector updates propagate gradually and can be inconsistent across routers. 2

Footnotes

  1. Routing Information Protocol - Wikipedia - RIP overview, hop-count metric, infinity=16, and loop-prevention mechanisms (split horizon/poison/holddown). ↩

  2. Distance-vector routing protocol - Wikipedia - Explains count-to-infinity core reasoning and typical mitigations (split horizon/poison reverse/max hops/hold time). ↩

Failure handling and loop mitigation timeline (conceptual RIP behavior)

Link failure occurs

t0: Topology change

Router(s) detect failure and must retract routes (set metric toward infinity=16). "

Footnotes

  1. Routing Information Protocol - Wikipedia - RIP overview, hop-count metric, infinity=16, and loop-prevention mechanisms (split horizon/poison/holddown). ↩

Inconsistent distance vectors circulate

t0+Δ: Immediate impact window

Neighbors may briefly still believe reachability, enabling count-to-infinity behavior if not mitigated. "

Footnotes

  1. Distance-vector routing protocol - Wikipedia - Explains count-to-infinity core reasoning and typical mitigations (split horizon/poison reverse/max hops/hold time). ↩

Split horizon / poison reverse / hold-down apply

t0+Δ+ε: Loop mitigation

Suppress or poison routes back to neighbors and optionally delay acceptance of updates during instability. 2"

Footnotes

  1. Distance-vector and RIP (KTH lecture slides) - RIP uses metric hop count; infinity=16; split horizon and poison reverse/holddown concepts. ↩

  2. Distance-vector routing protocol - Wikipedia - Explains count-to-infinity core reasoning and typical mitigations (split horizon/poison reverse/max hops/hold time). ↩

Metrics converge to infinity (16) or a valid minimum

t1: Bounded stabilization

If a loop persists, metric cannot increase past 16; otherwise correct routes stabilize. "

Footnotes

  1. Routing Information Protocol - Wikipedia - RIP overview, hop-count metric, infinity=16, and loop-prevention mechanisms (split horizon/poison/holddown). ↩

Compact summary of learning objectives

  • RIP is a distance-vector protocol that exchanges hop-count vectors and selects the minimum metric. 2
  • RIP sets a maximum metric by using infinity=16, enabling bounded behavior. 2
  • The count-to-infinity problem occurs because routers cannot infer whether a neighbor’s path includes themselves.
  • RIP countermeasures include split horizon, poison reverse/route poisoning, and hold-down timers. 2

Footnotes

  1. Routing Information Protocol - Wikipedia - RIP overview, hop-count metric, infinity=16, and loop-prevention mechanisms (split horizon/poison/holddown). ↩ ↩2

  2. Bellman–Ford algorithm - Wikipedia - Relaxation-based shortest path computation; distance-vector routing uses distributed Bellman-Ford-style ideas. ↩

  3. Distance-vector and RIP (KTH lecture slides) - RIP uses metric hop count; infinity=16; split horizon and poison reverse/holddown concepts. ↩ ↩2

  4. Distance-vector routing protocol - Wikipedia - Explains count-to-infinity core reasoning and typical mitigations (split horizon/poison reverse/max hops/hold time). ↩ ↩2

Knowledge Check

Question 1 of 4
Q1Single choice

In RIP, what value is treated as infinity for the hop-count metric?