So now let's talk about the OSPF metric.
The nice thing about the OSPF metric compared to the other routing
protocols like EIGRP is that its metric is very simple.
By default, each interface is given a cost based on its configured bandwidth.
To obtain this cost,
a reference bandwidth is divided by it with the result being
the cost to use a specific outbound link.
By default, on most devices the reference bandwidth is set to 100 Mbps.
So for a 10 Mbps interface the metric would be 10,
because 100 million divided by ten million is 10.
Of course,
you may notice right away that almost all modern
interfaces are faster than 100 Mbps.
So what does this mean?
A hundred Mbps interface would have a cost of 1 so what a Gigabit interface?
It also would have a metric of 1 because OSPF will automatically round up.
Because of such a low default reference bandwidth,
newer and faster interfaces would all be given the
same cost as a 100 Mbps interface.
This most often results in the reference bandwidth being
changed to something that is as high or higher than the
fastest interface on the whole network.
So if the fastest interface was 100 Gbps,
then maybe set the reference bandwidth on all devices to 1 Tbps.
This will result in calculated metrics that are correctly
representative of the different speed interfaces.
So let's move back into the lab here and we'll take a look at what the
current metrics are and sort of see how the adjustment of the reference
bandwidth will change how the metrics are calculated.
For the purpose here let's focus on this route which is R6's LAN.
Real quick here let's take a look at this topology again.
You can see from R1 there are those two paths that we
just talked about in the previous lab,
we're going to take a look at the 100 network,
the best path is 4.
So as I show it in the previous run-through here,
R1 to R2, R2 to R4, R4 to R6 is 3, and then all the other,
the three other ones we discussed to 4, so that reaches,
if we move back here, this 4 number here.
Let's say it costs 4 so that's calculated from the
interfaces between all these devices, and if we look at the interfaces,
if we just look at one of them for the, brief,
we can see that both of the interfaces going towards R6 are both
Gigabit interfaces and both of them have a cost of 1.
If we look at one of the interfaces specifically,
which on this platform we'll use the configured bandwidth,
and we see here it's actually gigabit,
because if you're familiar with Cisco this bandwidth can actually be
configured manually to whatever you want to make it,
but for these purposes we're just leaving it based on the automatic speed,
so it'll set this if you don't set it to something different.
So since we're using an interface that is larger than the reference bandwidth,
and in this case is 100 Mbps, yeah, the reference bandwidth here.
So since 100 divided by 1000 is less than 1,
it rounds up to 1; that's where we get these,
that the cost of 1 between each one of the devices on
every link between here and R6.
So if we use this as an example, if we went onto the link between R1 and R2,
and we change this bandwidth to, so if we move this down to a 10 Mb link,
that link automatically is taken out of the routing table because his cost is
more than the route between the link between R1 and R3,
but if we change him to 100 Mbps so if we go back here,
so that was 10 Mb, there's 100 Mb, and now that's 100 Mbps,
which is you know, less than a gigabit,
we'll see that both routes are put in here.
Now as noted in the previous slides here,
that obviously is a problem if 100 Mbps link is considered the same cost
as a Gbps link whenever it's a tenth of the speed,
obviously that sort of throws the monkey in the wrench.
So in order to best handle this,
usually people change the reference bandwidth on the
network to a number that's higher than the faster or the
fastest speed interface network wide.
For the purposes of this lab, let's just change the reference bandwidth to Gbps,
and when we do that, if I have this interface like it is right now,
it's set to 100 Mbps, that will go away,
because its cost will now be correctly representative of the
difference between the 100 Mb link and the Gb link.
So now we set the reference bandwidth as a gig,
if you noticed up here whenever I did that command it says make
sure this is consistent across all routers.
Since the link state databases are exchanged between each of the devices on the
network and those are all supposed to be exactly the same,
every one of the OSPF devices should have the same
reference bandwidth or you're going to get sort of a very
weird looking link state database.
So it's best to perform that change on every one of the devices.
(Typing) Two more, we're getting there.
(Typing) And R6, and that's done across the board here.
So now remember right here, right before this,
each one of these was considered equal,
4 and 4 even though this path had a 100 Mbps bandwidth
configured and this one had a Gb.
But now if we look at the routing table,
you'll see that this got changed so that only the one that was
actually configured to be Gigabit showed up,
and we'll see that that link between R1 and R2 had a different
metric if we just disabled this interface real quick.
Now we have the path through the link between R1 and R2,
and we'll see instead of having a metric of 4 it has a metric of 13.
So it's representative of the differences between
the different speed interfaces.
So with that covered, let's move back into the slides here for a little bit.
So as I noted in the lab,
I wanted to point out that the way that OSPF routes
up to 1 is actually an anomaly,
as typically OSPF implementations will always round
down to the next whole number.
So keep this in mind if you're trying to calculate the metric and you're
getting an answer that is different than the OSPF device.
The last thing that I want to cover in this module is
about how external routes are given costs.
As a quick review,
external routes are entries that are taken from another source,
whether that be another routing domain or from a connected interface on a
device and inserted into the OSPF link state database.
This process is referred to as redistribution.
With OSPF there are two different types of external route entry,
type 1 and type 2.
On Cisco devices, a type 2 is the default so we will start there.
With a type 2 external route entry,
a metric is given to a routing entry when it is
initially inserted into the OSPF database.
This metric is then locked and does not increment
as normal OSPF route entries do.
The cost to reach that destination would be the same at
any point within the OSPF network.
The general idea is that this metric is a value that is greater than any
calculated route would be if traffic crossed the whole OSPF domain.
With type 1 external route entries,
an initial metric is given when inserted into the OSPF database.
This metric is then used as a base value and is
incremented using normal OSPF interface costs.
The one that is preferred is really up to the specific
situation and the system designer or engineer.
Note as well that both can be used at the same time as
the type is route-entry specific.
So now that this is covered, let's move on from the OSPF metric and talk about OSPF route selection.