5.2 STP Processes
5.2.6 STP timers
The previous section mentioned that a bridge spends 15 seconds in each of the listening and learning states by default. In all, the Spanning-Tree Protocol is controlled by the three timers shown in Figure .

The "hello time" controls the time interval between the sending of configuration BPDUs. The 802.1D standard specifies a default value of 2 seconds. This value really controls only configuration BPDUs as they are generated at the root bridge-other bridges propagate BPDUs from the root bridge as they are received. In other words, if BPDUs stop arriving for 2-20 seconds because of a network disturbance, non-root bridges stop sending periodic BPDUs during this time. If the outage lasts for more than 20 seconds, the default "max age" time, the bridge invalidates the saved BPDUs and begins looking for a new root port.

"Forward Delay" is the time that the bridge spends in the listening and learning states. This is a single value that controls both states. The default value of 15 seconds was originally derived assuming a maximum network size of seven bridge hops, a maximum of three lost BPDUs, and a hello-time interval of 2 seconds. The forward-delay timer also controls the bridge table age-out period after a change in the active topology.

"Max age" is the time that a bridge stores a BPDU before discarding it. Recall that each port saves a copy of the best BPDU it has seen. As long as the bridge receives a continuous stream of BPDUs every 2 seconds, the receiving bridge maintains a continuous copy of the BPDU values. However, if the device sending this best BPDU fails, some mechanism must exist to allow other bridges to take over.

For example, assume that the Segment 3 link in Figure uses a hub and the Cat-B Port-1/2 transceiver fails. Cat-C has no immediate notification of the failure because it's still receiving Ethernet "link" from the hub. The only thing Cat-C knows is that BPDUs stop arriving. Twenty seconds (max age) after the failure, Cat-C Port-1/2 ages out the BPDU information that lists Cat-B as having the best designated port for Segment 3. This forces Cat-C:Port-1/2 to transition into the listening state in an effort to become the designated port. Because Cat-C Port-1/2 now offers the most attractive access from the root bridge to this link, it eventually transitions all the way into forwarding mode. In practice, it takes approximately 50 seconds (20 Max Age + 15 Listening + 15 Learning) for Cat-C to take over after the failure of Port 1/2 on Cat-B.

In some situations, switches can detect topology changes on directly connected links and immediately transition into the listening state without waiting max age seconds. For example, consider Figure .

In this example, Cat-C Port-1/1 failed. Because the failure results in a loss of link on the root port, there is no need to wait 20 seconds for the old information to age out. Instead, Cat-C Port-1/2 immediately goes into learning mode in an attempt to become the new root port. This has the effect of reducing the STP convergence time from 50 seconds to 30 seconds (15 Listening + 15 Learning).

There are two key points to remember about using the STP timers. First, do not change the default timer values without careful consideration. When attempting to maximize timer settings, modify only the STP timers on the root bridge because the BPDUs contain three fields where the timer values can be passed from the root bridge to all other bridges in the network. Consider the alternative: if every bridge was locally configured, some bridges could work their way up to the forwarding state before other bridges ever leave the listening state. This chaotic approach could quickly lead to an unstable network. By providing timer fields in the BPDUs, the single bridge acting as the root bridge can dictate the timing parameters for the entire bridged network.