STP vs RSTP: Port States and Roles, Convergence Speed
When switches are connected with redundant paths, broadcast frames keep circling the loop and cause a broadcast storm. STP (Spanning Tree Protocol) has switches exchange messages called BPDUs and blocks some ports so that the network forms a loop-free tree rooted at the root bridge. Classic STP (IEEE 802.1D), however, moves ports to the forwarding state while waiting on timers so that no loop forms, so with default values recovery after a failure takes 30 to 50 seconds. RSTP (Rapid STP, IEEE 802.1w) keeps the same root bridge election and the same idea of blocking ports, but cuts the switchover to generally a few seconds or less, using a proposal-and-agreement exchange with the neighboring switch and alternate ports chosen in advance. RSTP was incorporated into the 2004 edition of IEEE 802.1D and has replaced classic STP as the standard.
| Aspect | STP | RSTP |
|---|---|---|
| Standard | IEEE 802.1D (up to the 1998 edition) | IEEE 802.1w; incorporated into the 2004 edition of IEEE 802.1D |
| Port states | Five: disabled, blocking, listening, learning, forwarding | Three: discarding, learning, forwarding |
| Port roles | Root port and designated port; ports that are neither are blocked | Root and designated ports, plus the alternate port (a stand-in for the root port) and the backup port (a spare for a designated port) |
| Recovery time after a failure | 30 to 50 seconds with default timers (max age 20 s + forward delay 15 s × 2) | Generally a few seconds or less |
| Fast switchover mechanism | None; waits on timers and passes through listening and learning before forwarding | On point-to-point links, exchanges a proposal and an agreement with the neighbor and starts forwarding without waiting for timers; if the root port fails, an alternate port takes over immediately |
| How BPDUs are sent and failures detected | Each switch relays the BPDUs sent by the root bridge; a failure is assumed when BPDU information is not refreshed for the max age (20 s by default) | Each switch sends its own BPDUs every hello time (2 s by default); a failure is assumed when three in a row are missed |
| How topology changes are signaled | The switch that notices the change tells the root bridge with a TCN BPDU, and the root bridge spreads it to all; MAC address tables drop old entries by shortening the aging time to the forward delay (15 s) | The switch that notices the change tells its neighbors directly, and switches that receive it flush old MAC address table entries immediately |
| Ports for end devices | Not distinguished by the standard; a device plugged in waits about 30 seconds before forwarding starts | A port configured as an edge port starts forwarding immediately; if it receives a BPDU, it is treated as a normal port |
| Compatibility | Keeps running as STP when connected to RSTP switches | On ports facing STP switches, switches to STP-compatible behavior (switchover on that port becomes slow) |
Figures are typical orders of magnitude and vary by process generation and product.