- [Instructor] In this video, we want to take a look
at how OSPF calculates its metric or its cost.
Now, with EIGRP, recall that by default,
we considered bandwidth and delay.
However, OSPF is purely basing its metric,
its cost, on bandwidth.
And here's the formula.
The cost equals a reference bandwidth
divided by an interface bandwidth,
and by default, the reference bandwidth
is 100 million bits per second.
In other words, 100 megabits per second.
So in this example, if we want to go
from PC1 to PC2, let's calculate the cost
going at the two different paths
we have available to us.
For that link between R1 and R2,
we see that that's a 100 meg link,
so the cost is the reference bandwidth of 100 meg
divided the link speed of 100 meg, and that equals one.
Similarly, the cost from R2 to R3,
that's a 100 meg link.
So that's got a cost of one,
and the cost going out of R3 down to PC2,
that's got a cost of one.
But take a look at that 10 megabit per second link
between R1 and R3.
That's a reference bandwidth of 100 meg
divided by the interface speed of 10 meg.
That's a cost of 10.
So which path are we going to choose?
Well, if we were RIP,
RIP would only be considering the hop count.
RIP would say, "Oh, if I can go from R1 directly to R3
out to PC2, that eliminates a router hop."
However OSPF is going to say
"Well, if I go from R1 to R2 to R3,
that's one plus one plus one, that's a total cost of three.
If I go from R1 to R3, that's a cost of 10,
and then it's going to be another cost of one
to go out of R3 down to PC2,
that's 10 plus one, that's 11."
So OSPF is going to say the optimal path,
the shortest path, is going to be from R1 to R2 to R3
out to PC2.
However, what if we had a gig interface?
Here we've just been dealing with slower speed interfaces.
If I had a gig interface,
that would be a reference bandwidth of 100 meg
divided by 1,000 meg.
Well, we cannot have a cost that's a decimal value.
It has to be an integer.
And even though mathematically,
the cost would be 0.1,
the cost would be rounded up to a one.
Here's the issue.
By default, the cost of a 100 meg link
equals the cost of a one gig link.
How do we fix that?
Well, as a best practice, we'll probably want to go in
and change that reference bandwidth
from the default of 100 meg up to something much higher
where we can distinguish between higher speed interfaces,
such as 10 meg and 100 meg and one gig
and 10 gig and 40 gig and 100 gig, and so on.
Personally, I like to go in and set my reference bandwidth
to about two terabits per second.
And when we get into our first configuration video
where we see how to set up OSPF version two,
I'll be sure and show you the command we can use
to change that default reference bandwidth,
because a lot of network administrators out there,
unfortunately they've got a false sense of security.
They think that OSPF is distinguishing
between fast ethernet,
in other words, 100 meg links, and gig links,
and by default, it's not.
It considers those to be the same cost.
So we probably want to change that.
But that's a look at how OSPF calculates its cost value.