Sub topic 10
RIP in practice
This chapter covers how RIP applies the distance-vector ideas from earlier chapters. It assumes you know basic IP addressing and subnetting, what a routing table is, and how split horizon, poison reverse, and a maximum metric limit count to infinity.
What RIP is
The Routing Information Protocol (RIP) is a distance-vector protocol that uses hop count as its metric. Each router that a packet crosses adds 1 to the cost. RIP runs over UDP port 520. Version 2 sends updates to the multicast address 224.0.0.9 and carries a subnet mask with each route. Version 1 uses broadcasts and has no masks, so it only supports classful networks.
Timers and the metric limit
RIP relies on a few fixed timers to drive the Bellman-Ford exchange.
| Timer | Default | Purpose |
|---|---|---|
| Update | 30 s | Send the full routing table to neighbors |
| Invalid | 180 s | Mark a route unreachable if no update arrives |
| Hold-down | 180 s | Ignore worse news about a route that just failed |
| Flush | 240 s | Remove the route from the table |
The maximum metric is 15 hops. A metric of 16 means unreachable. This is the "infinity" from the count-to-infinity discussion. It caps how long a loop can last, but it also limits RIP to networks no more than 15 hops across.
Loop prevention in RIP
RIP uses split horizon, usually with poison reverse, so a router does not advertise a route back toward the neighbor it learned it from. It also uses hold-down timers and triggered updates. A triggered update is sent right away when a route changes, without waiting for the 30-second timer. Together these shorten the time a stale route survives, but convergence is still slow compared with link-state protocols. A failure can take minutes to spread.
Configuring RIPv2
A minimal Cisco IOS-style configuration enables RIP on interfaces in 10.0.0.0 and turns off automatic classful summarization.
router rip
version 2
network 10.0.0.0
no auto-summaryThe network command selects which interfaces send and receive RIP and which connected networks are advertised. It matches by classful network, not by exact prefix. Without no auto-summary, older software summarizes routes at classful boundaries. That can break discontiguous subnets, where subnets of one major network are separated by another network.
Common errors
- Running version 1 on one router and version 2 on its neighbor. They may fail to exchange routes correctly.
- Forgetting
no auto-summary, so subnets of 10.0.0.0 vanish behind a summarized route. - Designing a path longer than 15 hops. Routers beyond that point appear unreachable.
- Expecting RIP to choose by bandwidth. A 1 Gbps path with 3 hops loses to a 56 kbps link with 2 hops.
- Leaving RIP unauthenticated on untrusted links, which lets any host inject routes.
When RIP fits
RIP suits small, simple networks and lab work. Its configuration is short and its behavior is easy to predict. Larger or faster-changing networks usually need a link-state protocol, covered in later chapters.
Exercise
A router has a route to 10.5.0.0/16 with metric 15 and hears the same prefix from a neighbor at metric 15. What metric does it compute through that neighbor, and what does it do with the route?
Show answer
Through the neighbor the cost is 15 + 1 = 16. In RIP, 16 means unreachable, so the router cannot install the route through that neighbor. It keeps its existing route only if that route came from a different next hop and is still valid.
Exercise
Why can a RIP network take minutes to converge after a link failure, even with triggered updates?
Show answer
Hold-down and invalid timers (180 s each by default) make routers wait before accepting or discarding information about a failed route. These timers protect against loops but delay convergence.