Distance vector protocols are susceptible to routing loops. Routing loops occur when a packet is continually routed through the same routers over and over again, in an endless circle. Because they can render a network unusable, distance vector routing protocols (such as RIP and EIGRP) employ several different mechanisms to prevent routing loops. We will describe them in this article.
Split Horizon
Split horizon is one of the features of distance vector routing protocols that prevents routing loops. This feature prevents a router from advertising a route back onto the interface from which it was learned.
Consider the following network topology:
Router R1 has a route to the subnet 10.0.1.0/24 that is advertised to router R2 by using RIP. Router R2 receives the update and stores the route in its routing table. Router R2 knows that the routing update for that route has come from R1, so it won’t advertise the route back to router R1. Otherwise, if the network 10.0.1.0/24 goes down, router R1 could receive a route to the subnet 10.0.1.0/24 from R2. Router R1 would think that R2 has the route to reach the subnet, and would send packets destined for the 10.0.1.0/24 to R2. R2 would receive the packets from R1 and sends them back to R1, because R2 thinks that R1 has a route to reach the subnet, thereby creating a routing loop.
Route Poisoning
Route poisoning is another method for preventing routing loops employed by distance vector routing protocols. When a router detects that one of its directly connected routes has failed, it sends the advertisement for that route with an infinite metric (poisoning the route). A router that receives the update knows that the route has failed and doesn’t use it anymore.
Consider the following example:
Router R1 is directly connected to the 10.0.1.0/24 subnet. Router R1 runs RIP and the subnet is advertised to R2. When the R1’s Fa0/1 interface fails, the route advertisement is sent by R1 to R2 indicating that the route has failed. The route has a metric of 16, which is more than the RIP’s maximum hop count of 15, so R1 considers the route to be unreachable.
Hold-down timer
Holddown is another loop-prevention mechanism employed by a distance vector routing protocol. This feature prevents a router from learning new information about a failed route. When a router receives the information about the unreachable route, the hold-down timer is started. The router ignores all routing updates for that route until the timer expires (by default, 180 seconds in RIP). Only updates allowed during that period are updates sent from the router that originally advertised the route. If that router advertises the update, the hold-down timer is stopped and the routing information is processed.
An example will help you understand the concept better. Consider the following network topology.
Router R1 has advertised its directly connected subnet 10.0.1.0/24 through RIP. After some period of time, the interface Fa0/1 on R1 fails and the router R1 sends the poisoned route to R2. R2 receives the routing update, marks the route as unreachable, and starts the hold-down timer. During that time all updates from any other routers about that route are ignored to prevent routing loops. If interface Fa0/1 on R1 comes back up, R1 again advertises the route. R2 process that updates even if the hold-down timer is still running, because the update is sent by the same router that originally advertised the route.
Advertise default routes using RIP
Consider the following example network:
In the network above we have three routers running RIP. Router R3 is connected to the ISP’s internet router and has a static default route that points to it. It is possible to advertise that default route using RIP to other routers in the local network. On R3, we simply need to enter the default-information originate command in the RIP configuration mode.
Here is the configuration on R3:
R3(config)#ip route 0.0.0.0 0.0.0.0 50.50.50.1 R3(config)#router rip R3(config-router)#default-information originate
R1 and R2 don’t need any additional configuration – they learn the default route just like any other RIP route:
R1#show ip route rip R* 0.0.0.0/0 [120/1] via 10.0.0.1, 00:00:04, GigabitEthernet0/0
As you can see from the output above, R1 learned about the default route via RIP. The route is marked with an asterisk (*), indicating that the route is a candidate to be the default route.