Overview
RFC 2453 defines RIP Version 2 (RIP-2), extending RIP-1 to include subnet masks, route tags, next-hop, multicasting, and authentication, while preserving backward compatibility.
Background and Justification
- RIP remains useful in small/moderate networks due to low overhead and simplicity.
- RIP-1 lacks subnetting, authentication, and AS/IGP/EGP awareness; RIP-2 addresses these gaps.
- RIP uses distance vector (Bellman-Ford) algorithm and is suited as an IGP within an AS.
Distance Vector Basics
- Each router maintains routes: destination, next hop, interface, metric, timer.
- Metric: additive positive integers; typical hop-count with max valid 15; 16 means infinity.
- Update process:
- Periodic full-table sharing with neighbors.
- On receipt: add incoming interface cost; adopt better routes; always accept updates from current next hop.
Handling Topology Changes and Stability
- Timeouts: if no update from next hop in 180s, mark route invalid (metric 16), start garbage-collection.
- Counting to infinity: slow convergence when routes vanish; choose small infinity (16) to limit duration.
- Split horizon:
- Simple: omit routes back to the neighbor learned from.
- Poisoned reverse: advertise those routes with metric 16 for faster loop breakage.
- Triggered updates:
- Send immediate updates on route metric change; rate-limit with 1β5s random delay; may still race with regular updates.
RIP-2 Protocol Specification
- Metric 1β15; admin-configurable per interface; typical cost 1.
- Routing table entries include destination, metric, next hop, change flag, timers, and subnet mask.
- All routers in the AS must participate; leaks needed between multiple IGPs.
Message Format
- Transport: UDP port 520 for both RIP-1 and RIP-2.
- Header: command (1=Request, 2=Response), version, MBZ fields zero.
- RIP-1 RTEs: AFI, IPv4 address, metric; zeros in unused fields.
- RIP-2 RTEs: AFI, Route Tag, IP Address, Subnet Mask, Next Hop, Metric.
Addressing and Route Types
- Supports routes to networks, subnets, hosts, and default (0.0.0.0).
- Longest-match selection: host routes, then subnet/network, then default.
- RIP-1 ambiguity without masks; avoid advertising subnets where masks are unknown.
- Border routers:
- Inside subnetted network: advertise subnets internally.
- Outside: advertise only the aggregated network entry; suppress internal host routes.
- Default routes: 0.0.0.0 entries configured by admin; scope should not exceed AS.
Timers and Processing
- Periodic updates: every 30s; add jitter or use stable clock to avoid synchronization.
- Per-route:
- Timeout: 180s since last update; then mark invalid and trigger update.
- Garbage-collection: 120s after invalidation; then remove route; cancel if a valid new route appears.
- Request handling:
- Special single-entry (AFI=0, metric=16) means βsend entire table.β
- Specific lookups return exact table values without split horizon.
- Response handling:
- Validate source (RIP port, directly connected, not self).
- Validate entries (valid unicast, metric 1β16).
- metric = min(received metric + incoming link cost, 16).
- Add or update routes; reinit timers; trigger update on change.
- Optional heuristic: if equal metric but route is aging, switch to fresher equal-cost next hop.
Output and Triggered Updates
- Send one Response per directly-connected network: unicast over p2p and broadcast/multicast over LANs.
- Triggered updates:
- Include at least changed routes (route change flag set); apply split horizon.
- Suppress if a regular update is imminent; clear change flags after sending.
- Rate-limit with random 1β5s timer; coalesce multiple changes.
RIP-2 Extensions
- Authentication:
- First RTE with AFI=0xFFFF indicates authentication.
- Type 2: simple password; 16-octet left-justified, null-padded.
- Route Tag:
- Preserved attribute to distinguish internal vs external routes (e.g., AS number for imported routes).
- Subnet Mask:
- Eliminates subnet/host ambiguity; zero means no mask included.
- Interop rules near RIP-1: do not leak internal details, avoid advertising more-specifics seen as host routes, and avoid supernets to RIP-1 neighbors.
- Next Hop:
- Advises immediate next hop; 0.0.0.0 means sender.
- Must be directly reachable on the receiving interface; else treat as 0.0.0.0.
- Multicasting:
- Use 224.0.0.9 for periodic RIP-2 updates; configurable per-interface; accept multicast responses on NBMA if received.
- Queries:
- RIP-2 router responds to RIP-1 Requests with RIP-1 Responses unless configured to send only RIP-2.
Compatibility and Mixed Environments
- Version handling: discard v0; discard v1 with non-zero MBZ; accept versions >1 despite MBZ content.
- Compatibility switches per-interface:
- Send: RIP-1, RIP-1-compatible (RIP-2 via broadcast), RIP-2 (multicast), none.
- Receive: RIP-1 only, RIP-2 only, both, none.
- Authentication policy:
- If not authenticating: accept RIP-1 and unauthenticated RIP-2; drop authenticated RIP-2.
- If authenticating: accept RIP-2 that pass; drop unauthenticated and failed-auth RIP-2; ignore RIP-1 for maximum security.
- Infinity cannot be increased without breaking compatibility.
- Addressless links are not supported.
- Mixed v1/v2: use a single subnet mask across the network; disable auto-summarization; otherwise risk blackholes or excess routes.
Example Use of Next Hop (Conceptual)
- Internal routers speak RIP-2; external routers speak another IGP.
- External router adjacent to internal domain advertises routes with Next Hop set to optimal external egress.
- Internal routers forward directly to that Next Hop, avoiding unnecessary extra hops via the advertising external router.
Key Terms & Definitions
- Distance Vector: Routing algorithm exchanging vector of distances to destinations with neighbors.
- Metric: Additive cost; RIP uses 1β15; 16 is infinity (unreachable).
- Split Horizon: Do not advertise a route back on the interface it was learned; poisoned reverse advertises with metric 16.
- Triggered Update: Immediate update sent upon route change; rate-limited.
- Route Tag: Attribute marking external vs internal routes; preserved in re-advertisement.
- Next Hop: Immediate next hop IP for a specific route; advisory to optimize forwarding.
- Default Route: 0.0.0.0 entry used when no specific match exists.
- Timeout: 180s without refresh marks route invalid; garbage collection removes after 120s.
Structured Details
| Aspect | Value/Behavior |
|---|
| Transport | UDP port 520 (source and destination for unsolicited updates) |
| Commands | 1=Request; 2=Response |
| Metric range | 1β15 valid; 16=infinity (unreachable) |
| Periodic update | Every 30s; jitter Β±0β5s or stable clock |
| Route timeout | 180s since last update to mark invalid |
| Garbage-collection | 120s after invalidation before deletion |
| RIP-2 multicast | 224.0.0.9 (no IGMP required) |
| Triggered update delay | Random 1β5s; coalesce multiple changes |
| Max RTEs per message | 25; 24 if authentication RTE present |
| Authentication | AFI=0xFFFF in first RTE; Type 2 simple password, 16 octets |
| Address families (RIP-1) | AF_INET=2 generally supported |
| Infinity rationale | Small (16) to limit counting-to-infinity duration |
Action Items / Next Steps
- Configure per-interface send/receive modes (RIP-1, RIP-2, compatibility, none) as appropriate.
- Enable split horizon; prefer poisoned reverse; allow disabling if needed to reduce overhead.
- Implement and enforce triggered update rate-limiting (1β5s random).
- Include subnet masks and next hop in RIP-2; suppress suboptimal next hops not directly reachable.
- Use multicast 224.0.0.9 for RIP-2 where supported; fall back to broadcast/unicast as configured.
- In mixed v1/v2 networks, standardize a single subnet mask and disable auto-summarization.
- If using authentication, deploy Type 2 simple password consistently; consider ignoring RIP-1 for security.
- Ensure timers (30s, 180s, 120s) and route change flags are correctly maintained and processed.