This tutorial explains basic concept of RIP protocol including the process it uses to share routing information with others in detail with examples.
RIP is a routing protocol which exchanges network information between routers dynamically. It uses broadcast to share routing information.
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 188.8.131.52/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.
We have already explained static method in our pervious articles. You can read them here.
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.
This tutorial is first part of our article "RIP Routing protocol explained with example". You can read other parts of this article here.
This is the second part of this article. In this part we will explain fundamental topics of RIP routing like Routing metric, Split horizon, hop counts, Route poison, RIP timer and difference between RIPv1 and RIPv2.
This is the last part of this article. In this part we will explain RIP configuration commands with a practical example in cisco packet tracer. At the end of this article we will present a summary of configuration commands.
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.
Let’s see how RIP 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.
R2 knows that network 192.168.1.252/30 is connected on S0/0 port and network 192.168.1.248/30 is connected on S0/1 port.
R3 Knows that network 184.108.40.206/8 is connected on F0/1 and network 192.168.1.248/30 is connected S0/0 port.
Unlike static routing where we have to configure all routes manually, in dynamic routing all we need to do is just tell the routing protocol which route we want to advertise. And rest will be done automatically by running dynamic protocol. In our network we are running RIP routing protocol so it will be handled by RIP.
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.
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 220.127.116.11/8 network.
R3 will listen broadcast from R2. From R2 it will learn about the network 192.168.1.252.
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.
- R1 will broadcast for 10.0.0.0/8, 192.168.1.248/30 and 192.168.1.252/30.
- R2 will broadcast for 10.0.0.0/8, 18.104.22.168/8, 192.168.1.248/30 and 192.168.1.252/30.
- R3 will broadcast for 22.214.171.124/8, 192.168.1.248/30 and 192.168.1.252/30.
- R1 will learn about 126.96.36.199/8 network from R2’s broadcast.
- R2 has nothing to update from R1’s and R2’s broadcast.
- R3 will learn about 10.0.0.0/8 network from R2’s broadcast.
After 30 seconds router will broadcast again with new routing information. This time routers have nothing to update. This stage is known as convergence.
Convergence is a term that refers to the time taken by all routers in understanding the current topology of network.
RIP Routing protocol metric
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 188.8.131.52/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.
So which route will R1 take to reach the destination?
Route 1 has one hop count while route 2 has two hop counts. Route 1 has lower hop count so it will be placed in routing table.
- RIP routing protocol uses local broadcast to share routing information.
- RIP broadcasts routing updates in every 30 seconds, regardless something in network has changed or not. Once 30 seconds expires, routers running RIP protocol will broadcast their routing information to any devices connected to their interfaces.
- 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.
That’s 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.