The Routing Information Protocol (RIP) is one of the oldest and simplest distance-vector routing protocols. It uses hop count as its metric to determine the best path to a destination network. A “hop” is simply a router that a packet must pass through. The maximum hop count for RIP is 15; a route with a hop count of 16 is considered unreachable, which limits RIP’s scalability to smaller networks.
RIP routers periodically exchange their entire routing tables with their directly connected neighbors. These updates are sent using User Datagram Protocol (UDP) on port 520.
To prevent routing loops, which are a common issue with distance-vector protocols, RIP employs several mechanisms:
-
Maximum Hop Count (15): As mentioned, any route advertised with a hop count of 16 is considered unreachable, effectively “poisoning” the route to prevent endless loops.
-
Split Horizon: A router will not advertise a route back out the same interface through which it learned that route. This helps prevent two-node routing loops.
-
Poison Reverse (Split Horizon with Poisoned Reverse): A more aggressive version of split horizon. If a router learns a route from a neighbor and then that route becomes unreachable, the router will advertise that route back to the original neighbor with a hop count of 16 (infinity). This explicitly tells the neighbor that the route is bad.
-
Holddown Timers: When a route goes down, a router will mark it as potentially invalid and enter a holddown state for a certain period (typically 180 seconds). During this time, it will ignore any new, less favorable information about that route, preventing it from immediately accepting a potentially erroneous path.
-
Triggered Updates: While RIP primarily uses periodic updates, if a route changes its state (e.g., goes down), the router can immediately send out an update to its neighbors, rather than waiting for the next periodic update. This helps speed up convergence.
Now, let’s look at the two main versions for IPv4: RIPv1 and RIPv2.
RIPv1 (Routing Information Protocol Version 1)
-
RFC: Defined in RFC 1058.
-
Classful Routing: This is the most significant limitation of RIPv1. It does not include subnet mask information in its routing updates. It assumes that all devices within the same major network class (A, B, or C) use the same subnet mask. This means:
-
It doesn’t support Variable Length Subnet Masks (VLSM), where different subnets within the same major network can have different sizes.
-
It doesn’t support Classless Inter-Domain Routing (CIDR), which allows for more efficient IP address allocation and route summarization.
-
It struggles with discontiguous networks (subnets of the same major network separated by another major network).
-
-
Broadcast Updates: RIPv1 sends its periodic routing updates as broadcasts to the IP address 255.255.255.255. This means every device on the segment receives and processes the update, regardless of whether it’s a RIP router or not, leading to inefficient use of network bandwidth.
-
No Authentication: RIPv1 has no mechanism to authenticate routing updates, making it vulnerable to malicious updates from unauthorized devices.
-
Administrative Distance (AD): 120 (default).
-
Simplicity: Very simple to configure and understand, which made it popular in small, flat networks.
RIPv2 (Routing Information Protocol Version 2)
-
RFC: Defined in RFC 1723 and later RFC 2453.
-
Classless Routing: This is the primary improvement over RIPv1. RIPv2 includes subnet mask information in its routing updates. This enables:
-
Support for VLSM, allowing for flexible subnetting.
-
Support for CIDR, promoting efficient IP address usage and route aggregation.
-
Ability to handle discontiguous networks correctly.
-
-
Multicast Updates: RIPv2 sends its periodic routing updates as multicasts to the IP address 224.0.0.9. Only devices configured to listen for RIPv2 multicast (i.e., other RIPv2 routers) will process these updates, significantly reducing network overhead compared to broadcasts.
-
Authentication: RIPv2 introduced authentication for routing updates. It supports:
-
Plain-text authentication: A simple password, easily sniffed.
-
MD5 authentication: A more secure hash-based authentication.
-
-
Route Tags: RIPv2 includes a “route tag” field, which can be used to distinguish between routes learned from different sources or for policy-based routing.
-
Manual Route Summarization: Allows administrators to manually configure route summarization, further reducing routing table sizes and update traffic (though automatic summarization is still enabled by default and often needs to be disabled for classless behavior).
-
Backward Compatibility: RIPv2 can be configured to operate in a mixed environment with RIPv1, often by sending version 2 updates but accepting both versions.
-
Administrative Distance (AD): 120 (default).