Spanning Tree Protocol (STP) is a Layer 2 protocol that runs on bridges and switches. The specification for STP is IEEE 802.1D. The main purpose of STP is to ensure that you do not create loops when you have redundant paths in your network. Loops are deadly to a network. Spanning-Tree Protocol is a link management protocol that provides path redundancy while preventing undesirable loops in the network.
STP uses the spanning-tree algorithm (STA) to first create a topology database, then search out and destroy redundant links.
Each port on a switch using Spanning-Tree Protocol exists in one of the following five states:
Blocking - A port that would cause a switching loop, no user data is sent or received but it may go into forwarding mode if the other links in use were to fail and the spanning tree algorithm determines the port may transition to the forwarding state. BPDU data is still received in blocking state.
Listening - The switch processes BPDUs (Bridge Protocol Data Units) and awaits possible new information that would cause it to return to the blocking state.
Learning - While the port does not yet forward packets it does learn source addresses from packet received and adds them to the Switching database (filtering database)
Forwarding - A port receiving and sending data, normal operation. STP still monitors incoming BPDUs that would indicate it should return to the blocking state to prevent a loop.
Disabled - Not strictly part of STP, a network administrator can manually disable a port
Types of STP
Rapid Spanning Tree Protocol (RSTP):
Rapid Spanning Tree Protocol (RSTP), which provides for faster spanning tree convergence after a topology change. While STP can take 30 to 50 seconds to respond to a topology change, RSTP is typically able to respond to changes within 3*Hello times (default: 6 seconds). The so-called Hello time is an important and configurable time interval that is used by RSTP for several purposes; its default value is 2 seconds
Multiple Spanning Tree Protocol (MSTP):
MSTP allows formation of MST regions that can run multiple MST instances (MSTI). Multiple regions and other STP bridges are interconnected using one single common spanning tree (CST). MSTP was inspired by Cisco system Multiple Instances Spanning Tree Protocol (MISTP), and is an evolution of the STP and the RSTP.
Per-VLAN Spanning Tree (PVST):
PVST and PVST+, which are the default protocol used by Cisco switches. Both PVST and PVST+ protocols are Cisco proprietary protocol. PVST works only with Inter Switch Link (ISL).
Rapid Per-VLAN Spanning Tree (R-PVST):
It is Cisco's proprietary protocol that combines the functionalities of RSTP and PVST. It is based on a per VLAN instance that creates a tree for each VLAN.
CCNA Overview Page