STP – Tracking Down Topology Changes and the Importance of Setting the Root Bridge

Finding Spanning Tree Protocol (STP) topology changes in a network is not always straightforward. However, it is critical to identify possible points of failure or instability in your network setup. This blog post aims to guide you through tracking the root cause of STP topology changes by focusing on a specific port.

Understanding the Context

We’ll examine logs and command outputs from multiple devices in the network. The devices include:

    • CORE-A
    • CORE-B
    • ToR-A
    • ToR-B
    • ToR-OLD

Step 1: Starting at CORE-A and CORE-B

Begin by checking the Spanning Tree details on CORE-A:

CORE-A# show spanning-tree detail | include ieee|occur|from
Number of topology changes 88410 last change occurred 0:02:45 ago 
        from port-channel100

Here, port-channel100 is the vPC Peer Link to CORE-B.

Now, let’s proceed to CORE-B:

CORE-B# show spanning-tree detail | include ieee|occur|from
Number of topology changes 88215 last change occurred 0:00:56 ago 
        from port-channel101

Port-channel101 corresponds to ToR-A/B.

Step 2: Inspecting ToR-A and ToR-B

Next, check the ToR switches, starting with ToR-A:

ToR-A# show spanning-tree detail | include ieee|occur|from
Number of topology changes 87998 last change occurred 0:01:00 ago 
        from port-channel210

Here, port-channel210 corresponds to ToR-OLD.

Now, ToR-B:

ToR-B# show spanning-tree detail | include ieee|occur|from
Number of topology changes 87973 last change occurred 0:01:03 ago 
        from port-channel100

Here, port-channel100 is the vPC Peer Link to ToR-A.

Step 3: Identifying the Troublesome Port in ToR-OLD

Finally, on ToR-OLD:

ToR-OLD# show spanning-tree detail | include ieee|occur|from
Number of topology changes 88169 last change occurred 00:00:25 ago 
        from GigabitEthernet1/0/41

Here, the port in question is GigabitEthernet1/0/41.

The Root Bridge Importance

In this case, the STP was set to its default settings, and ToR-OLD became the root bridge primarily because it had a lower MAC address. The selection of the root bridge in a Spanning Tree topology is crucial for several reasons:

1. Traffic Flow: The root bridge serves as a reference point for all STP calculations. Traffic flow is determined based on the path cost to the root bridge.

2. Stability: Setting a more reliable and robust switch as the root bridge ensures that topology changes are kept to a minimum, thus increasing the network’s stability.

3. Control: Designating the root bridge allows for better planning and control over the network topology.

4. Avoiding Unplanned Failures: When STP is left to its default settings, the root bridge may end up being an older or less reliable switch, as was the case with ToR-OLD, thus risking network stability.

Analyzing the Logs for the Troublesome Port

Let’s dig deeper by examining the logs for the specified port:

ToR-OLD# show logging | inc LINK-3-UPDOWN 
May 22 10:09:58.795: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/41, changed state to down 
May 22 10:10:01.627: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/41, changed state to up 
May 22 10:12:45.059: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/41, changed state to down 
May 22 10:12:47.866: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/41, changed state to up 
May 22 10:15:31.312: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/41, changed state to down 
May 22 10:15:34.224: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/41, changed state to up 
May 22 10:18:17.995: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/41, changed state to down 
May 22 10:18:20.826: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/41, changed state to up 
May 22 10:21:04.458: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/41, changed state to down 
May 22 10:21:11.050: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/41, changed state to up 
May 22 10:23:54.598: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/41, changed state to down 
May 22 10:24:01.305: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/41, changed state to up 
May 22 10:26:45.007: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/41, changed state to down 
May 22 10:26:47.922: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/41, changed state to up 
May 22 10:29:31.417: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/41, changed state to down 
May 22 10:29:34.249: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/41, changed state to up 
May 22 10:32:17.663: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/41, changed state to down 
May 22 10:32:20.540: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/41, changed state to up 
May 22 10:35:04.077: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/41, changed state to down 
May 22 10:35:10.670: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/41, changed state to up 
May 22 10:37:54.098: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/41, changed state to down 
May 22 10:37:57.118: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/41, changed state to up 
May 22 10:40:40.449: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/41, changed state to down 

The logs reveal multiple state changes for `GigabitEthernet1/0/41`, indicating a point of network instability that is causing the STP topology changes.

Conclusion

Tracking down STP topology changes involves a series of steps, moving from core switches through to edge devices. This practice enables network administrators to identify the port or device causing network instability, thus enabling timely intervention.

Furthermore, setting the root bridge manually in an STP environment is crucial for maintaining network stability and avoiding unexpected behaviors, as seen in this example where ToR-OLD was inadvertently serving as the root bridge due to its lower MAC address.