Home > RIP Tutorial

RIP Tutorial

February 3rd, 2011 Go to comments

In this tutorial we will learn about RIP routing protocol

Routing Information Protocol (RIP) is a distance-vector routing protocol. RIP sends the complete routing table out to all active interfaces every 30 seconds. RIP only uses hop count (the number of routers) to determine the best way to a remote network.

Note: RIP v1 is a classful routing protocol but RIP v2 is a classless routing protocol.

Classful routing protocols do not include the subnet mask with the network address in routing updates, which can cause problems with discontiguous subnets or networks that use Variable-Length Subnet Masking (VLSM). Fortunately, RIPv2 is a classless routing protocol so subnet masks are included in the routing updates, making RIPv2 more compatible with modern routing environments.

Distance vector protocols advertise routing information by sending messages, called routing updates, out the interfaces on a router

RIP Operation

A big problem with distance vector routing protocol is routing loop. Let’s take a look at how a routing loop occurs.

Here we have routers A, B and C. Notice that at the beginning (when a routing protocol is not turned on) there are only directly connected networks in the routing tables of these routers. For example, in the routing table of router A, network 1.0.0.0 has already been known because it is directly connected through interface E0 and the metric (of a directly connected network) is 0 (these 3 parameters are shown in the routing tables below).

RIP_Distance_Vector_Protocol_Initial.jpg

Also B knows networks 2.0.0.0 & 3.0.0.0 with a metric of 0.
Also C knows networks 3.0.0.0 & 4.0.0.0 with a metric of 0.

Now we turn on RIP on these routers (we will discuss the configuration later. In the rest of this article, we will call network 1.0.0.0 network 1, 2.0.0.0 network 2 and so on).

RIP sends update every 30 seconds so after 30 sec goes by, A sends a copy of its routing table to B, B already knew about network 2 but now B learns about network 1 as well. Notice the metric we have here for directly connected networks, since we’re using RIP, we’re using a metric of hop count. Remember a hop count (or a hop) is how many routers that these packets will have to go through to reach the destination. For example, from router A to network 1 & 2 (which are directly connected) it goes to 0 hop, router B has now learned about network 1 from A via E0 interface so the metric now will be 1 hop.

RIP_Distance_Vector_Protocol_First_Update.jpg

Each router receives a routing table from its direct neighbor. For example, Router B receives information from Router A about network 1 and 2. It then adds a distance vector metric (such as the number of hops), increasing the distance vector of these routes by 1.

B also exchanges its routing table with A about network 2 and 3.

RIP_Distance_Vector_Protocol_Second_Update.jpg

B then passes the routing table to its other neighbor, Router C.

RIP_Distance_Vector_Protocol_Third_Update.jpg

C also sends its update to B and B sends it to A.

RIP_Distance_Vector_Protocol_Four_Update.jpg

Now the network is converged.

Now let’s assume network 4 down suddenly.

RIP_Distance_Vector_Protocol_Network_Down.jpg

When network 4 fails, Router C detects the failure and stops routing packets out its E1 interface. However, Routers A and B have not yet received notification of the failure. Router A still believes it can access 4.0.0.0 through Router B. The routing table of Router A still refects a path to network 10.4.0.0 with a distance of 2 and router B has a path with a distance of 1.

There will be no problem if C sends an update earlier than B and inform that network is currently down but if B sends its update first, C will see B has a path to network 4 with a metric of 1 so it updates its routing table, thinking that “if B can go to network 4 by 1 hop than I can go to network 4 by 2 hops” but of course this is totally wrong.

RIP_Distance_Vector_Protocol_Network_Down_2.jpg

The problem does not stop here. In turn, C sends an update to B and informs it can access network 4 by 2 hops. B learns this and think “if C can access network 4 by 2 hops than I can access by 3 hops”.

RIP_Distance_Vector_Protocol_Network_Down_3.jpg

This same process occurs when B continually sends its update to C and the metric will increase to infinity so this phenomenon is called “counting to infinity”.

Below lists some methods to prevent this phenomenon:

SPLIT HORIZON:
A router never sends information about a route back in same direction which is original information came, routers keep track of where the information about a route came from. Means when router A sends update to router B about any failure network, router B does not send any update for same network to router A in same direction.

ROUTE POISONING:
Router consider route advertised with an infinitive metric to have failed ( metric=16) instead of marking it down. For example, when network 4 goes down, router C starts route poisoning by advertising the metric (hop count) of this network as 16, which indicates an unreachable network. When router B receives this advertising, it continue advertising this network with a metric of 16.

POISON REVERSE:

The poison reverse rule overwrites split horizon rule. For example, if router B receives a route poisoning of network 4 from router C then router B will send an update back to router C (which breaks the split horizon rule) with the same poisoned hop count of 16. This ensures all the routers in the domain receive the poisoned route update.

Notice that every router performs poison reverse when learning about a downed network. In the above example, router A also performs poison reverse when learning about the downed network from B.

HOLD DOWN TIMERS:

After hearing a route poisoning, router starts a hold-down timer for that route. If it gets an update with a better metric than the originally recorded metric within the hold-down timer period, the hold-down timer is removed and data can be sent to that network. Also within the hold-down timer, if an update is received from a different router than the one who performed route poisoning with an equal or poorer metric, that update is ignored. During the hold-down timer, the “downed” route appears as “possibly down” in the routing table.

For example, in the above example, when B receives a route poisoning update from C, it marks network 4 as “possibly down” in its routing table and starts the hold-down timer for network 4. In this period if it receives an update from C informing that the network 4 is recovered then B will accept that information, remove the hold-down timer and allow data to go to that network. But if B receives an update from A informing that it can reach network by 1 (or more) hop, that update will be ignored and the hold-down timer keeps counting.

Note: The default hold-down timer value = 180 second.

TRIGGERED UPDATE :
When any route failed in network ,do not wait for the next periodic update instead send an immediate update listing the poison route.

COUNTING TO INFINITY:
Maximum count 15 hops after it will not be reachable.

RIP Timers

RIP uses several timers to regulate its operation. These timers are described below:

Update timer: how often the router sends update. Default update timer is 30 seconds
Invalid timer (also called Expire timer): how much time must expire before a route becomes invalid since seeing a valid update; and place the route into holddown. Default invalid timer is 180 seconds
Holddown timer: if RIP receives an update with a hop count higher (poorer) than the hop count recording in the routing table, RIP does not “believe in” that update. Default holddown timer is 180 seconds
Flush timer: how much time since the last valid update, until RIP deletes that route in its routing table. Default Flush timer is 240 seconds

RIP_timer.jpg

Configuring RIP

Router(config)#router rip Enter router RIP configuration mode
Router(config-router)#network <address> Identify networks that will participate in the router protocol. Notice that you identify networks, and not interfaces.

NOTE: You need to advertise only the classful network number, not a subnet:
Router(config-router)#network 172.16.0.0
not
Router(config-router)#network 172.16.10.0

If you advertise a subnet, you will not receive an error message, because the router will automatically convert the subnet to the classful network address.

To learn more about configuring RIP, please read my Configuring RIP GNS3 Lab tutorial

Key points:

+ RIP uses hop counts to calculate optimal routes (a hop is a router).
+ RIP routing is limited to 15 hops to any location (16 hops indicates the network is unreachable).
+ RIP uses the split horizon with poison reverse method to prevent the count-to-infinity problem.
+ RIP uses only classful routing, so it uses full address classes, not subnets.
+ RIP broadcasts updates to the entire network.
+ RIP can maintain up to six multiple paths to each network, but only if the cost is the same.
+ RIP supports load balancing over same-cost paths.
+ The update interval default is 30, the invalid timer default is 180, the holddown timer default is 180, and the flush timer default is 240.

Comments (42) Comments
Comment pages
1 2 3 443
  1. Anonymous
    March 16th, 2015

    samaj me nhi aa raha

  2. ramesh
    March 16th, 2015

    what is this……

  3. amit
    April 12th, 2015

    great job…very much simplified explaination and a lot of helpful stuff about RIP. THANKS ! :-)

  4. Anonymous
    May 18th, 2015

    It is a great explanation

  5. satish
    May 21st, 2015

    easy to understand thanks alot

  6. gurusekhar
    June 6th, 2015

    some points missed like rip administrative distance.

  7. Anonymous
    August 25th, 2015

    ffffff

  8. michael
    August 25th, 2015

    I sat to my CCNA exams in 13th May 2015 but up to now I have not receive my certificate, can some one direct me how I can apply for It..

  9. Anonymous
    September 16th, 2015

    Thanx alottttty

  10. Anonymous
    October 11th, 2015

    well explained .. thanks

  11. adam
    October 14th, 2015

    wish more routing table exemple

  12. adam
    October 14th, 2015

    anyone knows free dumps labs for practice thanks

  13. Hussnain Toufiq
    December 19th, 2015

    Very good Tutorial, Kindly provide me VCE Simulator and VCE Dumps

  14. anon
    January 19th, 2016

    Hello!
    I’ll be taking the exam 200-120 this week (jan 21, 2016) Please mail me latest dump to {email not allowed}

    Thanks in advance.

  15. Anonymous
    February 1st, 2016

    really good explanation

  16. Larry
    February 9th, 2016

    Please email me the latest dump…I am planning to take the exam by Feb 26

  17. Anonymous
    February 26th, 2016

    configuration of rip in a network

  18. hi
    March 9th, 2016

    tupak danemeja

  19. Rou
    March 30th, 2016

    Thank u ^___^

  20. Anonymous
    April 29th, 2016

    Good explanation ,thanks alot

  21. mujtuba
    April 29th, 2016

    Well explained thanks alot

  22. Anonymous
    May 8th, 2016

    Can anyone answer me a private question?

  23. Preet
    May 16th, 2016

    Please send me latest dump to {email not allowed}

  24. Anonymous
    May 29th, 2016

    Hello, could you tell me why Router B update its route from “4.0.0.0 E1 1” to “4.0.0.0 E1 3” on the last diagram?
    Obviously, the hop count of “4.0.0.0 E1 1” (1 hop count) is lower than “4.0.0.0 E1 3” (3 hop count)! Thanks !

  25. Anonymous
    June 5th, 2016

    I found many websites use this example to explain Distance Vector Routing Loop but they make me doubtful. Obviously, the hop count of Router B (1 hop count) is lower than Router C (2 hop count) on the third diagram! Why Router B accepts the route entry from Router C and updates its route from “4.0.0.0 E1 1” to “4.0.0.0 E1 3” on the last diagram? Thanks!

  26. YY
    July 2nd, 2016

    BEST TUT

  27. Anonymous
    July 13th, 2016

    Very nice simple excplation. …..

  28. shiru
    July 17th, 2016

    thanks a lot…….explained well

  29. Anonymous
    July 25th, 2016

    Hi this is abhi I did not understand properly what exactly happening in that and real time envirement.

  30. Anonymous
    August 16th, 2016

    nice job

  31. sowmy
    September 21st, 2016

    Nice explanation. Easy to understand. Thanks

  32. Nandha
    November 28th, 2016

    Thanks , RIP Well Explained !!

  33. Amir Ahmed
    December 10th, 2016

    hi dear nice explanation… RIP send updates on which ip address…… eg broadcast update,mean on 255.255.255.255

  34. md
    January 4th, 2017

    gud expain but some parts are missing like ad value versions of rip v1 & v2….

  35. Anonymous
    January 15th, 2017

    Good explaination…

  36. Anonymous
    January 25th, 2017

    thanx for the help…..am gonna pass my theory paper tomorow

  37. agaba dunok
    January 25th, 2017

    thanx am gona pass my thoery exam tomorow

  38. Isha
    February 18th, 2017

    Very Nice explanation…. Easy to understand..Thanx a lot

  39. Yas
    April 2nd, 2017

    This is a great explanation for an non-tech person like me. easy to follow – thanks so much

  40. can’t display
    April 10th, 2017

    Rip_timer.png can’t be displayed!!!!!!!!!!!!!!!!!!!!!

  41. Joe
    May 20th, 2017
  42. 9tut
    May 20th, 2017

    @can’t display: Thanks for your detection. We have just fixed that image!

Comment pages
1 2 3 443