As a quick review of how Spanning Tree makes its decisions, it's going to
identify which
interfaces are upstream and which interfaces are downstream.
It's going to treat these very differently.
Keeping in mind how we determine the difference, upstream means that we have
superior BPDA
use, maybe I should draw that arrow going the other way, because we have
superior BPDA
use coming in and therefore we're receiving BPDA use. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
use coming in and therefore we're receiving BPDA use.
We're not sending BPDA use upstream.
Instead, we send our BPDA use downstream.
So my BPDA use gets sent downstream because they're inferior BPDA use down here
.
Now the superior versus inferior, that's the whole conversation around path
costs to root
and then we have to use tiebreakers like bridge ID as well as port priorities
and such.
But the driving factor in determining whether it's superior versus inferior is
first and
foremost the cost to the root. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
foremost the cost to the root.
And so as we drill into this concept of cost, we need to keep in mind that this
is the number
one determining factor.
We don't ever worry about tiebreakers if we have a better cost.
And so when we're looking at this, downstream ports are always going to be
designated ports.
These are the port roles that we assign.
And then with upstream, I get exactly one root port and this is supposed to be
the best WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
the best
path, which again, ideally is determined by cost.
But if I have multiple ties or multiple paths with the same cost, I should say,
then at
that point we have to use the tiebreaker method.
So let's say I identify one of these interfaces as my root port.
The other ports are going to go into a blocking state.
And these are known as non-designated ports or NDPs.
So again, I get one root port and the rest are going to be non-designated ports WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So again, I get one root port and the rest are going to be non-designated ports
placed
into the blocking state.
So this is a basic breakdown of how spanning tree achieves a loop free topology
.
I can forward downstream on all of my ports as long as it truly is downstream.
But upstream, I cannot loop traffic back around and send it back up towards the
root.
I have to keep just a single root port.
And that is again, the primary method behind spanning tree making its decisions WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And that is again, the primary method behind spanning tree making its decisions
.
So again, as we've said here, now we've got to identify the best path and the
best path
first and foremost is going to be based on cost.
And so if I want to change what's perceived to be the best path, then I might
want to consider
changing costs.
Let's remember how this works as well.
So we are likely going to have a string of switches in a network.
So potentially several switches hanging off of each other. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So potentially several switches hanging off of each other.
We start up here at the root because the root is going to send out the BP to
use.
So it sends a BP to you and says, hey, my cost to the root, guess what?
It's zero because it's me.
And so I start with this root cost concept saying that it's just zero from my
perspective.
Well this switch here in the middle is going to receive that and it has to
determine its
own cost to the root if it uses this path.
Now we start with the advertised cost and we are going to add the link cost as WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Now we start with the advertised cost and we are going to add the link cost as
it comes
in.
So this is an inbound concept.
This is very important for us to recognize the concept of an inbound versus out
bound method.
This is inbound, meaning I only add the link cost as it comes into my switch
onto a link,
which means that it's the local link cost as well.
If I disagree on the link cost between two switches, it doesn't matter. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
If I disagree on the link cost between two switches, it doesn't matter.
The root could say this has a link cost of 100.
I could say as a cost of four and I'm going to go by my own local cost because
I have
no idea what the root thinks it is and it doesn't matter because it doesn't
advertise
it.
It's not an outbound concept.
It's not telling me, hey, by the way, this link has a cost of 100.
Instead as the BP to you comes into this port, I recognize that it has a link
cost of four
regardless of what the root thinks it is or whatever switches on the other side WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
regardless of what the root thinks it is or whatever switches on the other side
.
So at this point, I can take the advertised cost and add my link cost and now
my root
cost or path cost is going to be zero plus four, which is four.
So that is what this middle switch perceives.
And as long as this port is decided to be my root port, that is going to stay.
If I have another path that goes to the root, maybe eventually I swing over to WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
If I have another path that goes to the root, maybe eventually I swing over to
a different
link, but in this mini topology here, it has a path cost of four.
Now next, we're going to also advertise a BP to you cost or send a BP to you
with a
cost and I'm going to advertise my cost.
I'm going to say it's a cost of four and maybe this has a cost of 19 down here.
That would be the default cost for a 100 meg link.
And so I receive the BP to you and once again, I'm going to add the four, which WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And so I receive the BP to you and once again, I'm going to add the four, which
is advertised
to the 19, which is my local link cost from an inbound perspective.
And I'm going to decide that my path cost to root is 23.
Now if I were to advertise the BP to you further downstream, I would advertise
a cost
of 23 and the next switch downstream would be responsible for adding its own
local link
cost and determining what its cost to the root becomes. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
cost and determining what its cost to the root becomes.
So keep in mind, again, just what it means to have an inbound nature that I'm
adding
costs to the advertised cost as it comes into an interface.
Now we talked earlier about how default costs are calculated.
We have the short and long method and by default, iOS Xe uses the short method.
The short method essentially assigns a 100 meg link to a cost of 19, a one gig
to a cost WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
to a cost
of four.
And then from here, a 10 gig link gets a cost of two and anything greater than
10 gig gets
a cost of one, which is a problem because our switches can't differentiate
between a
20 gig port channel and a 40 gig link or a 100 gig link.
It's all the same.
It's all a cost of one.
And so this is why we want to potentially configure a change here to use the
long path
cost method.
And the long path cost method gives us a cost here where one gig is going to be WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And the long path cost method gives us a cost here where one gig is going to be
20,000.
10 gig is going to be 2000.
And we see we've got room to grow here for things that are over 10 gig.
Now just keep in mind that we don't advertise costs again down here.
The root didn't advertise its cost of 100 downstream.
Instead, it's just a local value.
It's how a switch determines its link costs.
Now that said, we would ideally make this a global change in a real world
network.
We'd absolutely want this to be global.
But if I connect a short calculating switch to a long calculating switch, WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
But if I connect a short calculating switch to a long calculating switch,
nothing's going
to break per se.
It's just going to change the way that, you know, I advertise costs.
If I have a switch up here and it's getting BPDUs on a link that, let's say
this one
is using long, maybe it's getting it on a link that's 20,000 cost.
So at this point, I'm going to advertise my cost of 20,000, assuming I'm
directly connected
to the root. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
to the root.
And this switch down here has a short configuration.
And it's going to receive that on a gig link.
And so it's going to perceive that my cost is 20,000 and 4, which seems a
little funny
because I took my cost of 4 and added it to the advertised cost of 20,000.
So it creates some weird numbers, but technically speaking, it will work.
It just might not end up blocking the links that we expect to block.
So again, in the real world, absolutely make this a global change. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So again, in the real world, absolutely make this a global change.
All of our switches should be using the same setting there.
So let's draw out a quick example of a larger topology here.
So let's say we've got switch one as the root.
And then we've got a pair of switches here, switch two and switch three, which
connect
in to the root and then switch four down here, which mutually hangs off switch
two
and switch three.
So let's just assume all of these links are 10 gig.
And we're also using long path cost method. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And we're also using long path cost method.
So we're looking at cost of 2000 everywhere.
So again, we're going to look at the cost to root and switch one sees a cost of
zero to
itself.
And then it pushes BPDUs downstream, switch two and switch three, receive it on
a 10 gig
link and understand that, well, that's a cost of 2000.
Therefore, my cost to the root is 2000.
These switches both advertise downstream that, hey, I've got a cost of 2000 to
the root.
And this is where switch four, once the choose the best path, again, it WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And this is where switch four, once the choose the best path, again, it
recognizes their superior
BPDUs, both of these are going to be considered upstream.
I therefore have to block one of these and make the other one my root port.
So which one do I make it?
Well, again, if the cost is equal, this is going to result in these arbitrary
tiebreakers.
And I'm going to first and foremost base it on bridge ID.
So the bridge ID is going to be compared with the upstream switches. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So the bridge ID is going to be compared with the upstream switches.
So let's say this switch starts with a zero A and its MAC address, the switch
over here
starts with zero B, the lower MAC address will win and therefore switch for
prefers the path
to switch to and we end up blocking this link.
Now us as the network admins, we might look at this and say, okay, that's well
and good,
except switch two is kind of old or we're going to replace it, something like
that.
We just don't trust it.
I don't want to use this path, instead I really rather use the path to switch WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
I don't want to use this path, instead I really rather use the path to switch
three.
The problem is I can't actually change these MAC addresses.
And so therefore the switch two is going to continue to win the tiebreaker.
So the idea here is I don't want to get to the tiebreakers.
I want to change this reality.
I don't want the costs to be equal.
So what can I do here?
Well what I could do is recognize that since switch four is also seeing these
links as WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
links as
2000 and 2000, which by the way therefore it has a cost to the root of 4000
regardless
of which link we choose.
Well what if I were to add a zero to this link over here?
I can do a manual override of my link costs.
I don't have to abide by the default that the system is using.
So I could manually say hey you have a cost of 20,000 and now all of a sudden
this is WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
this is
the preferred path.
So my cost this way is going to be 22,000.
The 2000 that's advertised and then the 20,000 inbound on my own interface.
But on this side over on the right it's still going to be 4000, 2000 advertised
and 2000
coming in.
And therefore switch four will decide to block this link bringing this link
online.
So this is a way that we can change costs in the network to manipulate which
ports are
being blocked.
We just always have to keep in mind that cost is an inbound feature. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
We just always have to keep in mind that cost is an inbound feature.
But the good news is cost is considered first before we get to the tiebreakers.
And so it is a great method for manipulating the spanning tree topology in my
network.