Distance Vector Routing: Count to Infinity and Routing Loops
Networks using distance-vector routing are susceptible to loops and issues with count to infinity. How does this problem develop? In the following illustration, everything is working fine on the network, and the network is converged.
Problems can happen with your routing protocol when a link or a router fails. In this figure, a failure happens on Router3 with interface fa0/0. When this link goes down, the route to 10.4.0.0/16 is no longer available; however, if you look at what follows, you can see the issue.
Router3 initially marks the route to 10.4.0.0 as a link down in its routing table.
Router2 sends out its routing table to each of its neighbors.
This includes Router3, telling them that it has a path to 10.4.0.0 with a hop count of 1.
Router3 then updates its routing table with this new information.
The new information states that the route to 10.4.0.0/16 is now 2 hops away, as shown in Figure 6-3.
Armed with the new information that 10.4.0.0/16 is available.
Albeit through another interface, Router3 sends out its routing table to its neighbors.
Router2 gets the update.
It then identifies that the router that previously said it knew about 10.4.0.0/16 has updated the route from a hop count of 0 to 2, so Router2 updates its own routing table. The old route may have been identified as an updated route, or it may have timed out of the routing table, depending on the routing protocol that is in use.
Router2 then passes its own routing information out through its other interface (S0/0) to propagate the change to Router1.
Router3 eventually receives the update from Router2.
This update tells Router2 that the hop count to 10.4.0.0/16 has been updated to 3, and this process now continues.
This process continues to infinity because no mechanism is in place, in this case, to stop the process from continuing.
However, the RIP routing protocol has a built-in safety mechanism, to a degree. RIP has a maximum hop count of 16, and when the route to a network exceeds the 16-hop rule, the RIP protocol marks that network as unreachable so that it does not further propagate the route. This scenario does not change the information found in the router’s routing table — it only limits how far the error is propagated.
When you send data to a host or device on the 10.4.0.0/16 network, it comes through the fa0/0 interface on Router1 and Router1 thinks that it can get to 10.4.0.0/16 within 4 hops by sending the data out through interface S0/0 based on Router1’s routing table. The following figure shows what happens when the data is sent.
As it arrives at Router3, Router3 determines that the route to 10.4.0.0/16 is back through Router2, which then causes the data to loop infinitely. There is a Time to Live (TTL) on IP packets, which defines the maximum amount of time which an IP packet can remain on a network. After spending some time looping, the data will be dropped from the network and a message sent back to the sender of the data.