A part.
Cost is the cost to get to the route bridge or route switch.
Path costs are calculated from the cost of a port and the number of links to get to the root bridge.
As an example, a one gigabit per second link may have a cost of four.
If a switch is directly connected to the router switch, the path cost would be four.
Because there's a single link with a cost of four.
However, if switch three had a link to switch two with a port cost of four and switch two had a link
to switch one, which is the route with a port cost of four.
The cost of switch three to get to switch one using these links would be eight because it's four plus
four.
To get to the root bridge.
Support costs are incremented in a similar way to hop count in a protocol such as rep.
So path cost is calculated from the sum total of port costs to get to the root bridge based on a path
of multiple links to the root bridge.
So port costs do have default values on a per port and per VLAN basis.
You can change the port cost values, but they do have defaults defined by the triple e.
There are two standards the triple E cost 1998 and triple E cost 2004.
Some Cisco switches still use the old path cost and you can change the switch to use the new path cost
by using the command spanning tree path cost method long.
In this topology.
I have five switches switch one, two, three, four and five.
Nothing has been configured on these switches except for the switch names, so they are running a default
configuration.
I've connected hubs to the switches so that we can do Wireshark captures in this topology.
But please note this is not a recommended spanning tree topology.
It's simply used to demonstrate some of the features and functions of spanning tree.
So let's determine who the root switches on switch.
One show spanning tree.
Is the switch, the root of the spending tree?
The answer is no.
We can see that the switch has a mac address of the following, but the route has a mac address of the
following.
The local switch also has a path cost to get to the route switch via Port one, which is gigabit zero
zero.
In other words, it's cost to get to the route bridge is four based on the triple E 1998 specification.
Scrolling down, we can see that gigabit zero zero is the root port for the switch.
So in other words, because the port cost is four, it's most likely that switch two is the root switch.
Because this port has a cost of fall and the port cost to get to the roots, which is four.
In other words, there'll be a single link to get to the root bridge.
One switch two shows spanning tree.
The switch is the route and we can see it displayed clearly in this output.
You can also see that the Mac address of the root and the local bridge or local switches the same.
What you'll also notice is that all ports of forwarding.
So this is the route switch currently.
Let's see what BPD use are being advertised by that switch.
So he has a BPD you.
The destination of the frame is the well known Mac address for spending tree.
In the spending tree output.
We can see that the switch is running rapid spanning tree will change that in a moment, but notice
the path cost is zero.
That's the route identifier and the local bridge identifier of the switch and the values are set the
same.
Other information, including the max age.
Hello time and for delay are shown in the output.
So I'll stop that.
Why shock capture?
So Switch two is currently advertising that it's the root of the topology.
Let's have a look at what switch three shows with regards to path cost.
Shows spanning tree.
It also has a path cost of four and it's using port one.
In other words, gigabit is zero zero as its root port.
So this port is the root port.
To get to the root of the spanning tree and this is the length of switches using with a path cost of
four.
What about switch for.
Shows spanning tree.
We can see here that the path cost is eight, not four.
And the port that it's using is gigabit is zero zero.
So in other words, this port is the port that it's using to get to the root bridge.
It has a path cost of four because this link has a cost of four.
And this link has a cost of four.
On Switch three.
We could use the command show interface spanning tree interface gigabit zero three cost.
To see that it's advertising a cost of fall on the sport.
So from its point of view, it's got a cost of four plus four to get to the Route Bridge.
We can also use the command show spanning tree route to see that the local switch is using gigabit zero
zero as its root port.
The cost to get to the root is eight.
The root ID or bridge ID is the following.
So four plus four gives us eight.
What about switch five?
So switch five shows spanning tree.
There's the command.
The output shows us that the cost to the route is 12.
In other words, four plus four plus four is 12.
So as you can see, the plot cost is incrementing on a per link basis.
Once again show Spending Tree Root podcast to get to the root is 12.
The local root port is gigabit zero zero.
That port has a port cost of four because the switches are using the 1998 cost at one gigabit per second.
Port has a path cost of four by default.
So let's make some changes.
We'll make switch one the route, see how that affects the BPD use advertised by switch two and we'll
change the path cost method to long to see how that affects the path costs of the switches.