Spanning Tree Protocol (STP) Topology Changes

Spanning Tree Protocol (STP) topology changes affect all the switches in Layer 2 topology. When a switch detects a link change, it will send a Topology Change Notification (TCN) Bridge Protocol Data Unit (BPDU) out of its root port (RP) intended for the root switch.

The upstream switch receiving the TCN will send an acknowledgment and forward the TCN to the root bridge out of its RP. The root bridge will receive the TCN, create a configuration BPDU that contains the Topology Change flag, and floods it to all switches.

The switches that receive the configuration BPDU sent by the root bridge will change their MAC address timers with the forwarding delay timer. The default is 15 seconds. It will flush out the MAC addresses of the devices that failed to communicate within that time. Once the second configuration BPDU is received, the MAC address timer is set to its normal value, 300 seconds by default.

 

Checking STP Topology Changes

The topology changes can be checked using the command:

show spanning-tree [vlan vlan-id] detail

It displays the topology change count and the time when it last happened. If the number of TCNs suddenly or continuously increases, problems could arise. Check every connected switch port and try connecting to the switch to monitor the STP details.

 

Direct Link Failures

STP topology direct link failures include losing power, reboots, and anything that causes the port to go down. STP can react in three ways, depending on the scenario:

Scenario 1

There are three connected switches, Switch1 is the root bridge. The link between Switch2 and Switch3 fails. The designated port is Gi1/3 on Switch2, and the blocked port is Gi1/2 on Switch3. There will be no effect on the topology since Switch3’s Gi1/2 port is already blocked. Switch2 and Switch3 will send a TCN to the root switch, flushing the Layer 2 topology MAC address table.

 

Scenario 2

The link between Switch1 and Switch3 fails. Switch3’s Gi1/2 port is blocked, hindering traffic from Switch1 and Switch2 to Switch3.

STP Topology

The step-by-step convergence process includes the following:

  1. Switch1 detects Gi1/3 link failure and Switch3 detects Gi1/1 link failure.
  2. Since Switch1 is the root bridge, it wouldn’t need to generate a TCN flag out of its RP. Switch3 deletes the best BPDU it received from Switch1 on its G1/1 port, and it will try to send a TCN to the root bridge, but it will fail since its RP is down.
  3. Switch1 floods a configuration BPDU with the TCN flag received by all the other switches.
  4. Switch2 and Switch3 receive the configuration BPDU with the TCN flag. They set their MAC address age timers to the forward delay timer and flush old MAC address entries. Switch2 has no idea what the topology change is.
  5. Switch3 waits for the root switch’s BPDU or the Max Age timer to expire to reset its port state and start listening for BPDUs on its Gi1/2 port.

Before Switch3’s Gi1/2 interface becomes the RP, Switch3 takes 15 seconds for the listening state and 15 seconds for the learning state. That’s a total of 30 seconds of convergence time.

 

Scenario 3

The link between Switch1 and Switch2 fails. Switch3’s Gi1/2 port is blocked, hindering the network traffic from Switch1 and Switch3 from going to Switch2.

Direct Link Failure

The step-by-step convergence process includes the following:

  1. Switch1 detects Gi1/2 link failure and Switch2 detects Gi1/1 link failure.
  2. Switch2 deletes the best BPDU it received from Switch1 on its G1/1 port, and it will try to send a TCN to the root bridge, but it will fail.
  3. Switch1 floods a configuration BPDU with the TCN flag, which Switch3 receives. Switch3 cannot forward it to Switch2 since its Gi1/2 is a blocking port. Switch2 assumes that it is the root bridge and sends configuration BPDUs indicating that the root bridge is itself.
  4. Switch3 receives the TCN flag BPDU from Switch1. Switch3 sets its MAC address age timer to the forward delay timer and flushes out the older MAC addresses. It also receives the BPDUs from Switch2, but it discards them since it is receiving superior BPDUs from Switch1.
  5. Switch3 Max-Age timer expires, and the Gi1/2 port on Switch3 changes from blocking to listening state. Switch3 can now relay the configuration BPDU to Switch2.
  6. Switch2 receives the configuration BPDU from Switch1 via Switch3. It acknowledges the superior BPDUs and will mark G1/3 as the RP and turn to the listening state.

The Switch2 convergence time is 52 seconds. It accounts for 20 seconds of the Max Age timer on Switch3, 2 seconds for the configuration BPDU from Switch3, 15 seconds for listening, and 15 seconds for the learning state.

 

Indirect Failures

Indirect STP topology failures include impaired or filtered STP communication between switches when the network link is up, such as data corruption. In this example scenario, the link between Switch1 and Switch3 got corrupted:

Indirect Failure

The step-by-step convergence process includes the following:

  1. Switch1 and Switch3 still report an ‘up’ state link.
  2. Switch3 stops receiving configuration BPDUs. Its Gi1/0/1 interface stores a cached entry for the RP. Switch3’s Gi1/0/2 port is blocked, disregarding Switch1’s configuration BPDUs through Switch2. Switch3 Max Age timer expires, and it flushes the cached RP entry. It then converts Gi1/0/2 from blocking to listening state.
  3. Switch2 keeps broadcasting Switch1’s configuration BPDUs to Switch3.
  4. On Gi1/0/2, Switch3 receives the configuration BPDU from Switch1 via Switch2. The port is now designated as the RP and continues switching between listening and learning states.

Switch3’s convergence time is 52 seconds. That’s 20 seconds Max Age timer, 2 seconds for the configuration BPDU on Switch2, 15 seconds for listening, and 15 seconds for the learning state.


Download our Free CCNA Study Guide PDF for complete notes on all the CCNA 200-301 exam topics in one book.

We recommend the Cisco CCNA Gold Bootcamp as your main CCNA training course. It’s the highest rated Cisco course online with an average rating of 4.8 from over 30,000 public reviews and is the gold standard in CCNA training: