In the last few videos, we're focused on static routing,
and that is fine to a point.
But as the network grows, they require a lot more effort to maintain,
and they also don't respond very well to changes in the network.
So in this video, we're going to get an overview
of how dynamic routing protocols work and the ones to follow.
We'll pick one, OSPF, and we'll see how it works
in detail.
The goal behind dynamic
routing protocols is the same as with static routers.
That is to build a valid routing table so
a router can forward packets to the right place.
But the approach they take, it's very different.
When we configure static routes, we do two things.
We tell the router about a remote network and we tell it how to get there.
This is a manual
process, which can be a pain when you have a lot of routes,
dynamic routing protocols have a different approach.
Routers running one of these protocols, we will find other connected routers
we call these neighbors or peers.
The router does this by sending out hello messages on its interfaces
when it gets a hello in response, it knows there's another router their.
These routers then form a neighbor relationship.
They use this relationship to share information about the subnets
they know and how to get there.
Some routing protocols will use this information
to build a full map of the network.
Others only concern themselves with direct neighbors.
This is more like following road signs to get to a destination.
Each router will advertise their connected networks.
They're saying, if you want to reach this network, send your packets this way.
A neighboring router then receives this advertisement.
It will then store a copy of the route in a table in memory.
If this is the best route, it installs it in the routing table.
We look at that in more depth later.
When a router learns
a route, it will share it with other router, as it knows about. Each of these
will store the router in memory and advertise to their neighbors.
Convergence is the term we use when the network
has finished learning about all the routes.
After the network has converged, routers continue to advertise their network.
This is their way of saying they're still here.
What happens when a reader learns the same route from two different places?
In this example, a router is learning the
10.0.10.0 network from two different neighbors.
In a case like this, the routing protocol
selects the best path to the destination.
This path goes into the routing table.
The method it uses is a bit like spanning tree.
Each path will have a metric.
This is a number that shows how long the path is.
The routing protocol will see that one
path has a lower metric than another.
The lower the metric, the better the path.
There are a few different routing protocols.
Each has their own way of calculating the metric and deciding which path is better.
We'll look at that some more in a moment.
This will give you an idea of how routing
protocols handle changes in the topology.
When a router or link in the network fails, the advertisements
along that path stop. When a router notices this,
It updates its list of neighbors.
It may need to update the routing table too
This may mean that the router has to remove some routes.
Or there may be alternate paths available in this case,
the routing protocol adds the alternate route to the routing table.
This enables the network to automatically work around failures.
We can see, then, that there are a few advantages
to using dynamic routing Routes are automatically learned from neighbors.
The best path is automatically selected if we add a router or link
We don't need to manually configure routes.
And if a router or link fails, the routing table
can be automatically updated.
Static routes still have their place, though
in some cases they quick and simple, and they do help during troubleshooting.
static routes are also more lightweight than routing protocols.
Routing protocols generate a small amount of traffic
and use CPU and memory on the router.
Generally, this is not a big concern, but in large networks
it can be an important factor.
If you have a moment, take a look at these quiz questions
to see if you've got a solid grasp on what we've been discussing.
As I said earlier, there are a few routing protocols to choose from.
They fall into two groups Interior Gateway Protocols or IGP's
and exterior gateway protocols, or EGP's.
It's very simple IGP's fit within your organization.
As you can see, there's quite a few IGP options available.
An EGP provides dynamic routing between two different organizations.
Routing protocols often call different organizations Autonomous Systems.
The only EGP available today is BGP.
The simplest example of using BGP
is between your company and your internet provider.
You are both different autonomous systems
as you're both managed by different people.
This is common if you have a back up internet connection,
if your primary connection fails, BGP routes traffic
across the back up connection.
BGP is a special routing protocol,
which may be an IGP or an EGP.
It does get complicated and it isn't covered in the CCNA exam,
so we won't really talk a lot about it.
For IGPs, we have five options available, but they're far from equal.
The oldest is rip or routing information protocol.
Unfortunately, it has critical limitations and it's really not very good.
It uses hop count as metric,
remember that the metric is how a routing protocol measures how long a path is.
Hop count is a very simple metric.
Imagine a destination that's four routers away.
Then RIP will measure this as four.
Unfortunately, this is not a good way to measure a path length.
It doesn't measure how good those links are.
one path might have a metric of two, but have very slow links.
Another might have a metric of four, but have fast links.
RIP will think the slow path is actually better.
So the lesson here is avoid rip.
It's not worth the hassle.
one of the better options is EIGRP, Cisco designed EIGRP,
so it was for Cisco routers only they then allowed other vendors to use it.
But few have taken them up on the offer,
so we still generally consider it to be Cisco only.
It has a very detailed metric for measuring network paths.
It looks at things like bandwidth delay,
link reliability and link load.
It then puts these values into an algorithm which creates the metric.
It's also very easy to work with, at least I think it is.
Many people prefer our next option, which is OSPF
OSPF has been arouter for a very long time.
It wasn't designed by a specific company,
and this means it's available to be used by all vendors.
This makes it a popular choice
in a network that uses equipment from various different vendors.
It's quite possibly the most popular
IGP for that very reason.
OSPFs metric is good, but it's much simpler than EIGRP.
It defines each link as having a cost.
This cost comes from the bandwidth of the link.
The lower the cost, the better the link.
And OSPF organizes the network into areas.
This makes it easier to organize and plan out the topology.
We'll look at OSPF in more detail in the following videos.
As I said before, we can use BGP in two ways
internally as an IGP and externally as an EGP.
That's why we use the terms iBGP and eBGP.
You can do some amazing things
with BGP as it's extremely tunable.
On the other hand, this often leads to a lot of manual configuration.
Usually you would only use iBGP if there's a particular reason to do
so in your network, if you don't have a particular reason,
you would normally just stick with our OSPF or EIGRP.
BGP is difficult to learn to start with,
many network engineers never end up completely mastering it.
ISIS is a very robust protocol.
It's not common at all in small and medium networks.
In fact, it's generally only used in very large networks like service providers.
This is because it creates a logical backbone
that can grow as it's needed to.
While it works well, it's definitely not as popular as other routing protocols.
Also, it works a bit differently to the others,
which can make it harder to learn and use.
Now, here's the interesting thing.
We don't need to select only one protocol and stick with it.
A router can run more than one routing protocol at a time.
If we run the command show IP protocols,
we get a list of all the routing protocols on this router.
Here we can see the router is running EIGRP...
OSPF...
And BGP.
There's a lot of information in this command.
Don't worry too much about the details yet.
If we now take a look at the routing table,
we can see that this router has learned a few routes.
If you look at the column on the far left,
you can see a letter next to each of these routes.
This is the code that tells us which routing protocol learned the route
the code section at the top helps us to decipher this.
For example, the S is a static route.
The O is for OSPF.
EIGRP is slightly different, it has a D.
And B, for BGP, whether it's iBGP or eBGP.
We've looked at a broad range of routing protocols. Now
keep in mind, though, that the CNA exam will only
really look at OSPF in detail.
When you ready to go to the next level of certification, that's CCNP,
then you'll need to know EIGRP and BGP as well.
How does a router choose the best path?
Let's look deeper into the routing table and find out.
If you look closely, you'll see that any route that isn't
local or connected will have two values in square brackets.
The first value is the administrative distance.
The second is the metric.
We've spoken about metrics before,
the metric is the value that the routing protocol
uses to measure how good a path is
if there is more than one path to a destination.
The routing protocol will use the metric to decide which one is best.
The routing protocol gives the best route to the routing table.
Take note that if there is more than one path, only the best
path is available for use by the routing table.
Each routing protocol has its own way of calculating a metric
RIP uses hop count, OSPF uses
bandwidth and EIGRP uses several values like bandwidth,
delay, reliability and load.
This means that the metric value can vary between different protocols.
Notice the metric for an OSPF router and compare it to an EIGRP route.
This is owed to
the fact that the metrics mean different things.
This leads to an interesting question.
The metrics are very different between routing protocols.
So how is the best account selected
if it is learned from two different routing protocols?
Let me explain.
See this topology.
Router-A has two paths to reach the
172.16.0.0 network.
For example, our route learns this route from an EIGRP neighbor on the left link,
and it learns it from an OSPF neighbor on the right link.
The EIGRP metric, maybe 3072,
while the OSPF metric may be 2.
Which path does Router-A use to reach this network?
Does it use the OSPF path because the metric is better?
The short answer is, no, that's not the logic that the routers use.
The router does need to choose the best path.
But when comparing routes from different routing protocols,
the metric is not a factor.
That's where this other value comes into play.
Remember, this is the administrative distance or AD
The router uses the AD
to decide which routing protocol is best. When to routing protocols are offering
the same route the router chooses the one with the lowest AD.
By default, a Cisco router prefers
EIGRP rather than OSPF.
Presumably, this is because Cisco made EIGRP and they trust it more.
In our example, Router-A uses the EIGRP route
when forwarding packets to 172.16.0.0
We can think of AD as how believable
or trustworthy a routing protocol is.
Here we have a simplified table of Cisco's default administrative distances.
We can change them if we want.
But there's rarely a good reason to do so.
The lower
the AD, the more willing the router is to trust the route,
as you can see, nothing beats a connected route.
Next important are the static routes.
The router assumes that if we can figure a static route,
we're doing it for a reason.
This way, a static route will override a dynamically learned route.
You'll also notice that EIGRPs administrative
distance is 90 while OSPFs is 110.
That's why, in the earlier example, the router used the EIGRP route.
All vendors have a similar system to this,
but be aware that their values may be different.
So to summarize, a routing protocol will use
the metric to decide which route to offer to the routing table.
There is no guarantee that this route will end up in the routing table.
two or more routing
protocols may offer the same route.
The router uses the administrative distance to choose the best one.
one last case to consider.
Take a look at this example.
It's like before, but this time we only have OSPF.
And notice that the metric is the same on both links.
What will happen here? In this case,
the router installs both routes into the routing table.
This is called equal cost multi-path
or ECMP.
In this routing table,
we can see an example of ECMP.
They're out for 192.168.30.1
has two next hop IP addresses
notice that they have the same AD and the same metric.
The router will use both links, allowing each of them to share the load.
It's important to know, though,
that while Cisco uses ECMP by default, not all vendors do.
Some vendors will select one route for the routing table
unless we can figure ECMP first.
It's time for a review again.
It's good to make sure that you have these core concepts solidly
in place as they will come into play in the next few lessons.
In today's lab,
you get to log on to R1 in this topology. From that router only
You need to work out the answers to these questions.
Supporters of the channel can download this lab from the website.
This includes detailed answers to the questions.
Now that we've seen dynamic routing protocols in general,
it's time for us to look in detail at OSPF.
We'll spend a few videos on understanding how it works and how it's configured.
I hope to see you there.