cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1781
Views
0
Helpful
6
Replies

How does STP calculate cost to the root ?

Reprovoid
Level 1
Level 1

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

flokki123
Level 3
Level 3

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

View solution in original post

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

View solution in original post

6 Replies 6

flokki123
Level 3
Level 3

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

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.

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

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.

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

Thanks for your help!

Review Cisco Networking products for a $25 gift card