Decision Sequence for a Loop-Free STP Topology

STP always uses the same four-step decision sequence when creating a loop-free logical topology. Evaluations for computing the segments and branches of the spanning tree are performed in this order:

  1. Lowest root identifier (RID).
  2. Lowest path cost to root bridge.
  3. Lowest sender bridge identifier (BID).
  4. Lowest port ID.

Each bridge uses the four-step decision sequence to save a copy of the best BPDU for each port. When making this evaluation, it considers all of the BPDUs received on the port as well as the BPDU that is sent from that port. As each BPDU arrives, it is checked against the four-step sequence to see if it is lower in value, and thus more attractive, than the existing BPDU saved for that port.

When a bridge first becomes active, all of its ports send BPDUs every two seconds, the default time value. However, if a port hears a BPDU from another bridge that is more attractive than the BPDU it has been sending, the local port stops sending BPDUs. If the more attractive BPDU stops arriving from a neighbor for a period of time (default value is 20 seconds), the local port resumes sending BPDUs.

If a new or a locally-generated BPDU is more attractive than the existing BPDU, the existing value is replaced. Bridges continue sending configuration BPDUs until a more attractive BPDU is received.

Steps of Initial Convergence

This section describes the algorithm that STP uses for initial convergence on a loop-free logical topology. Initial convergence consists of three steps:

  1. Elect one root bridge.
  2. Elect root ports.
  3. Elect designated ports.

When the network first starts, all of the bridges are announcing a chaotic mix of BPDU information. The bridges immediately begin applying the four-step decision sequence in order to start computing a single spanning-tree for the entire network.

First, a single root bridge is elected for the entire domain. Next, all of the remaining bridges calculate a set of root ports and designated ports to build a loop-free topology. Every non-root bridge selects one root port. Specifically, bridges track the root path cost, which is the cumulative cost of all links to the root bridge. All of the ports in a root bridge are considered to be the root port, with a few exceptions. One exception is for the port that is connected back-to-back to the same root bridge.

Finally, the designated ports are selected. Each segment in a bridged network selects one designated port to be the single bridge port that exchanges traffic to and from that segment and the root bridge.

Related Topics