RIP is a distance vector routing protocol and the simplest routing protocol to start with. We’ll start by paying attention to the distance vector class. What does the name distance vector mean?
- Distance: How far away? In the routing world, we use metrics.
- Vector: Which direction? In the routing world, we care about which interface and the IP address of the next router to send it to.
I don’t know if you ever go cycling but here in The Netherlands, we have some nice so-called mushroom signposts telling you which way to go and how far (in kilometers) the destination is. The same principle applies to distance vector routing protocols.
If you don’t like cycling, you’ll like the highway signs better:
Enough about cycling and highways. Let’s see how distance vector routing protocols operate.
In this picture, we have three routers and we are running a distance vector routing protocol (RIP). As we start our routers they build a routing table by default but the only thing they know is their directly connected interfaces. You can see that this information is in their routing table. In red, you can see which interface, and in green, you can see the metric. RIP uses hop count as its metric which is nothing more than counting the number of routers (hops) you have to pass to get to your destination.
Now I’m going to enable distance vector routing. What will happen is that our routers will copy their routing table to their directly connected neighbor. R1 will copy its routing table to R2. R2 will copy its routing table to R3 and the other way around.
If a router receives information about a network it doesn’t know about yet, it will add this information to its routing table:
Take a look at R1, and you will see that it has learned about the 192.168.23.0 /24 and 184.108.40.206 /24 networks from R2. You see that it has added these two items:
- Interface (Fa1/0. This is the vector part, we know in what direction we have to go.
- Metric (hop count). This is the distance part, we know how far away the network is.
192.168.23.0 /24 is one hop away, and 220.127.116.11 /24 is two hops away.
Awesome! You also see that R2 and R3 have filled their routing tables.
Every 30 seconds our routers will send a full copy of their routing table to their neighbors who can update their own routing table.
So far so good, our routers are working, and we know the destination to all of our networks…distance vector routing protocols are vulnerable to some problems, however. Let me show you what can go wrong: