What Is RIPv2?
When you have a simple network topology with just one router, routing traffic around that network is simple. As the router knows exactly where each device is, it can forward data to the right destination without difficulties. Again, the routing is relatively simple in a slightly more complex network with two routers. If the router knows that the destination address is directly connected, it can send the traffic. It must be connected to the other router if it’s not directly connected.
Once you have more than two routers in a network, things become more complicated. This is especially the case when there is also access to the Internet. Let’s say we have three routers: A, B, and C, and that they’re connected in a line. While A and C know they can forward any traffic intended for an unknown destination to B, B faces the dilemma of not knowing which way to send traffic. If you add an internet connection to both A and C. None of the routers can know where to send any traffic if the destination device is not directly connected.
This is where routing tables come in. A routing table stores a list of which connected routers the router can forward specific traffic to. In small, simple networks, this could be hard coded by hand. This solution, however, doesn’t scale at all and is slow to update if there are any changes to the network. In reality, a routing protocol is used to allow routers to communicate dynamically with each other about the routes they offer.
Note: A routing table is always concluded with a default route. Typically this is a connection to the Internet, as that is where the vast majority of the IP address space is and so is the most likely place to find an unknown destination. The default route will generally point towards a router that does for routers that don’t have a direct internet connection.
An early routing protocol was RIP, later renamed RIPv1 as the updated standard for RIPv2 was published. RIP was simple. Every known IP address is stored in the routing table with the number of “hops” it takes to get there, with one hop being one router between the current one and the destination. A router starts its routing table with a list of the directly connected devices with a hop count of 0.
On startup, and then every 30 seconds, give or take an up to five-second random variation. The router then broadcasts its routing table and a request to all connected devices asking them to provide their routing tables. Connected routers respond by providing their routing tables. Any received routing entry has one added to each hop count to allow for the addition of the extra router.
Note: End-user devices, such as computers, are configured in silent mode. This prevents them from responding with their routing tables, which would be useless to the router.
While the hop count for directly connected devices can be as low as 0. RIP has a maximum number of 15 hops. A hop count of 16 is treated as infinite – as if the link is down.
Potential Issues With RIP
There are several potential issues with this approach. The first potential issue is the Split-Horizon problem. As routing tables only contain the number of hops, it’s possible to set up a loop that consumes unnecessary network bandwidth. In RIP, this is handled in two ways. First, only the smallest number of hops to a destination is ever kept. Secondly, if a router learns of a route from another, it never provides details of that route back to the router it learned about.
Another potential issue is what to do when a route is down for whatever reason. This is handled with route poisoning. Whenever a router becomes aware that a route is no longer valid, it sets its routing entry to infinity. It then broadcasts that to all connected devices, which in turn update and propagate the knowledge of the unavailable link.
In Cisco routers, this functionality is further enhanced with a hold-down timer. When a router learns that a connection is down, it prevents any updates that would tell it that the route is up for the duration of the hold-down timer. This prevents a connected device that hasn’t yet been informed that the connection is down from incorrectly convincing the router that the connection is up when it isn’t. The hold-down timer does, however, increase the time it takes for a RIP network to achieve convergence. That is when the routing tables of all devices are stable.
RIPv2 maintains full backward compatibility with RIPv1. However, it addresses some of its issues. The two significant changes were the addition of support for CIDR and the switch to a multicast rather than broadcast for updates.
When RIPv1 was in service, the world moved from the classful routing system to the Classless Inter-Domain Routing system or CIDR. This change was critical for more efficient use of the limited IPv4 address space, and RIPv1s lack of support limited its usefulness as CIDR was implemented. In reality, this change allowed for subnet masks to also be transmitted along with an IP address.
One of the fundamental issues associated with RIP is the large burst of traffic every 30 seconds as the router requests an update from other routers. RIPv2 reduced this effect somewhat by changing from broadcast to multicast. The use of broadcast meant that end devices saw the traffic spike. Multicast allowed the same data only to be sent to other routing devices and thus reduced the overall load on the network.
Another version of RIP is standardized as RIPng. RIPv1 and RIPv2 both only cover IPv4 addresses. RIPng is designed for IPv6 addresses. The “ng” in RIPng stands for next generation.
Timers In RIP
There are four timers associated with the RIP protocol. The Update timer defaults to 30 seconds and is simply the amount of time the router will wait between broadcasting its routing table gratuitously. The Invalid timer defines how long a route will be held as valid without another router updating the entry. In this case, “update” refers to confirming the route is still valid rather than providing a shorter, better route. It defaults to 180 seconds, after which the router updates the hop count to 16 marking the destination as unreachable.
The Flush timer controls the amount of time between a route being invalidated and the route being removed from the routing table. Instead of being a count from when an entry is invalidated, it is a count from the last received update. This means that the Flush timer must always be greater than the Invalid timer. The default value of 240 seconds provides a 60-second window during which the router advertises the route as down before the route is removed.
The hold-down timer is an addition to the standard by Cisco. It only applies when a route changes from a low value to a higher one, allowing time for the route to stabilize. The default duration is 180 seconds.
RIPv2 is a simple routing protocol for IPv4 networks. It calculates the number of routers between the current router and the destination. This makes it easy to set up and configure. However, it also means that it can miss some complexity, like the availability of a higher bandwidth route with extra hops. RIPv2 was popular in enterprise network environments but has since been replaced by more advanced protocols. A key feature in its loss of popularity was the limitation to a maximum hop count of 15.