Spanning Tree

Selecting Port Roles after Bridge Election

Sections:

Overview:

  • Once the Root Bridge is selected in the Spanning Tree protocol, each switch in the network will determine the port roles on its interfaces based on the STP topology
  • The port roles define the function of each port in relation to the Root Bridge, helping establish a loop-free network topology
  • Each switch determines its Root, Designated, and Blocked ports in a Spanning Tree domain
  • In this section, let's analyze the steps of how port roles are determined after the Root Bridge selection

Lab Topology

Cost Methods

Spanning Tree uses the concept of cost methods to determine the best path between switches in a network by assigning a 'cost' value to each network link. These costs help in selecting the most efficient route for traffic, avoiding loops, and ensuring there is a single, loop-free path between switches. Link costs play a big role in determining the port role selection of switches in the Spanning Tree domain. Lets go over the cost methods available in Spanning Tree.

How it Works:

  • Every port on a switch in a Spanning Tree topology is assigned a cost, which is based on the bandwidth of the link
  • A lower cost means a more preferred path 
  • The path cost refers to the cumulative cost of all the links (ports) from a switch to the root bridge of the STP domain
  • Spanning Tree uses this cost to determine the best path to the Root Bridge

Cost Methods

  • Short Method
    • The short cost method is the default and more common cost calculation used in traditional STP 
  • Long Method
    • The long cost method was introduced to accommodate higher speed links in today's networks greater than 1 Gbps
    • This method increases the cost values significantly to allow better differentiation between high speed links and allow for more granularity
    • The recommended cost method for today's networks

Short vs Long Cost Method Comparison

Designated Port Selection

Selection Guidelines

  • All ports on the Root switch will be in a Designated state
  • Designated ports are ports that forward traffic towards the Root switch of the network segment

Topology

Root Port Selection

Selection Guidelines

  • All non-root switches will be auto assigned one root port 
  • Root ports are ports that are closest to the root switch with the least cumulative cost value (higher bandwidth route)
  • Note: Ports that are directly connected to a root port will always be in a designated state

Topology

Leftover Port Selection

Selection Guidelines

  • The leftover ports of a segment link that have yet to be assigned will either be placed in a designated state or in a blocking state
  • The port of the link with the least cumulative cost towards the root switch will become designated whereas the remaining port will become blocking to prevent STP loops

Topology

Tiebreaker Scenarios

Selection Guidelines

  • In some cases when assigning a port role, two or more ports on a non-root switch will have the same least cost value towards the root switch
  • In the scenario topology picture below, I've added an additional link between HQ-Distro-SW1 & HQ-Access-SW1
  • End Goal: The end result is to assign a Root Port on AccessSW1
  • In cases when a switch has two or more ports with the same least cost, there are tiebreaking rules to follow:
    • First Tiebreaker: Upstream neighbor switch with the lowest BID value 
      • AccessSW1 has a total of 3 links with the same cumulative cost towards the Root switch
      • Out of the DistroSW1 & DistroSW2 switches, DistroSW1 has the lowest BID value
      • However there remains 2 links towards DistroSW1 so next comes the second tiebreaker
    • Second Tiebreaker: Upstream neighbor port with the lowest PortID value 
      • Out of ports G3/3 and G2/0 of the neighbor switch DistroSW1, port G2/0 has the lowest PortID value which would make G2/0 of the AccessSw1 the designated Root port
      • The PortID value consists of a priority and an ID number 
      • By default all ports on a switch have a PortID priority of 128
      • However the ID numbers are often the decision factor if the port priority is not changed manually on a switch

Topology

Verification

  • Upon learning the rules and guidelines of assigning port roles after Root Bridge election, you can verify the current STP topology by issuing the following IOS commands on a switch:
    • 'show spanning-tree <VLANID>'
    • You can specify a certain STP VLAN instance or show all STP instances by leaving out the VLANID value