RIP - Distance Vector
RIP - Distance Vector
The fact that RIP is based on open standards and is easy to implement makes it attractive to some network administrators. However, RIP lacks the power and features of more advanced routing protocols. Because of its simplicity, RIP is a good basic protocol for networking students. Features of RIP Distance Vector Routing Protocol Uses Hop Count as the Metric Hop count greater than 15 Packet is discarded Routing updates sent regularly, by default every 30 secs. Routing table updates occur periodically or when the topology in a distance vector protocol network changes. It is important for a routing protocol to update the routing tables efficiently. As with the network discovery process, topology change updates proceed systematically from router to router. Distance vector algorithms call for each router to send its entire routing table to each of its adjacent neighbours. The routing tables include information about the total path cost. The path cost is defined by the metrics and the logical address of the first router on the path to each network in the table. The major drawback of RIP is routing loops. Routing loops can occur when inconsistent routing tables are not updated due to slow convergence in a changing network or wrong information concerning failed routes being sent to neighbour routers. An example is as follows: 1. Just before the failure of Network 1, all routers have consistent knowledge and correct routing tables. The network is said to have converged. For Router C, the preferred path to Network 1 is by way of Router B, and the distance from Router C to Network 1 is 3. 2. When Network 1 fails, Router E sends an update to Router A. Router A stops routing packets to Network 1, but Routers B, C, and D continue to do so because they have not yet been informed of the failure. When Router A sends out its update, Routers B and D stop routing to Network 1. However, Router C has not received an update. For Router C, Network 1 can still be reached through Router B. 3. Now Router C sends a periodic update to Router D, which indicates a path to Network 1 by way of Router B. Router D changes its routing table to reflect this incorrect information, and sends the information to Router A. Router A sends the information to Routers B and E, and the process continues. Any packet destined for Network 1 will now loop from Router C to B to A to D and back to again to C.
Router D
Router E
Router C
Router A
Router B Network 1
The invalid updates of Network 1 will continue to loop until some other process stops the looping. This condition, which is called count to infinity or routing loop, loops packets around the network in spite of the fact that the destination network, which is Network 1, is down. While the routers count to infinity, the invalid information allows a routing loop to exist. Without countermeasures to stop the count to infinity process, the distance vector metric of hop count increases each time the packet passes through another router. These packets loop through the network because of incorrect information in the routing tables. Count to infinity (Time To Live) To avoid prolonged looping, distance vector protocols define infinity as a specific maximum number, which may simply be the maximum number of hop counts. With this approach, the routing protocol permits the routing loop to continue until the metric exceeds its maximum allowed value. In RIP this is set at 16. This exceeds the distance vector default maximum of 15 hops so the packet is discarded by the router. When the metric value exceeds the maximum value, the Network is considered unreachable. Split horizon Some routing loops occur when incorrect information that is sent back to a router contradicts the correct information that the router originally distributed. An example is as follows:
1. Router A passes an update to Router B and Router D, which indicates that Network 1 is down. However, Router C transmits an update to Router B, which indicates that Network 1 is available at a distance of 4, by way of Router D. This does not violate split horizon rules. 2. Router B concludes, incorrectly, that Router C still has a valid path to Network 1, although at a much less favorable metric. Router B sends an update to Router A, which informs Router A of the new route to Network 1. 3. Router A now determines that it can send to Network 1 by way of Router B. Router B determines that it can send to Network 1 by way of Router C. Router C determines that it can send to Network 1 by way of Router D. Any packet introduced into this environment will loop between routers. 4. Split horizon is used to avoid this situation. If a routing update about Network 1 arrives from Router A, Router B or Router D cannot send information about Network 1 back to Router A. Split horizon reduces incorrect routing information and routing overhead. Route poisoning Route poisoning is used by various distance vector protocols to overcome large routing loops and offer detailed information when a subnet or network is not accessible. To accomplish this, the hop count is usually set to one more than the maximum. One way to avoid inconsistent updates is route poisoning. When a Network goes down, the adjacent Router will set a distance of 16 for that Network to poison the route. This indicates that the network is unreachable. When the route is poisoned, Routers will not receive incorrect updates about the route to the Network that is down. After a Router receives a route poisoning from its neighbour Router , it sends an update, which is called a poison reverse, back to the Router. This makes sure all routers on the segment have received the poisoned route information. When route poisoning is used with triggered updates it will speed up convergence time because neighbouring routers do not have to wait 30 seconds before they advertise the poisoned route. Route poisoning causes a routing protocol to advertise infinite-metric routes for a failed route. Route poisoning does not break split horizon rules. Split horizon with poison reverse is route poisoning that is placed on links that split horizon would not normally allow routing information to flow across. In either case, the result is that failed routes are advertised with infinite metrics. RIP timers RIP uses numerous timers to regulate its performance. These include a routing-update timer, a route-timeout timer, and a route-flush timer. The routing-update timer clocks the interval between periodic routing updates. Generally, it is set to 30 seconds, with a small random amount of time added whenever the timer is reset. This is done to help prevent
congestion, which could result from all routers simultaneously attempting to update their neighbours. Each routing table entry has a route-timeout timer associated with it. When the route-timeout timer expires, the route is marked invalid but is retained in the table until the route-flush timer expires. Holddown timer
When a router receives an update from a neighbour, which indicates that a previously accessible network is now inaccessible, the router marks the route as inaccessible and starts a holddown timer. Before the holddown timer expires, if an update is received from the same neighbour, which indicates that the network is accessible, the router marks the network as accessible and removes the holddown timer. If an update arrives from a different neighbour router with a better metric for the network, the router marks the network as accessible and removes the holddown timer. If an update is received from a different router with a higher metric before the holddown timer expires, the update is ignored. This update is ignored to allow more time for the knowledge of a disruptive change to propagate through the entire network.
Triggered Updates
New routing tables are sent to neighbour routers on a regular basis, RIP updates occur every 30 seconds by default. However a triggered update is sent immediately in response to some change in the routing table. The router that detects a topology change immediately sends an update message to adjacent routers. These routers generate triggered updates to notify their adjacent neighbours of the change. When a route fails, an update is sent immediately. Triggered updates, used in conjunction with route poisoning, ensure that all routers know of failed routes before any holddown timers can expire. Triggered updates do not wait for update timers to expire. They are sent when routing information has changed. A router will immediately send a routing update on its other interfaces. This forwards the information about the route that has changed and starts the holddown timers sooner on the neighbour routers. The wave of updates propagates throughout the network.
RIP v2 RIP v2 is an improved version of RIP v1. It shares the following features with RIP v1:
It is a distance vector protocol that uses a hop count metric. It uses holddown timers to prevent routing loops default is 180 seconds.
It uses split horizon to prevent routing loops. It uses 16 hops as a metric for infinite distance.
RIP v2 provides prefix routing, which allows it to send out subnet mask information with the route update. Therefore, RIP v2 supports the use of classless routing in which different subnets within the same network can use different subnet masks, as in VLSM (Variable Length Subnet Masking). RIP v2 provides for authentication in its updates. A set of keys can be used on an interface as an authentication check. RIP v2 allows for a choice of the type of authentication to be used in RIP v2 packets. The choice can be either clear text or Message-Digest 5 (MD5) encryption. Clear text is the default. MD5 can be used to authenticate the source of a routing update. MD5 is typically used to encrypt enable secret passwords and it has no known reversal. RIP v2 multicasts routing updates using the Class D address 224.0.0.9, which provides for better efficiency. RIP configuration Before configuring RIP, assign IP addresses and masks to all interfaces that participate in routing. Set the clock rate where necessary on serial links. After the basic configurations are complete, configure RIP. The basic RIP2 configuration consists of three commands: Router(config)#router rip Enables the routing protocol Router(config)#version 2 Specifies the version Router(config-router)#network [network address] Identify each directly connected network that should be advertised by RIP Verification commands The show ip protocols and show ip route commands are important for verification and troubleshooting on any routing protocol. show ip rip database: Lists all the routes known by RIP debug ip rip or debug ip rip {events}: Displays RIP routing updates as sent and received in real time