Sub topic 9
Timers and why classic STP converges slowly
This chapter assumes you know how BPDUs, root bridge election, port roles and the four classic port states (blocking, listening, learning, forwarding) work. Here we look at the three timers that govern those states and add up the delay a failure causes.
The three timers
The root bridge sets the timers, and every other switch uses the values it learns from the root's BPDUs. A non-root switch ignores its own configured values.
| Timer | Default | Purpose |
|---|---|---|
| Hello | 2 seconds | How often the root sends a configuration BPDU. Other switches relay it. |
| Forward delay | 15 seconds | How long a port stays in each of listening and learning. |
| Max age | 20 seconds | How long a port keeps the last BPDU it received before treating it as lost. |
Forward delay is used twice, once per transitional state. A port therefore needs 30 seconds to move from blocking to forwarding after the switch decides it should forward.
Why the delays exist
A port must not forward until the switch is confident the topology has settled. Listening gives the switch time to hear BPDUs and lets old forwarding paths age out. Learning lets it fill its MAC table without forwarding frames. Skipping these steps would risk a temporary loop while other switches still forward on the old topology.
Adding up a failure
Suppose the root port on an access switch is blocked from its upstream neighbor by an indirect failure. The switch sees no BPDUs on that link, and the sequence below follows.
The total is max age (20 s) plus two forward delays (15 s + 15 s), which is 50 seconds. A direct failure, where the switch sees its own link go down, skips the max age wait. Recovery then takes about 30 seconds. During this time, hosts behind the affected path have no connectivity.
Tuning the timers
You can change the values on the root bridge. The next example lowers them for VLAN 10 on Cisco IOS.
configure terminal
spanning-tree vlan 10 hello-time 2
spanning-tree vlan 10 forward-delay 10
spanning-tree vlan 10 max-age 14
endBe careful here. The standard ties the values together, and a common rule is that max age must be at most 2 × (forward delay − 1) and at least 2 × (hello time + 1). Smaller values also assume a small network, because the timers are sized for a maximum diameter of seven switches. If BPDUs take longer to cross the network than max age allows, ports flap or loops appear. In most networks, moving to Rapid STP is the safer fix than tuning timers.
Exercise
A switch's root port stops receiving BPDUs, but the link stays up, and the defaults are in use. How long until its alternate port forwards, and which timers account for it?
Show answer
About 50 seconds. Max age (20 s) must expire first, then the port spends forward delay in listening (15 s) and again in learning (15 s).
Exercise
You set a forward delay of 4 seconds on a non-root switch. Does it change convergence for the network?
Show answer
No. Non-root switches use the timer values advertised by the root bridge, so the change must be made on the root.