07/07/2015
RIP Timers
“RIP” this is the first interior gateway protocol that we learn when we start studying routing. RIP is easily configurable with very less configuration. In simple words it’s a distance vector routing protocol, uses hop count as metric (Bellman Ford algorithm) with maximum hop count 15 & 16 considered as unreachable, broadcasts full routing table every 30 seconds, no partial update, no trigger update, takes very long to converge & it uses four timers “Hello (30), Invalid (180), hold down (180) & Flus (240/420)”
Yes RIP is very simple & easily understandable, but how many of really understand RIP timers....??
I have seen many of my mates who kept on googling & searching books to find how exactly the timers works & they are still confused. They couldn't found the clear cut information about RIP timers.
So I am trying to put some light on how RIP convergence works or how timers come into the picture.
Let’s take an example of two routers, where RIP is running between R1 & R2. Network 10.0.0.0 is directly connected to R1, R1 sent update about network 10.0.0.0 to R2.
10.0.0.0 --------------> R1 R2
HELLO TIMER: - R1 sends periodic update (information about network 10.0.0.0) to R2 after every 30 seconds. These periodic updates are also called as hello packets that work like a keep alive between two routers. So the time period between two consecutive updates is called as hello timer
INVALID TIMER: - Suppose due to some reason R2 stops receiving hellos from R1. R2 will not consider R1 down until it misses 6 consecutive hellos (that is 180 seconds from the time when last hello was received) from R1. After 180 seconds it considers all the routes learned via R1 as invalid & mark them unreachable by changing their metric to 16 hops. So this is Invalid state for that particular route. And the timer from 0(when last hello received) to 180 seconds is the Invalid timer.
HOLD DOWN TIMER: - After completing the Invalid timer the route to network 10.0.0.0 on R2 enters to hold down timer where it remains for another 180 seconds that is from Invalid timer which is 180 to 360 seconds. In hold down state it will not accept the route information about the invalid route from any other neighbor. This timer or state is cisco proprietary & is a part of loop prevention mechanism.
FLUSH TIMER: - After completing the hold down timer it enters into the Flush timer which is 60 second post hold down timer expiration that is 420 seconds since the last hello was received. After completing 420 seconds the route is removed from the routing table.
When we talk about a non cisco device, there we don’t have a hold down timer so after Invalid timer it directly enters to flush timer. Hence in that case the flush timer ends in 240 seconds since last hello received.
Let’s add something more to our concept:-
When talking about Router connection we always have two types of scenarios “one where two routers are directly connected using a network cable & other where there is a layer 2 switch between them”.
Here we have three routers R1, R2 & R3. R1 & R2 are connected through a L2 switch SW. R2 is directly connected to R3 through a network cable. Network 10.0.0.0 is directly connected to R1 & network 30.0.0.0 is directly connected to R3. R2 learn about network 10.0.0.0 from R1 & R3 learn about 10.0.0.0 from R2. Similar way R2 learn about network 30.0.0.0 from R3 & sends the information about network 30.0.0.0 to R1 though periodic update
10.0.0.0 --- (R1) ------|SW|----- (R2) ------------- (R3) -----30.0.0.0
Case 1:-
Suppose link between R1 & SW gets disconnected. Hence R2 stops receiving hellos from. R2 waits for 180 seconds (invalid timer) & After 180 seconds it considers routes learned via R1 as invalid (which is network 10.0.0.0 here) & mark them unreachable by changing their metric to 16 hops and enters into Hold down state (timer). In hold down it waits for another 180 seconds. After completing hold down timer it starts flush timer & remains there for next 60 seconds. After completing flush timer it removes route from its routing table.
00----Invalid----->180------Hold down----->360----Flush---->420
Case 2: -
Suppose the cable between R2 & R3 goes down, due to which the physical interface or R2 immediate change state to down. So it will not wait for the invalid timer but it immediately change the route to network 30.0.0.0 as invalid & mark it unreachable by changing the hop count as 16. & it will send a trigger update to R1 also that the network 30.0.0.0 is invalid now. Hence here in this case it will bypass the invalid timer & directly enters to Hold down. R2 & R3 remains in hold down state for 180 seconds & then start the flush timer for next 60 seconds & finally flush the route to network 30.0.0.0 from their routing table in 240 seconds.
(Start as invalid route) 00-----Hold down---->180---Flush--->240
# So we have finally concluded that RIP also have a trigger update function, it triggers invalid route updates for directly connected link failures.