Spanning Tree Protocol States
This section describes essential features and operation of the original STP as defined in IEEE 802.1d.
After the bridges have classified the ports as root, designated, or non-designated, creating a loop-free topology is straightforward: root ports and designated ports forward traffic; non-designated ports block traffic.
Spanning Tree Protocol States
When a bridge is first attached to a network segment, and before it can start forwarding data, it goes through a series of states while it processes BPDUs and learns the topology of the network. There are five states in STP, described in Table 5.
Table 5: STP States
State | Purpose |
|---|---|
Listening | Processing BPDUs and building active topology |
Learning | Building bridging tables; no forwarding of data |
Forwarding | Sending and receiving data; normal operation |
Blocking | A port that would cause a loop if it were sending data, so it is only receiving BPDUs, until a topology change removes the possibility of a loop |
Disabled | A port that is manually isolated from the network |
Notes on the Listening State
Initially, every bridge acts as if it is a root bridge, and enters the listening state to determine the active topology. An absence of BPDUs for a certain period of time can also cause the bridge to transition into the listening state. In the listening state, no user data is being passed; however, the port is sending and receiving BPDUs in an effort to determine the active topology. The three initial convergence steps take place in the listening state.
During initial convergence, any ports that are not elected as a designated or root port go into the blocking state.
After the default length of 15 seconds in the listening state, any ports that remain as designated or root ports progress into the learning state.
Notes on the Learning State
The learning state is a 15-second interval during which the bridge does not pass user data frames while the bridge is building its bridging table. As the bridge receives frames, it places the source MAC address and port of each frame into the bridging table. The learning state reduces the amount of flooding required when data forwarding begins.
At the end of the learning state, if a port is still a designated port or a root port, it transitions into the forwarding state. The port starts sending and receiving user data frames only after it enters the forwarding state.
The bridge spends a default of 15 seconds in each of the listening and learning states.
STP Timers
The Spanning Tree Protocol is controlled by three timers, as shown in Table 6.
Table 6: STP Timers
Timer | Primary Purpose | Default Time in Seconds | Description |
|---|---|---|---|
Forward Delay | Duration of listening and learning states | 15 | Forward delay is the time that the bridge spends in the listening and learning states. It is a single value that controls both states. The default value of 15 seconds was originally derived by assuming a maximum network size of seven bridge/hub hops, a maximum of three lost BPDUs, and a Hello Time interval of two seconds. |
Hello Time | Interval between sending of configuration BPDUs by the root bridge | 2 | The Hello Time controls the length of time between sending configuration BPDUs. The default value of 2 seconds only applies to configuration BPDUs, because they are generated at the root bridge. Other bridges propagate BPDUs from the root bridge as they are received. If BPDUs stop arriving for 2 through 20 seconds because of network disturbance, non-root bridges stop sending periodic BPDUs during this time. |
Max Age | Length of time a BPDU is stored | 20 | Max Age is the length of time that a bridge stores a BPDU before discarding it. |
Processing of STP Topology Change Notification BPDUs
A bridge originates a topology change notification (TCN) BPDU in either of two conditions:
- When it transitions a port into the forwarding state and it has at least one designated port.
- When it transitions a port from either the forwarding or learning states to the blocking state.
Each of these two conditions changes the active topology, requiring notification to be sent to the root bridge. Assuming that the current bridge is not the root bridge, the current bridge begins the notification process by sending a TCN BPDU from its root port. It continues sending the TCN BPDU every Hello Time interval until the TCN message is acknowledged.
The upstream bridge receives the TCN BPDU. Although several bridges might hear the TCN BPDU, only the designated port accepts and processes it.
The upstream bridge sets the topology change acknowledgement (TCA) flag in the next configuration BPDU that it sends downstream from the designated port. This acknowledges that the TCN BPDU was received and causes the originating bridge to stop generating TCN BPDUs.
The upstream bridge propagates the TCN BPDU out its root port, resulting in the TCN BPDU being one hop closer to the root bridge. The upstream bridges continue using this process until the root bridge receives the TCN BPDU.
The root bridge then sets the TCA flag to acknowledge the TCN BPDU sent by the previous bridge and also sets the TCA flag in the next configuration BPDU that it sends out.
The root bridge continues to set the TCA flag in all configuration BPDUs that it sends out for a total time equal to Forwarding Delay + Max Age seconds = 35 seconds (default). This flag instructs all the bridges to purge the MAC addresses in the bridge tables and start learning again as soon as the new loop-free topology is available.
Time to Convergence
STP needs twice the length of the forwarding delay (15 seconds) to transition a port from the blocking state to the forwarding state, for a total of approximately 30 seconds to convergence. Typically, STP is configured as RSTP. If the original STP mode is needed, include the force-version stp statement at the [edit protocols rstp] hierarchy level.
Related Topics
- Decision Sequence for a Loop-Free STP Topology
- Key Concepts in Spanning Tree Protocols
- Multiple Spanning Tree Protocol
- Overview of Spanning Tree Protocol on Juniper Networks MX Series 3D Universal Edge Routers
- Port Roles in STP
- Rapid Spanning Tree Protocol Port States and Port Roles
- Restrictions and Cautions for Implementing STP
- Spanning Tree Protocol Operation
- STP Scaling and Performance on Juniper Networks MX Series 3D Universal Edge Routers
- VLAN Spanning Tree Protocol
Hide Navigation Pane
Show Navigation Pane
Download
SHA1