Cisco Routing/Switching – Spanning Tree Protocol Overview

Lets digest a simple scenario for STP. We will identify the root bridge, path costs, root ports and designated ports and also the blocking ports in our scenario below.

Lets have a look at our diagram, normally Cisco Diagrams aren’t so square but I wanted to make it a little different to show people not to be put off by diagrams and that they are all a little different.

From this diagram we can only see the interfaces, we need to be able to identify the root bridge by comparing the priority of the switch and the MAC address, you can do this by running the sh spanning-tree command on any STP enabled switch, I have listed them in the diagram below to help us identify it a little easier.

Looking at the diagram with all the switch’s and their priorities and MAC Addresses Switch E was elected as the root bridge, after this we need to calculate our path costs for each segment. Referring to the Cisco costing below:

Ethernet Speed IEEE Cost
10Mbps 100
100Mbps 19
1Gbps 4
10Gbps 2

So now that we have our Path Costs we can calculate the root ports, root ports are paths to the root bridge with the lowest path cost, an example of a root port would be Switch C to Switch D as the past cost is only 4 as opposed to its other route which would have a much higher cost therefore becoming a root port.

I have labelled the Root Ports (RP) and also added in the Root Path Costs so you can see which cost’s less.

We then need to label our designated ports,  a designated port is a port not facing the root but forwarding traffic (while lowest cost) from another segment. It is to be noted that a Root port cannot be a Designated port, also to be noted as the Root Bridge has a zero cost and all ports are designated ports from the Root Bridge.

So in our example most the opposites of root ports are designated ports but what about below:

In the above none of the ports are either Root Ports or Designated Ports, so what happens in this scenario?

Here we use some of the Cisco Spanning tree tiebreakers:

  1. Switch with the lowest root bridge ID, (in the example above they are both using the same root bridge ID so this is not applicable)
  2. Root path cost, which interface on this segment has the lowest root path cost? in this scenario above it would be Switch C as its Route path cost is only 8 and Switch B’s root path cost is 12.
  3. The lowest bridge ID
  4. Port ID

In another example we have two ports that are also not root ports so we need to figure those out too:

As there is no root port between Switch A and B we have to do the same tiebreaker,

  1. the root path cost is the same on both Switches
  2. the root Bridge ID matches
  3. the Bridge ID on switch A is smaller than the Bridge ID on Switch B  therefore this is the designated port:

Now I have labelled all the Designated Ports as (DP) – the only thing left to do now is figure out the ports in the blocking state, to figure out which ports are in the blocking state these are the ports that are not labelled as either Root Ports or Designated Ports, in theory these should completely break any loops in the network which is the exact point of STP to prevent loops in your network and avoid “Broadcast Storms”, “Mac Table Instability” & “Multiple Frame Transmission”

Now looking at our completed diagram you should have noticed the ports in the blocking state quite easily:

Hopefully this gives you a basic understanding of how STP works and helps you.

 

Leave a Reply

Your email address will not be published. Required fields are marked *