How to Test a Spanning Tree
The Spanning Tree Protocol (STP) helps networking switches to maintain redundant connections, while avoiding bridging loops. Bridge loops, or forwarding loops, occur when a switch continually forwards a data frame to a host with multiple paths to the network. Since the switch does not know when a frame has expired, this can cause switches to forward the data frame in perpetuity, slowing down the network. STP fixes this by identifying a root switch through an "election" process and forwarding Bridge Protocol Data Units (BPDUs).
Instructions
-
-
1
Connect to the root switch on the network. This is typically done with a terminal program, using either an IP-based telnet connection or a serial-based console connection.
-
2
Check that STP is running on this switch.
-
-
3
Verify the STP status of ports on the switch which connect to other switches. These statuses are blocking, listening, learning, forwarding and disabled. These different port types help switches forward frames on a predetermined path, while still being able to adapt to sudden changes in the network.
-
4
Write down the status of these ports on a separate sheet of paper or take a screenshot.
-
5
Issue a "ping" command destined for a computer connected to a different switch. Preferably, use a computer with many different switched paths leading to it from your computer. Ensure that the ping comes back properly-- if it does not, investigate the problem before proceeding.
-
6
Disable a port listed in forwarding mode.
-
7
Check the port configuration again and compare it to your previous note or screenshot. Ensure that there have been other changes besides the port you disable. If not, return to step 6 and disable a different port until you see other ports changes to a "forwarding" state.
-
8
Issue a "ping" to the same computer from step 5. If you do not receive a packet, or if packet return time severely decreases, it is possible that there is a problem with your STP configuration. Ensure you have also not disabled the only port that provides a path to said computer.
-
9
Re-enable the port you originally disabled in step 6.
-
1
Tips & Warnings
Different switches include tools for monitoring exactly how switches are handling STP functions. Cisco switches, for example, include the "show stp [interface] [interface number]" command, which allows you to see ongoing information about the status of that interface and the number of packets received.
You can also recreate a more catastrophic outage by disconnecting an intermediate switch. This will force all switches on the network to quickly revert to their alternate route for devices not directly connected to the down switch. Do this only if you are certain that the hosts connected to that switch are not doing any work.
Making severe changes to a production network can cause outages. Perform your tests outside of production hours, when no one depends on the network.
References
- Photo Credit Hemera Technologies/AbleStock.com/Getty Images