[AUDIO LOGO]
And now we're finally up to the lowest path cost, which,
of course, is rule number 4 in our OSPF path selection
criteria.
Now, I'm sure we've all seen lowest path
cost wins numerous times.
So in this video, we're not going
to really be focusing so much on proving
that the lowest cost wins.
We're going to be more focusing on what is done with the cost
automatically on Cisco routers, how can we change
what's done automatically.
And we'll take a quick look at setting those costs manually
just to make sure we're clear on how to do it
even though we have done it on a few of our paths
already in our lab environment.
So that said, once again, let's take a quick look
at our topology although, in this case,
we're going to be doing most of our work on router 8.
And then, of course, we'll jump into the command line
and take a look at how cost works on the Cisco routers.
So we're going to be starting off
by examining the existing cost on an interface.
And as I said during the introduction,
we will be focusing on router 8, particularly
on this gigabit-1 interface.
And what we're going to see is the defaults
for setting the cost automatically.
And then we're going to change that.
This is handled by a command called auto-cost reference
bandwidth.
And the default value for this is actually 100.
Now, the interesting thing about this
is what that 100 actually means.
100 actually means that the bandwidth
is going to be calculated as 10 to the eighth divided
by the interface bandwidth in bits per second.
Now, given these defaults, 10 to the eighth
is actually 100 million.
So that would be 100 million bits
per second, which is what we generally
call 100 megabits per second or, of course, fast ethernet.
So this corresponds to the number
after the auto-cost reference bandwidth.
Now, the big problem with this is that we can't go to decimals
and we can't go to fractions.
The unfortunate side effect of that is, fast ethernet
has a cost of 1 because it's 100 million divided by 100 million.
However, since we can't go to fractions in decimals,
that means the gigabit is also going to be a cost of 1.
10 gig, a cost of 1.
100 gig, 400 gig, and so on.
So this number is going to have to be adjusted to account
for higher speed interfaces.
And that's one of the things we're
going to be looking at here in this video.
Now, of course, as we go along and we
change to different values, we'll,
of course, be observing what's happening here.
So let's jump over to the command line on router 8.
Let's look at some of the defaults.
And then we'll start changing things
and see what the results are.
So if we start off by looking at our interface--
we'll just say show IP OSPF interface gigabit 1--
we can see that, as predicted, this has a cost of 1.
And we can also take a look at that default
value of the auto-cost reference bandwidth.
If we say show run all and then we include--
we'll just do auto-cost.
We can see that that default value of auto-cost reference
bandwidth is 100.
So now let's see what happens if we start changing the bandwidth
on this interface.
Now, as we start changing the bandwidth on this interface
to see how it affects the calculation
of the auto-cost reference bandwidth,
keep in mind that bandwidth is just
a reference number used by our routing protocols,
in this case, OSPF.
EIGRP looks at it as well.
But it doesn't literally change the throughput
of the interface.
So although this is still a gigabit interface,
we can have our routing protocol treat it as if it's not.
And that's what we're going to do in order
to look at how auto-cost reference bandwidth functions.
So let's take a look.
We'll go into configuration mode for interface gigabit 1.
And if we type "bandwidth," notice
that if we're going to hard-code a number,
this is in kilobits per second.
So remember, OSPF is looking at this in bits per second.
So these numbers are going to be off by, well, 1,000.
So let's go ahead and change the bandwidth here
to 100,000, which is going to be the equivalent of 100
megabits per second.
And if we do our show IP OSPF interface for gigabit 1 again,
we see that the cost hasn't changed
because this is still 10 to the eighth over 10 to the eighth.
So here, we can see that this 100-megabit-per-second
interface has the same cost as gigabit.
But what if we were to change the bandwidth one more time
and just drop one 0, which would effectively
make this 10 megabits per second or the equivalent of legacy
ethernet?
We'll look at our interface again.
Notice that now the cost is 10.
So once we get down to 10 megabits per second,
now the cost starts to actually do something.
So as we can see here, the default behavior
of auto-cost reference bandwidth isn't ideal on most platforms.
Now, one quick note on this.
Cisco has begun to change the default
value of auto-cost reference bandwidth
on some of the newer platforms.
So be sure to check on whatever routers
you are dealing with to find out what the default value of this
is.
It may actually be set appropriately high
on more modern equipment or higher-end equipment.
As an example, NX-OS on the Nexus platforms
actually sets this to a much higher number.
Now, before we change the auto-cost,
let's go ahead and take our artificial bandwidth number off
of this interface.
Then let's go over to OSPF.
And we'll say auto-cost reference bandwidth.
And if you hit the question mark here,
we can see the value range for this.
And we do put this in, in megabits per second.
And as you can tell, that fits right
into the example we did on our topology
where we said that the 100 is the same as the 100
megabits per second for fast ethernet
because this is in megabits per second.
Again, the default is 100.
So what would happen if we made this, let's say, a million?
So it tells us that the reference bandwidth
has been changed.
And it tells us to make this consistent across all routers.
The reason it does this is, having
a different view of the network and different interpretation
of costs can create looping problems
in routing protocols in general.
So if you're going to change metrics,
it's always a good idea to change it on everything.
So now that we've changed it, let's look at our interface
again.
And we see now that we have a cost of 1,000.
This is much more reasonable because this would clearly
be able to handle at least 10-gig interfaces,
100-gig interfaces, 400-gig interfaces.
So this would probably cover us for quite some time
before we had to adjust it again.
So this isn't necessarily a bad value.
But one thing that we do need to keep in mind
is, as we turn up the auto-cost reference bandwidth
to handle these faster interfaces,
well, the problem that we had with the high-speed interfaces
before all having a cost of 1, well,
that exact same problem is now going to exist
on the lower-speed interfaces.
Those are all now going to go to maximum value, which,
depending on your environment, may or may not be a problem.
Maybe you don't have any slow-speed interfaces anymore
in which case you don't have to worry about this.
But let's take a look at what happens if we do.
So let's go back into our interface again.
And let's change this back to our 10 megs.
Notice the cost here has gone to 65,535, the maximum value.
And if I were to make this ridiculously slow,
let's drop it all the way down to a good, old 64k link.
Same thing.
See, the cost is still 65,535.
So what's happened now is, we've lost the resolution
on the lower-speed interfaces.
Now, the lower-speed interfaces all look alike to OSPF.
Now, this, of course, could be very easily fixed by you
as the administrator.
If you did have this problem, you could just
say IP OSPF cost, let's say.
And by the way, the maximum for any individual interface
is that 65,535, but we could, say, set it to 50,000.
So we can see now that we've manually set it.
So all we've done is override what the auto-cost reference
bandwidth was trying to do on its own.
Now, keep in mind that's not necessarily a problem.
If I turn this back off--
we'll just go back to auto-cost reference bandwidth.
So once again, we're just back to the 65,535.
This does not in any way prevent routes from being used.
If I do a show IP route OSPF, we're
still using all these routes.
Now, they're barely over the 65,535
because the rest of our environment
still has all 1s for all of those gigabit interfaces.
So as suggested, we really should
change the auto-cost reference bandwidth
on all of our devices.
So let's hop over to router 1.
We simply go into router OSPF 1.
And we set the auto-cost reference bandwidth
to 1 million.
Commit the changes.
And we could verify one of our interfaces.
And we see here that just like on IOS XE,
the cost is now 1,000.
You might have also noticed that the command is pretty much
identical.
So we're going to configure the rest of these routers
to all have the same auto-cost reference bandwidth,
but we'll do it very quickly.
There's R2, R3, R4, R5, 6, 7.
8 is done.
And 9 is not running OSPF.
So that just leaves 10.
Now all of our costs should reference 1,000
on all the interfaces.
We can go back and verify this on router 8
since that's the router we've been working on.
So if we just generically look at the routing table again,
we see that these are all values like 67,535 and so on.
Now, this, of course, is because we still
have that ridiculously low bandwidth
on our gigabit-1 interface.
Let's go ahead and fix that.
We'll just say no bandwidth, and it will go back to its default.
We'll look at the routing table one more time.
And we can see that these are more reasonable values given
that all of our interfaces in our environment
now count for 1,000.
You may notice, by the way, as a side note
that a lot of these values end in a 1,
such as let's pick on router 1's loopback here
with a cost of 2,001.
That's because that by default, loopback interfaces always
have a cost of 1.
And that is a route to router 1's loopback.
So it's 2,000 to get to router 1 and then
1 to get to its loopback.
So in this video, we really focused in on the cost value.
We saw how auto-cost reference bandwidth
works, how it calculates the default bandwidth
for each interface based on an inverse proportion
of its bandwidth.
We also saw that we can manually set the cost on an interface,
of course, to manipulate routing.
You could really change the bandwidth
to manipulate routing as well, although that's generally
not recommended because other things actually
do look at that bandwidth value, such as QoS.
So it's really recommended that you change the cost
if you want to manipulate OSPF.
So don't forget that on most of our platforms,
the value of auto-cost reference bandwidth
defaults to 100, which is the equivalent of fast ethernet.
So this does need to be changed on most of today's devices.
But keep in mind Cisco is beginning to change that
on some of their platforms.
So always watch what your platform defaults to.
I hope this has been informative for you.
And I'd like to thank you for viewing.