Both protocols solve the same problem: a redundant Layer 2 topology will loop forever (broadcast storms, MAC flapping) unless something blocks the backup links. STP and RSTP both build a loop-free tree — the difference is how fast they recover when something changes.

Classic STP (802.1D) — slow but reliable

STP walks a port through four states using timers:

Blocking -> Listening (15s) -> Learning (15s) -> Forwarding
Total convergence: ~30s (up to ~50s with max-age delays)

That half-minute outage after a link change is painful on modern networks.

RSTP (802.1w) — sub-second

RSTP keeps the same loop-prevention goal but replaces timers with a proposal/agreement handshake: neighbouring switches negotiate directly and bring ports to forwarding almost instantly. It also collapses the states to three:

Discarding (was Blocking/Listening) -> Learning -> Forwarding

New port roles

STP has Root and Designated ports. RSTP adds two standby roles so recovery is instant:

  • Alternate port — a backup path to the root bridge, ready to take over if the root port fails.
  • Backup port — a backup to a designated port on the same shared segment.

The bottom line

RSTP is STP, evolved: same loop prevention, far faster convergence, and backward-compatible (it falls back to 802.1D when it detects a legacy neighbour). On Cisco gear you enable it with spanning-tree mode rapid-pvst. There's almost no reason to run classic 802.1D today.