Rip-Protocol-Configuration-Guide-With-Examples COMPLILED
Rip-Protocol-Configuration-Guide-With-Examples COMPLILED
RIP is the simplest and one of the oldest Distance Vector routing protocol. It is very easy to
setup and troubleshoot. In this tutorial we will explain how to configure RIP Routing protocol
with example. For demonstration we will use packet tracer network simulator software. You
can use real Cisco devices or any other network simulator software for following this guide.
Create a topology as illustrate in following figure or download pre-created topology from our
server.
We need to configure IP address and other parameters on interfaces before we could actually
use them for routing. Interface mode is used to assign IP address and other parameters.
Interface mode can be accessed from global configuration mode. Following commands are
used to access the global configuration mode.
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#
From global configuration mode we can enter in interface mode. From there we can configure
the interface. Following commands will assign IP address on FastEthernet0/0.
Serial interface needs two additional parameters clock rate and bandwidth. Every serial cable
has two ends DTE and DCE. These parameters are always configured at DCE end.
We can use show controllers interface command from privilege mode to check the cables end.
Fourth line of output confirms that DCE end of serial cable is attached. If you see DTE here
instead of DCE skip these parameters.
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface serial 0/0/0
Router(config-if)#ip address 192.168.1.249 255.255.255.252
Router(config-if)#clock rate 64000
Router(config-if)#bandwidth 64
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface serial 0/0/1
Router(config-if)#ip address 192.168.1.254 255.255.255.252
Router(config-if)#clock rate 64000
Router(config-if)#bandwidth 64
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#
Router1
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface serial 0/0/0
Router(config-if)#ip address 192.168.1.250 255.255.255.252
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface serial 0/0/1
Router(config-if)#ip address 192.168.1.246 255.255.255.252
Router(config-if)#clock rate 64000
Router(config-if)#bandwidth 64
Router(config-if)#no shutdown
Router(config-if)#exit
Router2
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface fastEthernet 0/0
Router(config-if)#ip address 20.0.0.1 255.0.0.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface serial 0/0/0
Router(config-if)#ip address 192.168.1.245 255.255.255.252
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface serial 0/0/1
Router(config-if)#ip address 192.168.1.253 255.255.255.252
Router(config-if)#no shutdown
Router(config-if)#exit
Great job we have finished our half journey. Now routers have information about the networks
that they have on their own interfaces. Routers will not exchange this information between
them on their own. We need to implement RIP routing protocol that will insist them to share
this information.
Configuration of RIP protocol is much easier than you think. It requires only two steps to
configure the RIP routing.
Enable RIP routing protocol from global configuration mode.
Tell RIP routing protocol which networks you want to advertise.
Router0
Router0(config)#router rip
Router0(config-router)# network 10.0.0.0
Router0(config-router)# network 192.168.1.252
Router0(config-router)# network 192.168.1.248
router rip command tell router to enable the RIP routing protocol.
network command allows us to specify the networks which we want to advertise. We only
need to specify the networks which are directly connected with the router.
Thats all we need to configure the RIP. Follow same steps on remaining routers.
Router1
Router1(config)#router rip
Router1(config-router)# network 192.168.1.244
Router1(config-router)# network 192.168.1.248
Router2
Router2(config)#router rip
Router2(config-router)# network 20.0.0.0
Router2(config-router)# network 192.168.1.252
Router2(config-router)# network 192.168.1.244
Thats it. Our network is ready to take the advantage of RIP routing. To verify the setup we will
use ping command. ping command is used to test the connectivity between two devices.
Access the command prompt of PC1 and use ping command to test the connectivity from PC0.
Good going we have successfully implemented RIP routing in our network. For cross check we
have uploaded a configured topology on our server. You can use that if not getting same output.
RIP protocol automatically manage all routes for us. If one route goes down, it automatically
switches to another available. To explain this process more clearly we have added one more
route in our network.
Route 1
Route 2
Now suppose route1 is down. We can simulate this situation by removing the cable attached
between Router0 [s0/0/1] and Router2 [s0/0/1].
Okay our primary route went down. What will be happen now?
So far we are running RIP routing protocol and have another route to destination, there is no
need to worry. RIP will automatically reroute the traffic. Use tracert command again to see
the magic of dynamic routing.
Thats all for this article. In next article we will explain another routing protocol with
examples.
RIP Routing protocol configuration commands summary
Command Description
Routers keep only one route information for one destination in routing table. Routers use AD
value and metric to select the route.
Administrative Distance
In a complex network, you may have multiple routing protocols running simultaneously.
Different routing protocols use different metrics to calculate the best path for destination. In
this situation router may receive different routes information for a single destination network.
Routers use AD value to select the best path among these routes. Lower ad value has more
trustworthiness.
Lets understand it with a simple example; a router learns two different paths for 20.0.0.0/8
network from RIP and OSPF. Which one should it select?
Answer of this question is hidden in above table. Check the AD value of both protocols.
Administrative distance is the believability of routing protocols. Routers measure each route
source on a scale of 0 to 255. 0 is the best route and 255 is the worst route. Router will never
use the route learned by this (255) source. In our question we have two protocols RIP and
OSPF. OSPF has lower AD value than RIP. So its route will be chosen for routing table.
Routing Metrics
We may have multiple links to the destination network. In this situation router may learn
multiple routes form same routing protocol. For example in following network we have two
routes between PC0 and PC1.
Route 1
Route 2
In this situation Router uses metric to select the best path. Metric is a measurement which is
used to select the best path from multiple paths learned by a routing protocol. RIP use hop
count as metric to determine the best path. Hops are the number of layer3 devices which a
packet crossed before reaching at destination.
RIP is a distance vector routing protocol. It uses distance [accumulated metric value] and
direction [vector] to find and select the best path for destination network. We have explained
this process with example in our first part of this article.
Okay now understand the concept of metric; tell me which route will Router0 use to reach at
20.0.0.0/8 network?
Routing by Rumor
Sometimes RIP is also known as routing by rumor protocol. Because it learns routing
information from directly connected neighbors and assume that these neighbors might have
learned from their neighbors.
Advertising Updates
RIP periodically broadcast routing information from all of its ports. It uses local broadcast with
destination IP of 255.255.255.255. While broadcasting it doesnt care who listen these broadcast
or not. It doesnt use any mechanism to verify the listener. RIP assumes that if any neighbor
missed any update, it will learn from next update or from any other neighbors.
Passive interface
By default RIP broadcasts are sent from all interfaces. RIP allows us to control this behavior.
We can configure which interface should send RIP broadcast or which not. Once we mark any
interface as passive interface, RIP will stop sending updates from that interface.
Split Horizon
Split horizon is a mechanism that states if a router receives an update for a route on any
interface, it will not propagate the same route information back to the sender router on same
port. Split horizon is used to avoid routing loops.
To understand this function more clearly lets take an example. Following network is using
RIP protocol. R1 is advertising 10.0.0.0/8. R2 is receiving this information on S0/0 port.
Once R2 learnt about 10.0.0.0/8 network it will include it in its next routing update. Without
split horizon it will advertise this route information back to R1 on S0/0 port.
Well R1 will not place this route in routing table because it has higher distance. But at the same
it will not ignore this update. It will assume that R1 know a separate route to reach at 10.0.0.0/8
network, but that route has higher distance than the route I know. So I will not use that route
to reach at 10.0.0.0/8 so far my route is working. But I can use that route if my route goes
down. So it could work as a backup route for me.
This assumption creates a serious network issue. For example what happen if R1s F0/0
interface goes down? R1 has a direct link for 10.0.0.0/8 so it will immediately learn about this
change.
In this situation if R1 receives a packet for 10.0.0.0/8, instead of dropping that packet, it will
forward it from S0/0 to R2. Because R1 thinks R2 has an alternative route to reach at 10.0.0.0/8.
R2 will return this packet back to R1. Because R2 think R1 has a route to reach at 10.0.0.0/8.
This will create a network loop where actual route is down but R1 is thinking that R2 has a
route for destination while R2 is thinking that R1 has a way to reach the destination. Thus this
packet will be circle around between R1 and R2 endlessly. To prevent this issue RIP uses hop
(router) count mechanism.
Hop count
RIP counts every hop (router) which a packet crossed to reach the destination. It limits the
number of hop to 15. RIP uses TTL filed of packet to trace the number of hops. For each passing
hop RIP decrement the TTL value by 1. If this value reaches to 0, packet will be dropped.
This solution only prevents a packet from trapping into the loop. It does not solve routing loop
problem.
Split horizon solves this problem. If split horizon is enabled, learner router will never
broadcast the same route information back to the sender. In our network R2 learned 10.0.0.0/8
network information from R1 on S0/0, so it will never broadcast network 10.0.0.0/8
information back to R1 on S0/0.
This solves our problem. If R1s F0/0 interface is down, both R1 and R2 would realize that
there is no alternative route to reach at the 10.0.0.0/8 network.
To avoid network loops RIP deploy two more functions route poison and hold down timers.
Route poisoning
Route poisoning works in inverse mode of split horizon. When a router notices that any one
of its directly connected route has failed, it will poison that route. By default a packet can travel
only 15 hops in RIP. Any route beyond the 15 hops is invalid route for RIP. In a route failure
condition, RIP assign a value higher than 15 to that specific route. This procedure is known as
route poisoning. Poisoned route will be broadcast from all active interfaces. Receiving
neighbor will ignore the split horizon rule by broadcasting the same poisoned route back to
the sender. This process insure that every router update about a poisoned route.
RIP Timers
For better network optimization RIP uses four types of timers.
RIP use hold down timer to give the routers enough time for propagating the poisoned route
information in network. When router receives a poisoned route, it freezes that route in its
routing table for a period of hold timer. During this period router will not use this route for
routing. Holddown period will be aborted only if router receives an update with same or
better information for route. Default hold timer value is 180 seconds.
This timer is used to keep the track of discovered routes. If router does not receive an update
for a route in 180 seconds it will mark that route as invalid route and broadcast an update to
all neighbors letting them know that route is invalid.
This timer is used to set an interval for a route that becomes invalid and its removal from
routing table. Before removing an invalid route from routing table, it must update the
neighboring routers about the invalid route. This timer gives enough time to updates the
neighbors before invalid route is removed from routing table. Default route flush timer is set
to 240 seconds.
Update Timer
RIP broadcast routing updates in every 30 seconds. It will do this continuously, whether
something is changed in routing information or not. Once 30 seconds are expired router
running RIP will broadcast its routing information from all of its interfaces.
RIP is the oldest distance vector protocol. To meet the current network requirement it has been
updated with RIPv2. RIPv2 is also a distance vector protocol with maximum 15 hop counts.
You can still use RIPv1 but it is not advisable. Following table lists key difference between
RIPv1 and RIPv2.
RIPv1 RIPv2
It uses broadcast for routing update. It use multicast for routing update.
It sends broadcast on 255.255.255.255 It sends multicast on 224.0.0.9 destination.
destination.
It does not support VLSM. It supports VLSM.
It does not support any authentication. It supports MD5 authentication
It only supports classful routing. It supports both classful and classless
routing.
It does not support discontiguous network. It supports discontiguous network.
Routers aware only about the networks those are directly connected with them. For example
in following network R1 only aware about the 10.0.0.0/8 and 192.168.1.252/30 network.
So if it receives a packet for 20.0.0.0/8 from 10.0.0.0/8 network on F0/1 port, it will drop that
packet. This is the default behavior of router. By default routers are configured to drop all
unmatched packets.
Router can learn about the remote network in two ways; static and dynamic.
In static method we have to update router manually. In dynamic method router will be
updated by a routing protocol.
In dynamic method this process is done by a routing protocol. Several routing protocols are
available to choose from such RIP, OSPF, IGRP and EIGRP. In this tutorial we will explain RIP
routing protocol.
In RIP protocol routers learn about the destination networks from neighboring routers through
the sharing process. Routers running RIP protocol periodically broadcast the configured
networks from all ports. Listing routers will update their routing table based on this
information.
Lets see how this process works step by step. Following figure illustrate a simple network
running RIP routing protocol.
When we start this network, Routers are aware only about the directly connected network.
R1 knows that network 10.0.0.0/8 is connected on F0/1 port and network 192.168.1.252/30 is
connected on S0/0 port.
Sometime RIP is also known as routing by rumor. Because in this routing protocol routers learn
routing information from directly connected neighbors, and these neighbors learn from other
neighboring routers.
RIP Protocol will share configured routes in network through the broadcasts. These broadcasts
are known as routing updates. Listening routers will update their routing table based on these
updates.
R1 will listen broadcast from R2. From R2 it will learn one new network 192.168.1.248/30.
R2 will listen two broadcasts from R1 and R3. From R1 it will learn about 10.0.0.o/8 and from
R3 it will learn about 20.0.0.0/8 network.
R3 will listen broadcast from R2. From R2 it will learn about the network 192.168.1.252/30.
Router takes several measurements while processing and putting new route information in
routing table. We will explain them later in this article. If router discovers new route in update,
it will put that in routing table.
After 30 seconds (default time interval between two routing updates) all routers will again
broadcast their routing tables with updated information.
This time:-
Convergence
Convergence is a term that refers to the time taken by all routers in understanding the current
topology of network.
We may have two or more paths for the destination network. In this situation RIP uses a
measurement called metric to determine the best path for destination network. RIP uses hops
count as metric. Hops are the number of routers it takes to reach the destination network.
For example in above network R1 has two routes to reach the 20.0.0.0/8 network.
Route 1:- via R3 [on interface S0/1]. With hop count one.
Route 2:- via R2 R3 [on interface S0/0]. With hop count two.
Summary
Before sending routing updates router add a initiating metric to every routes which it
has and increments the metric of incoming routes in advertisements so the listing router
can learn how far destination network is.
While sending broadcasts RIP does not care about who listens these broadcast updates
or not.
After sending broadcast RIP does not care whether neighbors received these broadcast
updates or not.
When router receives routing updates, it compares them with the routes which it
already has in its routing table.
If update has information about a route which is not available in its routing table, router
will consider that route as a new route.
Router will add all new routes in routing table before updating existing one.
If update has better information for any existing route, router will replace old entry
with new route.
If update has worse information for any existing route, router will ignore it.
If update has exactly same information about any existing route, router will reset the
timer for that entry in routing table.
Thats all for this part. In next part we will explore fundamental topics of RIP routing protocol
such as RIP timer, RIP metric, Split horizon rule and route poisoning.