|
0:00:11
|
Before we get into our next topics we're going to spend a couple minutes to review
|
|
0:00:16
|
with spanning tree protocol and the root bridge election and then the path selection
|
|
0:00:21
|
and how we can modify those decisions.
|
|
0:00:26
|
So we saw yesterday
|
|
0:00:28
|
We essentially have a three step process that we need to go through when we are running spanning tree.
|
|
0:00:33
|
First we need to elect the root bridge that is going to be the reference point for the rest of the tree.
|
|
0:00:38
|
Again, this is done based on the bridge ID
|
|
0:00:41
|
that contains the priority, the system ID extension, and then the MAC address of the device.
|
|
0:00:47
|
The lowest bridge ID is going to be preferred
|
|
0:00:50
|
so if there is a tie in the priority, then we essentially look at whatever device has the lowest MAC address.
|
|
0:00:56
|
When we are changing the priority a lower numerical value is going to be better
|
|
0:01:01
|
and we have to change it in increments of 4096.
|
|
0:01:04
|
So if we say spanning tree VLAN one priority one
|
|
0:01:09
|
the command line is just going to spit back an error message
|
|
0:01:11
|
and then tell us what are the proper values that we can actually configure.
|
|
0:01:16
|
So if we were to look at switch one and try this out
|
|
0:01:19
|
if we say spanning tree VLAN one priority one
|
|
0:01:26
|
it says these are the valid values - it has to be in increments of 4096.
|
|
0:01:31
|
Now the reason we have this is that the newer specification of spanning tree has to take into account
|
|
0:01:37
|
the system ID extension,
|
|
0:01:40
|
which again essentially is the VLAN number
|
|
0:01:43
|
or in the case of today when we're looking at multiple spanning tree
|
|
0:01:47
|
it's going to be the MST instance number.
|
|
0:01:50
|
So the priority value plus the system ID extension
|
|
0:01:53
|
ensure that we have a unique bridge ID on a per spanning tree instance basis.
|
|
0:01:59
|
So even though we are reusing the same MAC address over and over
|
|
0:02:03
|
since the VLAN number is always unique to begin with
|
|
0:02:06
|
we end up in a unique bridge ID.
|
|
0:02:11
|
So once we elect the root bridge
|
|
0:02:13
|
we could look at the show spanning tree for a particular VLAN
|
|
0:02:16
|
or we could look at the show spanning tree root
|
|
0:02:19
|
which is going to show us quickly what is the root bridge ID
|
|
0:02:22
|
for every single instance of spanning tree that we're running.
|
|
0:02:26
|
So on switch one if we look at the show spanning tree root
|
|
0:02:31
|
in this case we have VLAN one and then VLAN 10, 20, 30, 40, up through 100.
|
|
0:02:37
|
We can see that the root bridge is the same for every particular instance.
|
|
0:02:43
|
So whoever has this particular MAC address
|
|
0:02:46
|
had a default priority of 32768
|
|
0:02:50
|
because if we add the VLAN number 232768
|
|
0:02:57
|
we could see that's what the priority value is.
|
|
0:02:59
|
So VLAN ten is 32768 plus the system ID extension of ten.
|
|
0:03:05
|
Our end to end cost to get there is 31.
|
|
0:03:09
|
Then we can also see the timers that that particular root bridge is advertising.
|
|
0:03:14
|
So we'll see when we modify the timers here
|
|
0:03:17
|
the value that the root bridge has configured is the value that the rest of the network is going to be using.
|
|
0:03:24
|
So setting the timers locally doesn't affect anything.
|
|
0:03:30
|
Okay, there's a question - why does the bridge ID have to be different between the VLANs?
|
|
0:03:37
|
Because when we receive the BPDUs
|
|
0:03:40
|
that's how the router is identifying what particular VLAN instance that BPDU is relating to.
|
|
0:03:49
|
So inside the bridge ID it's basically telling us what particular of instance of spanning tree that packet is related to.
|
|
0:03:58
|
So previously, before we had the system ID extension, we had to use a separate MAC address
|
|
0:04:04
|
per instance but now we can see that the MAC address field can be the same
|
|
0:04:09
|
as long as the addition of the priority and the MAC address is going to give us a unique identifier.
|
|
0:04:21
|
Okay, then we saw that we can change the ports role
|
|
0:04:25
|
which would affect either the root port election or the designated port election
|
|
0:04:30
|
where the root port is essentially the interface that has the lowest total cost value in order to reach the root bridge.
|
|
0:04:38
|
So if we look at all of the BPDUs that we are receiving in
|
|
0:04:42
|
where the BPDU is the bridge protocol data unit
|
|
0:04:45
|
basically just means a spanning tree packet.
|
|
0:04:47
|
So if we look at all the spanning tree packets coming in
|
|
0:04:50
|
if we look at what's the total cost of what's coming in plus our local link costs.
|
|
0:04:56
|
So if my link cost is one and I'm receiving a BPDU that says it has a cost of ten
|
|
0:05:02
|
it means that my total root path cost would be eleven if I were to use that link.
|
|
0:05:08
|
So it's a pretty simple algorithm. You're just adding the cost on a hop by hop basis.
|
|
0:05:12
|
So if we look at whatever is the lowest end to end cost
|
|
0:05:14
|
that interface is going to be used as the root port.
|
|
0:05:18
|
If for some reason multiple interfaces have the same total cost value
|
|
0:05:23
|
then we go down to the lowest upstream bridge ID
|
|
0:05:27
|
for the tie breaker or if that is still the same we go to the lowest upstream port ID.
|
|
0:05:35
|
Now again, the very last decision, which is the port identifier
|
|
0:05:40
|
this is only used if the upstream bridge ID is the same
|
|
0:05:44
|
which means essentially that you would have two links to the same upstream switch.
|
|
0:05:50
|
So if there's two links between switch one and switch two
|
|
0:05:53
|
which ever is the downstream switch
|
|
0:05:55
|
would essentially be making the decision based on the upstream switch's port identifier.
|
|
0:06:01
|
Which again, the port identifier is made up of two fields - it's the port number that the switch is generating locally,
|
|
0:06:08
|
kind of like an SNMP interface index number,
|
|
0:06:12
|
and then the port priority value which will be 128 by default.
|
|
0:06:18
|
So to change this selection of either the root port or the designated port
|
|
0:06:25
|
usually the easiest way to do this is just to modify the path's cost.
|
|
0:06:29
|
We can do this by directly changing the cost at the interface with the spanning tree cost command
|
|
0:06:34
|
or the spanning tree VLAN cost
|
|
0:06:36
|
or we could change the bandwidth on the interface which then implicitly changes the cost value.
|
|
0:06:44
|
If for some reason we don't want to use the cost directly to modify the path selection
|
|
0:06:50
|
we could lower our bridge ID by changing the priority
|
|
0:06:55
|
because when we're looking at either the interface to use as the root port or what interface would become the designated port
|
|
0:07:01
|
whichever device has the higher, excuse me, the lower bridge ID
|
|
0:07:07
|
that would be the one that is preferred.
|
|
0:07:10
|
Then our last case we could change the port priority but again that's only if you have multiple links between the same two switches.
|
|
0:07:19
|
So when we're verifying this, you need to make sure that you are looking at the show spanning tree detail
|
|
0:07:26
|
or the show spanning tree VLAN detail
|
|
0:07:29
|
because that will show us not only our local interfaces
|
|
0:07:33
|
but all of the information that we are receiving in from the upstream bridges.
|
|
0:07:41
|
So if we look at this on switch one
|
|
0:07:43
|
and let's say that we're talking about just VLAN one.
|
|
0:07:46
|
We'll say show spanning tree VLAN one.
|
|
0:07:52
|
It says that there's three interfaces we are running this instance on.
|
|
0:07:59
|
It's FastEthernet three.
|
|
0:08:05
|
Thirteen and sixteen.
|
|
0:08:09
|
Okay, FastEthernet three is going down to one of the end hosts so that is not going to be part of the path selection.
|
|
0:08:18
|
So basically we need to choose between these two interfaces - between thirteen and sixteen.
|
|
0:08:23
|
Now with this output
|
|
0:08:25
|
we don't know what the total end to end cost is on these links. We only know that the local interface cost is nineteen.
|
|
0:08:33
|
Also, the local interface port ID is made up of the priority 128 and then the numbers 15 and 18 respectively.
|
|
0:08:42
|
So we can see this port number, it doesn't always correspond directly to the interface number
|
|
0:08:47
|
and if you have any platform that uses multiple modules or multiple line cards
|
|
0:08:52
|
like stackable 3700s or 4500 or 6500
|
|
0:08:57
|
then when you have the multiple slot values like FA2/5
|
|
0:09:02
|
then the port number is just going to be something random that the switch is generating internally.
|
|
0:09:08
|
So to figure out really what's going on
|
|
0:09:11
|
with this selection, we would need to look at the show spanning tree VLAN one detail.
|
|
0:09:19
|
Switch one says that there's these two links that we could possible use.
|
|
0:09:22
|
One of them is blocking; one of them is forwarding.
|
|
0:09:26
|
So now we need to figure out why are we choosing the second interface as the root port as opposed to the first one.
|
|
0:09:35
|
First thing we would look at is what is the total end to end cost.
|
|
0:09:39
|
For both of these interfaces my local cost is 19.
|
|
0:09:44
|
The upstream devices have a cost of 19 and zero.
|
|
0:09:50
|
So it means that if I were to use the second interface, my total cost is 19.
|
|
0:09:56
|
If I were to use the first interface, the total cost is going to be 38.
|
|
0:10:01
|
So we're choosing the link with the lower cost of 19.
|
|
0:10:04
|
That's going to be the root port and the closest interface from the end to end cost perspective.
|
|
0:10:13
|
So if we wanted to
|
|
0:10:18
|
Oh, I'm sorry. You're right. It's not...I'm looking at the wrong field there.
|
|
0:10:23
|
The designated path cost there is 12.
|
|
0:10:26
|
Okay, so it's 12 plus 19.
|
|
0:10:29
|
So we have 31 here versus 38.
|
|
0:10:35
|
So in either case the second interface is still
|
|
0:10:38
|
closer but we're adding basically the designated path cost
|
|
0:10:42
|
that means that is the cost
|
|
0:10:45
|
of the switch that has the designated port.
|
|
0:10:50
|
So if we were to look at this from the diagrams perspective
|
|
0:10:54
|
and we look at
|
|
0:10:59
|
switch one
|
|
0:11:03
|
It says that our root port
|
|
0:11:08
|
was which of these interfaces? The root port was FastEthernet 16.
|
|
0:11:14
|
So this is the root port. This one is blocking.
|
|
0:11:19
|
If our port is blocking it means that on the other side that should be the designated port.
|
|
0:11:27
|
Likewise on the other side of our root port, that's going to be the designated port
|
|
0:11:31
|
because designated is facing downstream.
|
|
0:11:34
|
So when switch one is looking at it's local interface FastEthernet 16 with a cost of 19,
|
|
0:11:41
|
plus the designated cost of 12,
|
|
0:11:45
|
that's what switch three is using as it's cost to reach the root.
|
|
0:11:51
|
So it's essentially like a local cost and an advertised cost.
|
|
0:11:56
|
Then between switch one and switch two
|
|
0:11:58
|
switch one is saying my local interface has a cost of 19
|
|
0:12:02
|
and that I am learning from the designated port also a cost of 19
|
|
0:12:06
|
so both of those together would be 38.
|
|
0:12:09
|
So we're simply going to choose the lower one which is 31 versus the 38.
|