Alright, so we're going to jump into the lab and this is our topology.
We just have a square of switches and this lab topology is going to be made
available
for you to log in and poke around with spanning tree.
Make sure that we run some of those familiar spanning tree commands and we can
maybe predict
which switches are going to be placing which ports into the blocked state.
And we also want to take a look at the fact that this is a per VLAN spanning
tree environment
meaning that we can expect topologies on a per VLAN basis.
Now this topology is fairly blank from the perspective that we do have. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Now this topology is fairly blank from the perspective that we do have.
Our interface is configured as trunks and our VLANs configured and that's it.
I have not done any special spanning tree configuration.
Every switch is using the default priority which on a Cisco switch is that 32K
value
and then we're just relying on may whichever switch has the best MAC address is
going to
be elected the route.
So let's go ahead and log into the lab environment and take a look at what we
've got.
And so we're starting on switch one here and the classic command is going to be WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And so we're starting on switch one here and the classic command is going to be
show spanning
tree.
So I do a show spanning tree.
It's going to produce the information that tells me a little bit about first of
all the
switch itself.
So pay attention to the fact that this is the bridge ID meaning that this is
the local
ID for switch one.
I'm on switch one.
This is its bridge ID.
Meanwhile the route ID is the information carried in the BP DU that's coming
from the
route and we should all have the same route ID in the spanning tree topology WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
route and we should all have the same route ID in the spanning tree topology
because we
should all agree on who is the route.
So I can look at this and see that I have a local MAC address that does not
match the
route MAC address which means I don't actually or I'm not the route and I know
I'm not the
route.
So another thing or a couple of things to keep in mind first of all we see that
this
is listed for VLAN one.
If I hit space here to look at the next input or output I guess we'll see that
it's VLAN
10 listed with its own set of ports down here in different statuses then I can WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
10 listed with its own set of ports down here in different statuses then I can
see VLAN
20 and VLAN 30 and those are the VLANs that we have configured so that's the
end of the
command.
But as I just run that command again and look at VLAN one we see that a few
things.
First of all VLAN one has its own interface as enabled with its own forwarding
and blocking
statuses.
So we've got the status we've got the role listed here whether it's a
designated port
or a route port and we can tell that at least on this switch we're not blocking WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
or a route port and we can tell that at least on this switch we're not blocking
any ports
for VLAN one.
But when I look at VLAN 10 it lists its own ports because it's running a
different topology
even if the ports are in the exact same status they're both in forwarding the
gig zero zero
is the designated gig zero two is the route and so we could look up here again
at VLAN
one and say well it's the exact same topology and yet that is what per VLAN
spanning tree
is giving us is the fact that we have a topology per VLAN even if the top WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
is giving us is the fact that we have a topology per VLAN even if the top
ologies are identical.
A couple other things to note.
First of all when it says spanning tree is enabled with protocol IEEE protocol
IEEE is
Cisco's way of saying we're running 802.1d per VLAN spanning tree.
So we're not running rapid is basically what this means and we're also not
running MST
which is the industry standard way of creating multiple topologies.
So we have three different options or running the basic 802.1d spanning tree WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So we have three different options or running the basic 802.1d spanning tree
when we see
this and lastly we can see that the priority values not just for my local
bridge ID but
also for the route ID notice that it looks a little off 3,2769 doesn't quite
roll off
the tongue like 3,2768.
So the reason for that is because 3,2768 is a multiple of 4,096 and as we've
said all
priorities must be a multiple of that because that's well we haven't actually
said why yet
I suppose. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
I suppose.
Well here's the reason why because Cisco wants to take the VLAN ID and add it
to the
priority meaning that for VLAN 1 this extended ID concept says I'm going to add
1 to the
priority so instead of 3,2768 it's 3,2768 plus 1 for VLAN 1 and meanwhile if I
look down
here at VLAN 10 we should see that it's 32 not 768 but 778 because we took 3,27
68 and WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
68 and
added the VLAN ID of 10.
So this is why Cisco makes it so that on their switches we can only configure
multiples of
4,096 because by default we're going to add the VLAN ID to the priority value
that we
configure and so more or less all 4,096 values or the next 4,096 values are
taken by a 32K
configuration here's the priority configured and then adding the VLAN ID we
have to be
able to add for example VLAN 4000 which takes us into the 36,000 priority range WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
able to add for example VLAN 4000 which takes us into the 36,000 priority range
at least
that's the priority that would show up over here.
So we see that effect on the root as well the root is clearly doing the same
thing it
has added 10 to the priority value that's configured and so since we have the
same priority we're
going to go by MAC addresses and so if I look at this MAC address for my local
bridge ID
it should be worse than the root and what does worse mean?
Well worse means higher a higher number so 0c they both start with 0c and then WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Well worse means higher a higher number so 0c they both start with 0c and then
we'll
do that and then this has an a which is hex for 10 this has a 4 so 4 is lower
than 10 and
therefore this MAC address is indeed lower and better than the MAC address here
locally
configured.
Lastly we do see the timers that are being advertised a whole load time of 2
seconds
match 8 max age of 20 for a delay of 15 those are the default timers and I have
not changed
them in this environment.
So a little bit of well maybe a lot of information in this particular command WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So a little bit of well maybe a lot of information in this particular command
this is a really
great command to run and then we can also specify the VLAN that I want to see
so if
I just want to see VLAN 20 I can specify that it will just give me VLAN 20's
information.
So let's go find our root bridge remember this is our topology and so we know
that switch
one is not the root here at this point.
So where is the root?
Well if I look here we see my root port is gig 0 2 so switch one thinks that WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Well if I look here we see my root port is gig 0 2 so switch one thinks that
the root is
out this direction the fact that all of these are gig interfaces and we have a
messed with
spanning tree costs probably tells me then that switch 2 is likely not the root
because
it would have gone this way as the root port if switch 2 was indeed the root
but since this
is the root port here then we're guessing it's switch 3 but it could also be
switch 4 and
maybe it's deciding to go this way to get to switch 4 rather than that way. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
maybe it's deciding to go this way to get to switch 4 rather than that way.
So let's go ahead and take a look at that by the way let's go and write down
the MAC
address so we know that switch 1 is 0 CA and so we'll write down 0 CA as the
start of
the MAC address.
So back here we'll go ahead and click on switch 2 and we'll do a show spanning
tree and it
can abbreviate it like that.
So here we have got let's see here so switch 2 is the switch in the upper right WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So here we have got let's see here so switch 2 is the switch in the upper right
we see
that we're still not the root here I've got a cost to the root that's a good
indicator
that I'm not the root it also would tell me if I'm the root and of course last
ly these
MAC addresses would match if I was indeed the root.
So this switch is 0 CA which is higher of numbered and worse than 0 CA 4 so
this would
be 0 CA on switch 2 and we do see a block port here so in gig 0 0 I'm not going WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
be 0 CA on switch 2 and we do see a block port here so in gig 0 0 I'm not going
to mark
that in my diagram yet because I want us to kind of take a look at the topology
and try
to figure that out ourselves but when we see switch 2 having a blocked port on
gig 0
notice that it is listed on a per VLAN basis but it is the same port that's
being blocked
and that's because unless we may change one of the topologies by default
everybody's relying
on the same MAC address for root election therefore the topologies will be the
same
between all of our different VLANs. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
between all of our different VLANs.
So let's keep running commands we'll go to switch 3 show spanning tree our MAC
address
here is 0 CA 4 which should sound familiar because that's what we said was the
root and
indeed look at that it actually says this bridge is the root other switches
right here show
the cost to the root and the port to the root but on switch 3 which is the root
we don't
list the cost or the port we just simply say that we are the root so we can
just take a
look at that and say okay which bridge is the root and you know kind of poke WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
look at that and say okay which bridge is the root and you know kind of poke
around on
the different switches until we find it so that's very useful for us so this is
0 CA
4 on switch 3 so 0 CA 4 and let's go ahead and complete our MAC address
exploration by
looking at switch 4 and do a show spanning tree one thing you might wonder is
does the
MAC address change between VLANs and in our case we've got 0 CA 7 6 here if we
look down WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
look down
here 0 CA 7 6 2 9 B 2 2 9 B 2 alright so the MAC address isn't changing this
can depend
on the platform for the most part I will say that Cisco devices tend to use the
same system
MAC on a per VLAN basis the MAC addresses must be unique within a VLAN and so
if we're
not about different VLANs we can use the same MAC address between the VLANs
because it different
layer two domains so rather than use a bunch of different MAC addresses for all WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
layer two domains so rather than use a bunch of different MAC addresses for all
of the different
VLANs we might have 4000 VLANs on the switch and we don't want to have to use
4000 MAC
addresses let's just use the same MAC address on every single VLAN and most of
the Cisco
products that I've ever used are doing exactly this so this is switch 4 switch
4 is 0 C 7 so
when I complete our MAC address discovery here we're going to find that they
all start with
0 C and so really as a matter of which has the lower number in the third digit WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
0 C and so really as a matter of which has the lower number in the third digit
so again we see
a being 10 then 8 7 down to 4 so 4 is the lowest MAC address and therefore it
is going to be the
root because all of the priority values are 32 K and if they're all the exact
same priority
value then we're going to have to take a look at the MAC address which is the
second half of
the bridge IDs and so we compare our bridge IDs and we find out switch 3 is the
root thanks to WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
root thanks to
this MAC address so here's the question if we were to analyze this diagram
which of these ports would
be in the blocked state we know that switch 3 is the root and importantly we
also know that all of
these links are gig meaning they all have the exact same cost in fact we saw
one of the switches
saying hey I've got a cost of 8 and the reason for that is because each one of
these links has a
cost of 4 so I believe that was switch 2 saying hey in order for me to get to WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
cost of 4 so I believe that was switch 2 saying hey in order for me to get to
the root I'm going to
have to go through two links of 4 which is a total spanning tree cost of 8 but
since they're all
the same cost we can start to think of it more of a hop count so which where in
this network essentially
will we find that we are going to block well this is going to come down to
switch 2 because it's the
furthest away switch 1 and switch 4 both have a cost of 4 to the root where
switch 2 is the only
one that has the lowest cost so when we look at things from switch 2's WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
one that has the lowest cost so when we look at things from switch 2's
perspective it's going to
be receiving an advertisement from switch 1 saying hey I've got a cost of 4 and
I'm going to add my
own 4 to that and say okay so I've got a cost of 8 this direction and I'm also
getting an advertisement
here of a cost of 4 I'm going to add my 4 and say okay I've got an 8 here so I
have two different
equal upstream costs of 8 which one am I going to pick well now we have to
think back to those tie
breakers if I've got two equal costs to the root I have to decide which one is WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
breakers if I've got two equal costs to the root I have to decide which one is
going to be my root
port and which one is another upstream port and remember I block all of my
upstream ports that are
not the root port and that's what prevents loops so we have to think through
the tie breakers because
what really ultimately matters is the cost we always want to choose the fastest
path if we have two
equal cost paths then it can be completely arbitrary so what do we base it on
well the arbitrary
decision is comparing the upstream bridge IDs so I'm going to be comparing 0ca WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
decision is comparing the upstream bridge IDs so I'm going to be comparing 0ca
with 0c7 again it's
arbitrary and it can be arbitrary at this point we just need to pick a path to
use and a path to block
so when I compare those two which one is the worst one and the answer is 0ca is
worse because it has
a higher value meaning that because 0c7 is lower it is the preferred path and
therefore gig 02 is
going to be the root port if gig 02 is my root port that means gig 0 0 here is WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
going to be the root port if gig 02 is my root port that means gig 0 0 here is
going to be placed
into a blocking state so now the moment of truth let's go ahead and flip over
and make sure that
that is indeed the case so switch to gig 0 0 should be blocking come to switch
to and we see gig 0 0
is indeed blocking so the status says block that means it is blocking the role
says alternate that's
what this means we'll talk about what that means coming up that's actually a WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
what this means we'll talk about what that means coming up that's actually a
rapid spanning tree
term and yes even the traditional spanning tree on Cisco platforms we'll still
call it an alternate
an alternate path essentially it's saying that's an alternate path to the root
and therefore we
are going to block it so we see that gig 02 is indeed the root port so we have
correctly predicted
which port would be blocked and this is the fun part about having access to a
lab is I can
create my own topology and say okay well we'll give in maybe these priority
values and these WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
values and these
spanning tree costs let's go ahead and configure that in the topology and make
sure that it's blocking
the ports that I think it's going to block it's a great way for us to get
practice with spanning
tree topologies and I encourage you to take the time to do that given that we
have access to this
lab now one last thing to look at here is if we go back to our topology let's
now say that we want
to talk about a different topology for VLAN 10 so everything in blue was VLAN 1 WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
to talk about a different topology for VLAN 10 so everything in blue was VLAN 1
but now we're
going to talk about VLAN 10 and creating a different topology what if I want
switch 2 to be the root
for VLAN 10 and at that point it would be a different blocked port in the
network probably
switch 3 would have to find a block because it's furthest away from switch 2 so
what am I going to
do here well in order to turn switch 2 into the root I'm going to have to
change the priority WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
change the priority
and so maybe I'll make the priority 4096 that should work fine for VLAN 10 and
it should turn
it into the root so we're going to go ahead and flip back to our topology here
get on to switch 2
do a config t and I'm going to use this command spanning tree and then I have
to specify the VLAN
VLAN 10 and then I can change the priority value now let's say I just say I'm
going to make it
priority 10 I had enter and this is where Cisco says wait a second nope all of WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
priority 10 I had enter and this is where Cisco says wait a second nope all of
our priorities
must be in the increments of 4096 and here's the best part they give us all of
those numbers
so if I don't have the 45 000 value memorized which I certainly don't have that
memorized
it's written right there so I could make it 45 056 and it would take that but I
do have to
pick one of these again I said on the diagram that would make it 4096 so let's
just do that
and now if I do a show spanning tree for VLAN 10 we should see some interesting WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
and now if I do a show spanning tree for VLAN 10 we should see some interesting
things
so first of all we do see that we're the root and the reason has nothing to do
with the MAC address
it has everything to do with the priority again this priority looks funny but
it's 4096 plus 10
and it says that right here for my bridge ID so that's where we get that from
we also notice that
we are going to transition our ports through listening and learning and from
here we're going to also
establish a new blocked port out on the network now we said if we look at our WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
establish a new blocked port out on the network now we said if we look at our
diagram it'll probably
be something over here on switch three so let's go ahead and take a look at
switch three and see
what's transpiring over here show spanning tree VLAN 10 and we do see indeed
that we are blocking
gig 0 2 so let's go ahead and look at our diagram here so we're blocking gig 0
2 why are we blocking
gig 0 2 well for the same reason VLAN 1 chose to block the path to switch 1
switch 1's MAC address WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
switch 1's MAC address
is going to be worse than switch 4's MAC address and so switch 3 has to make
the same decision it
says hey I've got a path to the root this way that's 8 I've got a path to the
root this way that's 8
and so I'm going to choose that arbitrary tiebreaker to suggest that switch 4
is better off than switch
1 thanks to the MAC address so switch 1 just keeps losing these tiebreaker
battles and so this will
be my blocked port on you know going to switch 1 this will be my root port and
meanwhile we see WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
meanwhile we see
we'll see the BPDUs flow down through the network from switch 2 in the same way
that BPDUs for VLAN 1
would be flowing out of switch 3 so we see that we have two completely
different topologies a
different blocked port for VLAN 1 compared to VLAN 10 over here and we can do
this on a per VLAN
basis I could make switch 1 the root for VLAN 20 switch for the root for VLAN
30 that's not
usually how we do it in real world networks but at least we do have options WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
usually how we do it in real world networks but at least we do have options
available so let's go
and flip over to lab a couple of nice commands just to see them in action here
if I do show
spanning tree and then the command blocked ports if I hit enter it will tell me
all of the ports
that are blocked on the switch so that's a really great way just to at a glance
see which ports are
blocked and on a per VLAN basis we'll notice here as well so if I go back to
let's say switch 1
uh not switch 1 switch 2 we should have some blocked ports here on the WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
uh not switch 1 switch 2 we should have some blocked ports here on the
different VLANs and we
do so we see that with that original topology VLANs 1 20 and 30 are all blocked
meanwhile I can also
do a show spanning tree root and it will tell me information about the root for
every single VLAN
as well as importantly the root port how do I get to the root for each VLAN so
these are two
great commands that at a glance tell us a whole lot about the topology and it
doesn't require us to
the full show spanning tree command and try to absorb all of that information WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
the full show spanning tree command and try to absorb all of that information
so that is an overview
of just getting into the lab running some spanning tree commands comparing the
lab topology with our
diagram lots in here and it's time for us to jump in the lab and have some of
that fun ourselves