skip to content

Why does RIP treat a metric of 16 as unreachable, and how does that cap a RIP network at 15 hops?

level: juniorimportance: should knowfreq 38%

answer

  1. infinity chosen deliberately small
  2. hop count as the metric
  3. valid metrics run 1 to 15
  4. a failure's count must end fast

basics

~20 s

RIP uses 16 as infinity so that counting to infinity after a failure ends quickly. The same choice leaves valid metrics at 1-15, so with each network costing 1 no usable path may be longer than 15 hops.

solid answer

~50 s

RIP's metric is a hop count: by convention each network costs 1, so a route's metric is how many networks lie on the path. RFC 2453 defines valid metrics as 1 to 15 and **16 as infinity** — unreachable. The value is deliberately small. After a failure, distance-vector routers can keep re-learning a dead route from each other, raising the metric one step at a time, and a small infinity ends that count quickly. The cost is size: the RFC limits RIP to networks whose longest path is 15 hops, and giving links a cost above 1 shrinks the reach further. Infinity was never raised because older RIP routers would ignore larger values as they ignore 16; the metric field itself is four octets wide, so 16 is a protocol choice, not a field limit.

go deeper

for a junior

Recall that RIP's metric is a hop count, that 15 is the largest usable value and that 16 means unreachable.

for a middle

Explain why infinity is deliberately small, how the cap ends counting to infinity, and how link costs above 1 shrink the reachable diameter.

for a senior

Show how the 16 cap bounds every loop, why it could not be raised without breaking older routers, and what it rules out when you size a design.

for a principal

Frame the 16-hop infinity as an explicit trade between convergence speed and network size, and use it to explain where RIP stops being a sensible choice.

## The metric is a hop count RIP's metric is the sum of the costs of the networks on a path. RFC 2453 notes that each network normally costs 1 — "this is the way RIP is normally configured" — so the metric is effectively the number of hops. When a router receives a route, it adds the cost of the link it arrived on and caps the result: ``` metric = MIN(advertised_metric + link_cost, 16) ``` Valid metrics run from **1 to 15**. The value **16 is infinity**: the destination is unreachable. A route at 16 is never installed as a new route, and if it comes from the router's current next hop, the existing route is taken out of service and deleted. ## Why infinity is so small RFC 2453 says 16 is chosen to be "as small as possible". The reason is counting to infinity: after a network disappears, distance-vector routers can keep re-learning it from each other's stale advertisements, each adding a hop, and the only guaranteed stop is the metric reaching infinity. The smaller infinity is, the sooner that happens: - Infinity must be **larger** than any real metric, or reachable networks would look unreachable. - It should be **no larger** than needed, or each count takes longer and carries more looping traffic. - The RFC calls it "a tradeoff between network size and speed of convergence in case counting to infinity happens". ## 16 as a loop guard Because every computed metric is capped at 16, every count-to-infinity is bounded. However a stale route circulates — between two routers or around a ring of three — each pass adds at least one, and the route is declared unreachable when it reaches 16. Split horizon, poisoned reverse and triggered updates make such loops rare; the cap guarantees that the ones that happen end. ## 16 as a diameter cap The same number limits size. RFC 2453 lists it as the protocol's first limitation: RIP is "limited to networks whose longest path (the network's diameter) is 15 hops". That assumes cost 1 everywhere: | Cost per network | Longest reachable path | |---|---| | 1 | 15 networks | | 3 | 5 networks (5 x 3 = 15) | | 5 | 3 networks (3 x 5 = 15) | Raising link costs to steer traffic therefore shrinks reach: "If the system administrator chooses to use larger costs, the upper bound of 15 can easily become a problem." A destination beyond the limit is not slow or degraded; it is simply unreachable. ## Why it was never raised The metric field in a RIP route entry is **four octets** wide, so 16 is not a field-width limit; it is a protocol constant. RFC 2453 records that people asked for a larger infinity and explains why it was not done: 1. Older RIP routers would be confused; at best they would ignore larger metrics as they ignore 16. 2. Reusing the high octets of the field would break implementations that treat the metric as a 4-octet number. 3. A larger infinity would also make every count to infinity longer, giving back the reason it is small. RIPng (RFC 2080) keeps the same range: 1 to 15 valid, 16 unreachable. ## What it means in practice - A RIP domain is small by design; RFC 2453 describes RIP as an interior gateway protocol for networks of moderate size. - A network wider than 15 hops needs a different interior routing protocol, or several routing domains joined by other means. - A metric of 15 is still reachable; 16 is not. Calling 16 "the longest usable route" has the boundary backwards.

  • A RIP router receives a route advertised at metric 15 over a link of cost 1. What does it do with it?
    It computes MIN(15 + 1, 16) = 16, which is infinity, so the destination is unreachable through that neighbour. If the router has no route to the prefix, it does not install one. If that neighbour is its current next hop, the existing route is marked unreachable and the deletion process begins.
  • Why didn't later RIP versions simply raise infinity to support bigger networks?
    Because older routers on the same network would break. RFC 2453 notes a larger infinity would confuse earlier RIP implementations, which would at best ignore those routes as they ignore 16, and that reusing the metric field's spare octets would break implementations reading it as a 4-octet number. A larger infinity would also make every count to infinity longer.

saying these in an interview costs you the question

  • The RIP metric field is only four bits wide, which is why it stops at 15.
  • RIP's 15-hop limit only bounds network size and has nothing to do with loops.
  • A RIP route with metric 16 is the longest route that still works.
  • RIP's metric reflects bandwidth, so slow links get higher metrics automatically.
  • Giving RIP links a higher cost does not change how far routes can reach.