07-02-2008 06:01 AM - edited 03-05-2019 11:57 PM
Many of the STP commands give you a "cost" value as part of their output. I'm trying to decipher between which of these is a cost of the interface and which is the cumulative cost to reach the root. Is there a command that will specifically show me the cost to the root? Can you get an output that shows costs the way a routing table output would?
thanks
07-02-2008 06:59 AM
"sh spanning-tree root" will give you the root cost to the bridge. This is the cumulative cost to get to the root.
you can google a chart to see the speed of each interface and its corresponding cost. 1gig="4" and 100mbps = "19"
07-02-2008 09:18 AM
The cumulative cost to the root is something that is a characteristic of the STP instance as a whole. You will thus see it at the top of the show spantree/spanning-tree display, along with the root id, timers etc...
The cost on a port is characteristic... of the port;-) You will see this information along with other port information like the role and the state.
So the keyword is identical (cost), but where it is displayed in the output makes it easy to differentiate between the two.
HTH,
Francois
07-02-2008 11:38 AM
Hello Jason,
as told in other posts you can find the cost to the root on top of sh spanning-tree vlan
you can check the STP cost of an interface looking at the last lines of the same show
STP Root can be different for different vlans (PVST+ = Per Vlan Spanning Tree)
If you want to understand how the cumulative cost is calculated make a drawing of a network of switches.
The key point is that the cost is calculated in ingress as entering the port : for a non-root switch the root port is the port with the lowest cumulative cost to the root bridge.
Cost on port X = (cumulative cost received on Port X) + Port X.cost
So cost to root for the root bridge itself is zero.
Cost to reach the root from a switch directly connected to the root is:
0 + cost of incoming interface
if the root port of switch SWj has cost N this value is reported on the STP BPDUs that are sent out by Swj on all its non root ports that are in forwarding state.
If SWk is connected to SWj it will calculate the cost as N + its own interface's cost.
And so on.
Standards costs are based on interface speed with bigger cost for slower interfaces.
hope to help
Giuseppe
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide