cancel
Showing results for
Did you mean:
New Member

## How does STP calculate cost to the root ?

Does STP use something similar to a routing protocol.Is the cost to the root switch based on metrics and link states ? I understand how the root switch Is chosen using the mac address /8 byte combo but I don't understand how STP calculates cost when choosing a root port.

2 ACCEPTED SOLUTIONS

Accepted Solutions
New Member

## How does STP calculate cost to the root ?

hi,

in the port election process, ports get assigned a port cost and port priority.

the lower the port cost and priority the more preferable the port. the cost is an inverse reflection of the bandwith of the port.

the current switches use the following port costs:

10Gbps = 2

1Gbps = 4

100Mbps = 19

10Mbps = 100

the port priority defaults to 32.

port costs are calculated from the root switch.

if a switch tries to choose the root port it will always take the path with the lowest accumulated path cost to the root.

florian

Cisco Employee

## How does STP calculate cost to the root ?

For the Root Switch election only the Bridge ID Matters . Bridge ID is the combination of Priority  and Burnt-in Switch Mac address if it is CST (Common Spanning tree) or priority + Vlan ID + Burnt in Switch MAC in case of PVST.

Hope this helps.

-Vijay

6 REPLIES
New Member

## How does STP calculate cost to the root ?

hi,

in the port election process, ports get assigned a port cost and port priority.

the lower the port cost and priority the more preferable the port. the cost is an inverse reflection of the bandwith of the port.

the current switches use the following port costs:

10Gbps = 2

1Gbps = 4

100Mbps = 19

10Mbps = 100

the port priority defaults to 32.

port costs are calculated from the root switch.

if a switch tries to choose the root port it will always take the path with the lowest accumulated path cost to the root.

florian

New Member

## How does STP calculate cost to the root ?

Thanks! This clears up a lot.I don't understand why the ICND2 cert. book doesn't mention this.It helps a lot In making sense of whats going on.

New Member

## How does STP calculate cost to the root ?

there are a couple of things the swich does when choosing a root or a designated port.

for instance if the port costs of the switch are all the same(e.g. 24 port gig switch) then the swich will choose the neighboring switch with the lowest switch ID.

if multiple paths all go through the same neighboring switch it will choose the port with the lowest port priority and if all have the same port priority it will take the physically lowest numbered port on the switch.

and these steps are pretty much the same when choosing the designated port.

florian

New Member

## How does STP calculate cost to the root ?

Thanks for your help.I have one last question If thats Ok .Does bandwidth factor In when choosing the root switch or Is the choice of root switch a bit like a lottery.

Cisco Employee

## How does STP calculate cost to the root ?

For the Root Switch election only the Bridge ID Matters . Bridge ID is the combination of Priority  and Burnt-in Switch Mac address if it is CST (Common Spanning tree) or priority + Vlan ID + Burnt in Switch MAC in case of PVST.

Hope this helps.

-Vijay

New Member