Non-root bridges need to find the shortest path to the root bridge. What will happen if we have a mix of different interface types like Ethernet, FastEthernet and Gigabit? Let’s find out!
Here’s the topology I will use to explain the spanning-tree cost calculation:
In the picture above we have a larger network with multiple switches. You can also see that there are different interface types, we have Ethernet (10 Mbit), FastEthernet (100Mbit) and Gigabit (1000Mbit). SW1 on top is the root bridge so all other switches are non-root and need to find the shortest path to the root bridge.
Bandwidth | Cost |
10 Mbit | 100 |
100 Mbit | 19 |
1000 Mbit | 4 |
Spanning-tree uses cost to determine the shortest path to the root bridge. The slower the interface, the higher the cost is. The path with the lowest cost will be used to reach the root bridge.
Here’s where you can find the cost value:
In the BPDU you can see a field called root path cost. This is where each switch will insert the cost of its shortest path to the root bridge. Once the switches found out which switch is declared as root bridge they will look for the shortest path to get there. BPDUs will flow from the root bridge downwards to all switches.
Here’s an example of the different spanning-tree costs for our topology:
SW2 will use the direct link to SW1 as its root port since this is a 100 Mbit interface and has a cost of 19. It will forward BPDUs towards SW4; in the root path cost field of the BPDU you will find a cost of 19. SW3 is also receiving BPDUs from SW1 so it’s possible that at this moment it selects its 10 Mbit interface as the root port. Let’s continue…
This picture needs some more explanation so let me break it down:
- SW3 receives BPDUs on its 10 Mbit interface (cost 100) and on its 1000 Mbit interface (cost 4). It will use its 1000 Mbit interface as its root port (shortest path to the root bridge is 19+19+4=42).
- SW3 will forward BPDUs to SW4. The root path cost field will be 100.
- SW4 receives a BPDU from SW2 with a root path cost of 19.
- SW4 receives a BPDU from SW3 with a root path cost of 100.
- The path through SW2 is shorter so this will become the root port for SW4.
- SW4 will forward BPDUs towards SW3 and SW5. In the root path cost field of the BPDU we will find a cost of 38 (its root path cost of 19 + its own interface cost of 19).
- SW3 will forward BPDUs towards SW5 and inserts a cost of 42 in the root path cost field (19 + 19 + 4).
The complete picture will look like this:
Hi Rene,
I am not clear about the root bridge. I mean why are we finding the root port(for non-root bridge) to reach the root bridge. Is it like in practical scenario, the root bridge is set as destination to one of the server?
Hi Rene,
I have a question to the description on the third topology. You say:
“SW3 will receive BPDUs on its 10 Mbit interface (cost 100) and on its 1000 Mbit interface (cost 4). It will use its 1000 Mbit interface as its root port.”
Should SW3 receive on 10Mbit interface BPDUs of 0 instead of 100 because they are generated by the root? And then SW3 add its port cost of 100 and send it to SW4 and SW5?
Is it correct that the BPDU sending SW don’t add the costs of the outgoing interface/link, only the links that left behind? So the receiving SW has to add the co
... Continue reading in our forumHello Laz,
I have one question and I am going to use the below topology.
SWITCH_1=================SWITHC_2
FA0/11-------------------------------------FA0/1
FA0/22------------------------------------FA0/2
In this scenario, I have switch 1 connected to switch 2 through two Fast Ethernet links as it is drawn above. Switch 1 is the root bridge. Switch 2 has to pick one link between fa0/1 and fa0/2 links as the root port and block another one. Therefore, Switch 1 will look at the cost of fa0/1 and fa0/2 links and they both are the same which is 19. Now Switch 1 wi
... Continue reading in our forumHello Bharath.
You’ve almost got it!! Here is a bit of clarification:
_OK, this one goes without saying…_
_You got this one down pat._
_I’m assuming in your explanation abov
... Continue reading in our forumHi Rene,
Could you just explain me the ports roles and states for your mentioned diagram. I have understood about the root port election but i am confused with roles and states. Thanks in advance.
//cdn-forum.networklessons.com/uploads/default/original/1X/f36f3ee7165d02a3882d931f0f34fce3b974b988.png