Unit 1: Network Infrastructure
This will allow you to demonstrate your networking skills, knowledge, and abilities, with a focus on enterprise-level switching, routing, and multicast components that support cross-platform (inter)operability and integration with the most recent software-defined technologies.

Spanning Tree Cost Calculation

Locating the root bridge quickly is essential for non-root bridges. If we use a combination of interface types such as Gigabit, FastEthernet, and Ethernet, what will happen? What do you think?

To illustrate how to compute the spanning-tree cost, We will use the following topology:

The picture above shows a bigger network with more than one switch. You can also see that there are various types of interfaces. Ethernet is 10 Mbit, FastEthernet is 100 Mbit, and Gigabit is 1000 Mbit. As you can see, SW1 is the root bridge. All the other switches are not root and need to find the Shortest path to get to SW1.

Bandwidth

Cost

10 Mbit

100

100 Mbit

19

1000 Mbit

4

In order to find the root bridge’s shortest path, spanning trees employ cost. If the interface is slower than the cost will be higher. To reach the root bridge, the most cost-effective method will be followed.

The cost value can be found here:

A root path cost field is visible in the BPDU. Here, every switch will put the cost of its shortest path  to the root bridge. The switches will seek the shortest route to the stated root bridge after they have learned which switch it is. All switches will get BPDUs as they descend from the root bridge.

The various spanning tree costs applicable to our topology are illustrated here:

Since the straight link to SW1 is 100 Mbit and costs 19, SW2 will use it as its root port. The BPDU will be sent to SW4, and the root path cost field of the BPDU has a value of 19. Since SW3 is also getting BPDUs from SW1, it’s possible that it has chosen its 10 Mbit link as the root port right now.

Above figure requires further explanation which is as below:

  • SW3 gets BPDUs on its 10 Mbit interface,  with cost as 100, and its 1000 Mbit interface, with cost  as 4. The shortest path to get to the root bridge is through its 1000 Mbit link(19+19+4=42).
  • BPDUs will be sent from SW3 to SW4. The cost field for the root path will be 100.
  • SW4 will receive a BPDU from SW2 along with the root path cost of 19.
  • SW4 will receive a BPDU from SW3 along with the root path cost of 100.
  • The path through SW2 is shorter, so this will be SW4’s root port.
  • BPDUs will be sent from SW4 to SW3 and SW5. We will find a cost of 38 in the BPDU’s root path cost field. This is made up of its own interface cost of 19 and its root path cost of 19.
  • BPDUs will be sent from SW3 to SW5. A cost of 42 will be added to the root path cost field by SW3 (19 + 19 + 4).

This is how the whole picture will look:

The BPDUs will be received by SW5 from SW3 and SW4. In the BPDU, we will examine the root path cost field, and the information that we will find there is as follows:

• The cost of 42 through BPDU from SW3
• The cost of 38 through BPDU from SW4

SW5 by adding the cost of its interface to the cost of SW4, the total cost to reach the root bridge through SW4 is calculated to be 57, which is equal to 38 plus 19 (the cost of the 100 Mbit interface). The sum of 42 plus 100 (10 Mbit interface) costs equals 142, which is the total cost to reach the root bridge through SW3. As a consequence of this, it will choose the interface that is oriented toward SW4 as our root port.

Take into consideration that switches are only able to make judgments based on the BPDUs that they receive! What the topology actually looks like is completely unknown to them. The one and only thing that they are aware of is the interface that brought them the best BPDU. The BPDU that has the hortest path to the root bridge is the best one!

How about if the cost is same? [/restrict]

Look at the image up there. SW2 is not a root bridge, but SW1 is. For redundancy’s sake, we’ve set up two connections between these switches. Since redundancy implies loops, spanning tree will block one of SW2’s interfaces.

The root path cost field will remain same even though SW2 will receive BPDUs on both interfaces! Do you know which one we’re going to block? It will be fa0/2 or Fa0/1? When the cost remain equal, spanning tree will look at port priority. Since all interfaces have the same port priority by default, the interface number will determine if there is a tie.

This is where fa0/2 will be blocked because it has the lowest interface number. We can change the value of port priority, which lets us pick which interface will be blocked.

When spanning tree has to decide what to do, it looks at this list below:

  • Lowest bridge ID: The root bridge is the switch with the lowest bridge ID.
  • Lowest path cost to root bridge: If the switch gets more than one BPDU, it will choose the interface that has the best path cost to the root bridge as the root port.
  • Lowest sender bridge ID: If there are two switches that a switch can use to reach the root bridge and both cost the same, the switch will choose the interface that connects to the switch with the lowest bridge ID as the root port.
  • Lowest sender port ID: When there are two interfaces that connect to the same switch and both cost the same to reach the root bridge, the switch will use the interface with the lower number as the root port. [/restrict]
No Attachment Found
No Attachment Found