Saturday, March 21, 2009

Understanding the Routing Information Protocol ( RIP)

• RIP is a dynamic routing protocol, Its a protocol that advertise the routes you arespecifying with the network command, and populate them to the routing tables of other routers in your network.

• RIP is a Distance-Vector protocol. It uses uses a single routing metric (hop count) to measure the distance between the source and a destination network.Every router between the source network and destination network is considered as 1 hop count.

• RIP uses AD (Administrative distance) of 120.

• RIP has 2 versions, RIPv1 and RIPv2.




** LABS included!


Comparing the advantages and disadvantages of RIP:

Advantages:
- RIP is very easy to implement, and is the prefered routing protocol across small LANs.
- The RIP process is simple, therefore it doesn't consume much of the router resources.

Disadvantages:
- RIPv1 is a classful routing protocol. therefore it doesn't send the subnet mask in its routing updates.
- RIPv1 and v2 has maximum hop count of 15. IT means that , if a packet has to go through more than 15 routers, it is NOT possible with RIP. because after 15 hops, the packet is discarded (16 hops specify the network is not reachable).
- RIP has very, very slow convergence time in network terms. (you will see how slow that is when compared to other routing protocols like EIGRP & OSPF
- RIP doesn't really have a mechanism to detect routing loops.

Issues with RIP
The main issue with RIP is routing loops.Which are averted using techniques like : Maximum hop count,Split-Horizon,Route-poisoning,Poison reverse and RIP timers.

Split-horizon

RIP prevents the routing-loops to occur by implementing the split-horizon rule. The idea is to prevent a router from advertising a route back out of the interface which it was learned from. If router B learns about a route from A ,it will forward this advertisement to C but not A.





Example:

CCNA-R1 advertise the route 100.0.0.0 to CCNA-R2 (marked by Blue arrows), R2 adds the new route entry to its routing table, and send an update to all its neighbors with the new change.



Now, when CCNA-R2 sends an update to CCNA-R1 (through int fa0/0), it will include all its RIP enabled networks and routes besides the routes that was learned on the interface fa0/0! That means, CCNA-R2 will advertise only the networks 101.0.0.0, 102.0.0.0 and 192.168.1.0, and without split-horizon rule it may send R1's 100.0.0.0 network back to it.

Route poisoning

In route poisoning, when CCNA-R1 detects the 100.0.0.0 as down ,it will add /16 as a metric and wait for its update timer to expire to send this information about a networking being down with (/16 as metric) to all its neighbour.This will help other routers see this network as unreachable and will avoid any router from sending a packet to this network which is down.

Poison reverse

It is the process of breaking the split-horizon rule to indicate to other routers that a route is no longer reachable and should be removed from their routing tables.When a route is detected as invalid ( through an advertisment from a neighbour router), the router starts to advertise the route to all routers (including the router it received the route information about the dead network from) with a metric of 16 (also called infinity metric) which means that route is not-reachable. Other routers in the network update their routing-table, and the invalid route appears as "possibly down".





This mechanism prevents from routers from updating each other with invalid route enteries.

The Timers of RIP:

This is a part most of us get confused. ok so we know what the update timer is for, but what about invalid and hold-down?and why do we need to wait an extra 60 secs (240 seconds total) before a route is flushed from the routing table?

Ok so, the timers work like this:

* Timers by default are: update 30, invalid 180, hold-down 180, flushed 240.

* when an update packet is received, the route timer is being reset. RIP counters are presenting the time that the last update packet has been received, so the timers are increasing and not decreasing.

* so when you see the counter go above 30 - that means something goes wrong. When everything goes well, you should not see the RIP counter go above 29, because it suppose to receive an update every 30 seconds,if it doesn't, the counter keeps increasing til it gets to 180 seconds (the invalid timer). then, the router decides that something is wrong here, and mark the route as invalid. The status of the route is changed to "possibly down",and the router starts to advertise that route with a metric of 16 (infinity), thats how the router informs its neighbors that the link is invalid.

The route is retained in the table for a period of time (60 secs by default) and not flushed immedietly, so that the neighbors can be notified about the route being dropped.

Last, there is the flush-timer. the flush timer is how long it takes til the route is completely dropped from the routing table - the next step after the "possibly down" status. If it takes 180 seconds for a route to become invalid, it will take 60 seconds more for the route to be completely dropped from the table.

So again, as long as your counter is under 30, everything works fine. If the counter goes above 30, there is a problem.. if it gets to 180, it gets invalid (appears in the routing table as possibly-down). and after 240 seconds, only the route is completely flushed from the routing table.

The differences between RIPv1 and RIPv2:

- v1 doesn't support VLSM / CIDR .. v2 supports both
- v1 doesn't support authentication .. v2 has an authentication option
- v1 broadcast its routing updates .. v2 multicast them to 224.0.0.9

** Get the LABs for practice - RIP Labs

** Practice questions available! - CCNA-QAn1