In the last post, you learned the barebones basics of Routing. In this guide you’re bones will get the flesh of Static Routes. Then we’ll enter the intriguing world of dynamic routing protocols.
Get read to learn:
- What is a Static Route?
- What is a Distance Vector Routing Protocol and why do we use RIP?
- All about Metrics and Administrative Distances
Let’s do this!
Checking out Static Routes
Static Routes are routes that a network engineer manually typed into the router config. Let’s add a Static Route for the 18.104.22.168. network. The host at 22.214.171.124 lives here.
ip route 126.96.36.199 255.255.255.0 10.1.0.1
This means if the router wants to send a packet to the 188.8.131.52 network it should send the packet to another router (R1) at 10.1.0.1. Why? Because 10.1.0.1 knows something about 184.108.40.206. How did we know that? Because as the network administrator we configured the network this way. There’s no magic about it. We’re just connected the dots.
Notice that the show ip route output now has an additional route for 220.127.116.11.
S 18.104.22.168 [1/0] via 10.1.0.1
R2 is thinking:
I have a static route for the house that lives on 22.214.171.124 street. To send mail there I just need to send it to 10.1.0.1 street first.
10.0.1.0.1 is known as the next-hop. Every router in the path is called a hop. Think of a frog leaping from one lilly pad to the next. If you look back at the original network diagram you can see that R2 is 1 hop from 126.96.36.199 but two hops from 172.18.0.0.
So R1 has a static route to R2 which is directly connected to our destination. But what if a dozen routers where between R1 and the 188.8.131.52 network? You would need to manually connected the dots on each router. This means logging into each router, adding the static route and then hoping the network topology doesn’t change. Right? I mean, if one of the routers in the path fails or a new router comes into the topolology you would need to keep track of all the routes on each router to make sure everything was updated to reflect the chnages. But this is silly! Who has the time for that? It’s also error prone and therefore not very wise.
And that’s why we have Dynamic Routing Protocols!
The Dynamic life of Routing Protocols
Dynamic routing protocols make routers less anti-social. They become gregarious party goers who love gossiping about everyone else.
Hey, I’ve got the inside scoop on R4. He knows about 172.18.0.0. And guess what? It’s all out his fa0/0 interface!
The routing protocols makes routing possible! The routers abandon their insulare lives and live transparently telling everyone, everyone elses business! It’s crazy but this is how it works.
In tehnical terms this is called a Distance Vector Routing Protocol. R4 tells R1 who tells R2 about all the networks and R2 does the same in reverse. Every router tells every other router about the network. It’s called Distance Vector because it involves two things:
- The Distance to the remote network
- The Vector or direction on how to get there
Each router can’t see beyond the next-hop router. In other words, routing information is only exchanged between directly connected neighbors. How far away are you (hop-count) and what direction do I need to go to get there. (exit interface)
RIP is dead
The Routing Information Protocol (RIP) is probably one of the oldest and most well known Distance Vector protocols. So let’s zap the static route we added earlier and configure RIP on all the routers in our topology. RIP will automatically collect all the routes and send them to all the routers in the network. No need for static routes here!
router rip version 2 no auto network 0.0.0.0
We’re just telling each router to use RIP version 2. Version 1 is obsolete and laden with problems so no one uses it. The no auto part is Cisco speak for “Hey just let the network administrator take care of the subnet masks. Don’t automatically assume default class A, B, and C masks.”
The last part, network 0.0.0.0 tells the router to include all the directly attached networks in the RIP advertisements.
Now when you do a show ip route the results are little more interesting:
You can see the new RIP routes with the R prefix. Let’s look at the first one on R2:
R 172.17.0.0 [120/1] via 10.1.0.2, 00:00:13, FastEthernet0/0
This means the 172.17.0.0 network was learned by RIP. To get there, R2 needs to send packets out Fa0/0 to the next-hop router at 172.17.0.0. It’s also been 13 seconds since the update arrived. There’s also a cryptic collection of numbers. Did you notice this: [120/1]?
The 120 is called the Administrative Distance (AD) and is doesn’t really come into play unless you have multiple routing protocols in the topology.
Since different routing protocols have different metrics it’s hard to compare them. For example, which is better: EIGRP which uses bandwidth and delay as a metric or a static route that was manually configured?
If a router receives multiple routes from multiple routing protocols it will always prefer the route with the lowest Administrative Distance. It’s just a simple number that says which routing protocol you should trust.
Directly connected routes have an AD of 0. Static Routes are 1. And then it moves up from there. BGP is 20. EIGRP is 90. OSPF is 110 and RIP understandably has the highest AD at 120.
The number after the 120 is the routing metric used to determine an optimal path. RIP uses the hop count as a metric so the 1 means the 172.17.0.0 network is one hop away.
Metrics are important but the Administrative Distance always beats the metric.
How RIP works
You probably noticed that RIP looks too much like Rest In Peace (as in this: protocol is dead!). And it is dead. Let me tell you why.
Every 30 seconds RIP tells every router the whole story of the network. It says,
Hello router friends! I know you didn’t ask for this but here’s all the routes that are still active. Just FYI
If RIP doesn’t hear a response in 90 seconds it assumes the route is no longer valid and removes it from the tables. Now at first you might wonder: why doesn’t it just remove the routes after 30 seconds? That would be like assuming the phone connection died whenever the guy on the other line paused to take a breath. In normal phone communication we have a certain “hold down” timer where we can wait an acceptable amount of time before assuming the other party hung up. RIP has the same thing. It’s appropriately called the Dead Timer. This means it it can take RIP up to a minute and a half to realize a link or router is no longer around.
That’s a long time!
Not only that RIP uses the hop count as a metric. So picture this: a loop of four routers. R1, R2, R3 and R4.
A packet is going to R4. The link between R1 and R4 is a slow as dirk 56kbps modem line but it’s only 1 hop away.
But there’s another path to the same network. it’s 3 hops away but it’s connected by super fast gigabit links.
Do you know what RIP does? It picks the slow dial-up link because it’s one hope away.
This is one of the reasons why no one uses RIP anymore.
I’m saying RIP to RIP.
The Bottom Line
Dynamic Routing is the way to go! In the next guide we’ll wrap up our series our routing protocols with a humble exploration of OSPF and EIGRP.