STP overview
A network topology of bridges typically contains redundant connections to provide alternate paths in case of link failures. However, because there is no concept of TTL in Ethernet frames, this could result in the permanent circulation of frames if there are loops in the network. To prevent loops, a spanning tree connecting all the bridges is formed in real time.
The redundant ports are put in a blocking (nonforwarding) state. They are enabled when required. In order to build a spanning tree for the bridge topology, the bridges must exchange control frames (BPDUs - Bridge Protocol Data Units). The protocols define the semantics of the BPDUs and the required state machine. The first Spanning Tree Protocol (STP) became part of the IEEE 802.1d standard.
The STP interface states for every Layer 2 interface running STP are as follows:
- Blocking - The interface does not forward frames.
- Listening - The interface is identified by the spanning tree as one that should participate in frame forwarding. This is a transitional state after the blocking state.
- Learning - The interface prepares to participate in frame forwarding.
- Forwarding - The interface forwards frames.
- Disabled - The interface is not participating in spanning tree because of a shutdown port, no link on the port, or no spanning tree instance running on the port.
A port participating in spanning tree moves through these states:
- From initialization to blocking
- From blocking to listening or to disabled
- From listening to learning or to disabled
- From learning to forwarding, blocking, or disabled
- From forwarding to disabled