STP is the simplest loop prevention protocol. It is a Layer 2 protocol that calculates the best path through a switched network that contains redundant paths. STP uses bridge protocol data unit (BPDU) packets to exchange information with other switches. When enabling a new port for STP the Spanning Tree Protocol goes through the following port states to get that port to be either forwarding or blocking. The port states are:
Use the command ' show spanning-tree interface ' to check the interface state, verify that the ports are in steady state and not flapping between states (ie Forwarding, Blocking or listening). Flapping interfaces will affect the stability and performance of the LAN
user@switch> show spanning-tree interface Spanning tree interface parameters for instance 0 Interface Port ID Designated Designated Port State Role port ID bridge ID Cost ge-0/0/9.0 128:522 128:522 32768.0019e25078a0 20000 FWD DESG ge-0/0/10.0 128:523 128:523 32768.0019e25078a0 20000 FWD DESG ge-0/0/11.0 128:524 128:524 32768.0019e25078a0 20000 FWD DESG
Use the command ' show spanning-tree statistics interface ' to verify that BPDU packets are being sent and received correctly, and not discarded without any apparent reason. The example below shows the BPDU sent and received, and the next BPD transmission in seconds
switch@user> show spanning-tree statistics interface Interface BPDUs sent BPDUs received Next BPD transmission ge-0/0/9.0 7 5 0 ge-0/0/10.0 7 5 0 ge-0/0/11.0 7 5 0