Routing Information Protocol (RIP)
Although the new version of the CCNA exam 200-120 does not cover RIP, we want to touch on it for its historical value. This way you understand some of the basic characteristics of it and how a hybrid protocol such as EIGRP took some distance vector based features from a true distance vector protocol. So simply read through this to have a basic foundation of RIP and do not worry about it from a test perspective.
As you already know, RIP is a distance-vector protocol. In fact, it is the only distance vector protocol that is widely used today. There are two versions of RIP that can be used – RIP version 1 (RIPv1) and RIP version 2 (RIPv2). To make it easier to understand, this section first looks at RIPv1.
RIPv1 was originally defined in RFC 1058 and is a classful protocol. Hence, it does not advertise subnet mask information and assumes the default subnet mask based on the class of the network.
When a router starts up, it recognizes the connected networks and adds them to its routing table as connected routes (denoted by C in the routing table). When RIP is enabled, it will broadcast the routing table using UDP port 520. All neighboring routers that have RIP enabled will get this broadcast update and add the routes received in the update to their routing table. Each of these neighbors will in turn broadcast out their routing tables. This will cause the routing tables across the network to converge.
Being a distance-vector protocol, RIP has the following characteristics:
- It sends out its entire routing table every 30 seconds.
- It uses hop counts as metric and has a maximum hop count limit of 15.
- It implements split horizon, route poisoning and holddown timers to prevent routing loops.
- It has high convergence time
Notice that there are two timers mentioned above. RIP actually uses 4 different timers. To understand these timers consider the network shown in figure 5-1. If RIP is enabled on all the routers, after convergence, all the routers will know the 192.168.5.0/24 network
Figure 5-1 Understanding RIP Timers
Now take a look at the four timers used by RIP:
- Route update timer – RIP sends broadcasts out the entire routing table. This interval sets the interval between these updates.
- Route invalid timer – If a router does not hear any updates about a particular route for certain duration, it will consider that route as invalid. The invalid timer determines this duration. When a route becomes invalid, the router will send out poisoned routes to its neighbors. By default this value is 180 seconds. In the network above, if RouterC looses connectivity to RouterD, it will not hear about the 192.168.5.0/24 network. It will wait 180 seconds before considering the route as invalid and sending out poisoned routes.
- Holddown timer – When a route becomes invalid, it enters into a holddown state. In this state the route will remain in the routing table and packets will be forwarded towards the destination but the router will not accept any updates regarding this route unless the update contains a metric equal to or better than the existing metric. The holddown timer determines the duration of the holddown state. By default this duration is 180 seconds. This state is useful to ensure that flapping routes do not cause instability. In the network above, when RouterB gets the poisoned route from RouterC, it will put the route to 192.168.5.0/24 in the holddown state for 180 seconds. If RouterC regains connectivity to RouterD and updates RouterB, the route will be removed from the holddown state.
- Router flush timer – Once a route becomes invalid, it is put in a holddown state. While in the holddown state, the route is still in the routing table and will remain so for the duration specific by the flush timer. Once this timer expires, the route is flushed out of the routing table. By default this timer is 240 seconds and starts at the same time as the invalid timer. Hence the flush timer must be more than the invalid timer. In the above example, RouterA, RouterB and RouterC will remove the route to 192.168.5.0/24 60 seconds after it was marked invalid.
The timers can be a little confusing. To make it easier to understand, remember that:
- Invalid timer and Flush timer both start when the router receives an update for a route. Each time an update is received, the timers are reset back.
- If an update for a route is not heard for the duration of the invalid timer, it is marked invalid and the holddown timer is started.
- While the route is in the holddown state, the router will not accept an inferior route for that destination. Inferior route is an update with a metric worse then or equal to the existing one.
- The route will be removed when the flush timer expires.
In the above network, route to 192.168.5.0/24 becomes invalid 180 seconds after RouterC looses connectivity to RouterD. At this stage, 60 seconds are left in the flush timer. Hence 60 seconds after the route became invalid; it will be removed from the routing table. As you can see, it takes a total of 240 seconds or four minutes for a lost route to be removed from the routing tables across the network.