Introduction to RIP
Routing Information Protocol (RIP) is a distance-vector routing protocol, which can be used in small networks.
Distance-vector? Don’t worry! It is very simple:
- Distance: Distance from its destination, as there is no meters or kilometers parameters; in routing we use the metric which is the same as distance.
- Vector: The direction, in routing, this information will be the interface and the IP address of the router to send traffic to.
Can we use RIP in MAN or WAN networks? No, you strongly can’t, because RIP takes a lot of time to see all destinations from a single source.
Let’s see how RIP operates. And the process is the same for all distance-vector routing protocols.
In this picute, we have three routers. If we take a look at the routing tbale of each one (before enabling RIP), we”ll only find the directly connected networks. Here are the routing tables:
You can see that in each routing table, we have the IP address of the directly connected networks, the interface to reach this network and also the metric (Distance). The metric to reach the directly connected networks is 0. It’s logic because the networks are ‘’directly” connected.
Once we enable the RIP routing protocol, each router will send a copy of its routing table to its neighbor. In our scenario, Rabat will send a copy of its routing table to router Paris, Paris to Amsterdam and the other way around.
If you look now at the routing table of each router, you will find this:
Great! We can see all routes in each routing table. For example, Router Rabat has learned about network 18.104.22.168/24 and 192.168.2.0/24 from router Paris. The interface to reach these 2 networks is Fa0/0. The metric to reach 22.214.171.124/24 is 2 because we have 2 hops (Paris and Amsterdam), and the metric to reach 192.168.2.0/24 is 1 because there is only 1 hop (Paris).
Just put in mind that every 30s, the routers will send a copy of their routing table to their neighbors. In this way, every router will have up-to-date information about the network.
These are all good news. It’s time for some problems! Because Without problem, we don’t need engineers! 😀
Let’s see what is going on when router Rabat loses the 126.96.36.199/24 network:
This picture shows that router Rabat loosed network 188.8.131.52/24 because of a link failure. We’ll see what will happens in the routing table of the 3 routers:
You can see that router Rabat has deleted network 184.108.40.206/24 from its routing table, because the Fa0/1 link goes down.
As we said, every 30 seconds, Routers sends a copy of its routing table to their neighbors. In this case, router Paris will send a copy of its routing table to router Rabat and Amsterdam: Let’s see what will happen:
When router Rabat receives the routing table of Paris, it will see that he can reach the 220.127.116.11/24 network through router Paris, so Rabat will update its routing table.
Now, it’s time for router Rabat to send a copy of its routing table to Paris. Let’s see what will going on:
You can see that Paris has updated its routing table because it receives a new metric to reach network 18.104.22.168/24 which is 2. Amsterdam also has updated its routing table because he receives a copy of Paris routing table and it finds that the metric to reach network 22.214.171.124/24 has changed. So it updated its routing table.
Do you think that our routers will stop this process? Now they will keep updating their routing table to infinite. That’s why in RIP, the Hop-Count is limited to 16. So if you find a route with a hop-count of 16, this means that the destination is unreachable. In our example, the routing tables will be represented as the following:
You can see that network 126.96.36.199/24 has a hop-count of 16, which means that this network is not reachable.
Let’s see another problem: What do you think will happen if we send an IP packet to 188.8.131.52/24 network?
If you have the eagle eyes, here what you will see in the routing tables:
- From Paris, to reach 184.108.40.206/24, we should use the Fa0/0 interface of router Paris.
- From Rabat, to reach 220.127.116.11/24, we should use the Fa0/0 interface of Router Rabat
Ladies and Gentleman, Welcome to the Routing loop! Fortunately, we have the TTL field in the IP packet header. So that the packet will not loop around forever. As the TTL is by default 64 or 128, that means the packet will take some of our network resources such as Router CPU, Bandwidth of the link between the two routers…
So, even if we have the TTL, it’s not the best solution.
In fact, RIP has some features to avoid infinite updates of routing tables and routing loops.
- Split horizon: whatever you learned from your neighbor, don’t advertise back to him.
- Route poison: Send a Trigged update to our neighbors containing the network that we lost with a hop-count of 16 (Unreachable in RIP).
- Poison Reverse: A response to route poison, to make sure that the router has updated his routing table.
In our example:
When router Rabat loses network 18.104.22.168/24, he will send a Route poison to Paris, which will send it to Amsterdam. So Paris and Amsterdam will update their routing tables. As the following:
The network 22.214.171.124/24 is now unreachable. And to make sure that network 126.96.36.199/24 is still unreachable, a Poison Reverse message is sent to router Rabat.
Last thing, when router Paris and Amsterdam knows that network 188.8.131.52/24 is unreachable, they start a hold down timer, and the max value of this hold down timer is 180s:
- If they receives information about this network with the same or worse metric, they ignore it.
- If they receives information about this network with better metric, they update their routing table.
- If they don’t receive any information about this network, they removes it from the routing table.
These are the main things that you have to know about RIP.
Before finishing this article, there is two versions of RIP: RIPv1 and RIPv2. To save my fingers from taping, here is the main differences between the two versions:
|Classful protocol and does not send subnet masks in routing updates||Classless protocol and sends subnet masks in routing updates|
|Uses broadcast to communicate with neighbors||Uses multicast to communicate with peers. Multicast address 184.108.40.206 is used.|
|RIPv1 does not support authentication||RIPv2 supports authentication|
|Does not support VLSM||Supports VLSM|
We are at the end of this article. You will find here all the Cisco commands you need to configure RIP. I hope it was helpful for you, and if you have any comments or suggestions, just leave it to me!