skip to content

What does Rapid Spanning Tree Protocol (RSTP, IEEE 802.1w) change compared with classic 802.1D spanning tree?

level: juniorimportance: must knowfreq 45%

answer

  1. same tree, reached faster
  2. roles split from states
  3. two new standby roles
  4. three states instead of five
  5. neighbours agree instead of waiting

basics

~20 s

RSTP keeps 802.1D's root election and path costs but adds alternate and backup port roles, merges disabled, blocking and listening into one discarding state, and moves ports to forwarding by an explicit neighbour handshake instead of waiting out timers.

solid answer

~50 s

RSTP (IEEE 802.1w, folded into 802.1D-2004) keeps the same root election, bridge IDs and path costs, so it builds the same loop-free tree. What changes is how quickly ports reach their place in it. Roles and states are separated: the IEEE defines the roles root, designated, **alternate** and **backup** (plus disabled), and only three states, `discarding`, `learning` and `forwarding`. An alternate port is a pre-computed second path to the root, so a lost root port is replaced without recomputing the tree. A designated port on a **point-to-point** link reaches forwarding through a **proposal/agreement** handshake with its neighbour, and an **edge port** facing a host forwards at once. Every bridge also originates its own BPDUs each Hello instead of only relaying the root's. RSTP stays compatible: a port that hears 802.1D BPDUs runs the old protocol on that port.

go deeper

for a junior

Recall that RSTP builds the same tree as classic spanning tree but reaches it faster, and name its three states and its two new roles, alternate and backup.

for a middle

Explain why splitting roles from states matters: an alternate port is already known to be a valid path, and a neighbour handshake replaces the timed listening and learning walk.

for a senior

Show where the speed depends on conditions: point-to-point links, edge ports facing hosts, and RSTP on every neighbour; one 802.1D bridge or shared segment brings timers back on that port.

for a principal

Weigh what RSTP leaves unsolved: one tree for all VLANs, standby links that carry nothing, and a failure domain the size of the bridged network, which is the case for MSTP or routing instead.

## What RSTP is, and what it keeps **Spanning tree** is the protocol Ethernet bridges (switches) run so that a network with redundant links still forwards frames along a single loop-free tree. The original version is **IEEE 802.1D** (the 1998 edition is the classic one). **Rapid Spanning Tree Protocol (RSTP)** was published as the amendment **IEEE 802.1w** and folded into **802.1D-2004**, which replaced the classic algorithm. The IETF restates it in RFC 4318, the RSTP MIB, whose `dot1dStpVersion` object distinguishes `stpCompatible(0)` (802.1D-1998) from `rstp(2)` and defaults to `rstp`. RSTP does **not** change the outcome of the tree. It keeps: - the **root bridge election** by lowest bridge ID (priority plus MAC address); - the **path cost** of each link and the root path cost a bridge advertises; - the comparison order that picks each bridge's root port and each segment's designated port; - the BPDU as the message bridges exchange. Given the same switches and links, 802.1D and RSTP block the same ports. What RSTP changes is **how a port gets to its final role and state**, and that is where its speed comes from. ## Roles and states are separated In 802.1D a non-forwarding port was simply "blocked", and the protocol could not tell a redundant path that was safe to use from a port that was still settling. RSTP separates what a port is *for* (its **role**) from what it is *doing* (its **state**). | RSTP role (IEEE) | What it is | |---|---| | root | the bridge's best path toward the root bridge | | designated | the port that forwards toward the root for its segment | | alternate | a discarding port that hears a path to the root through another bridge | | backup | a discarding port that hears its own bridge's designated port on the same segment | | disabled | a port that is administratively or physically down | The states shrink from five to three: | 802.1D state | RSTP state | |---|---| | disabled, blocking, listening | `discarding` | | learning | `learning` | | forwarding | `forwarding` | `discarding` means the port neither forwards frames nor learns MAC addresses. Alternate and backup ports sit in `discarding`; they are roles, not states, which is the point of the split. ## Three ways RSTP avoids waiting 1. **Alternate ports are ready replacements.** A switch with two uplinks already knows the second one leads to the root. When the root port fails, the alternate port takes the root role and forwards at once, without recomputing anything. 2. **Proposal and agreement.** On a **point-to-point** link (in practice, full duplex), a designated port that is not yet forwarding sends a BPDU with the *proposal* flag. The neighbour secures itself by putting its other non-edge designated ports into `discarding` (the *sync* step) and answers with an *agreement*, after which the proposing port forwards immediately. The wave repeats bridge by bridge. 3. **Edge ports.** A port marked as an edge port, facing a host that cannot close a loop, goes straight to forwarding. RFC 4318 records the safeguard: the operational edge status becomes false on reception of a BPDU, so a switch plugged in later is treated as a bridge. Where none of these applies — a shared half-duplex segment, or a neighbour that never sends an agreement — RSTP falls back to the timed path: `discarding` to `learning` to `forwarding`, each step lasting Forward Delay. ## BPDUs from every bridge, with more flags In 802.1D, a non-root bridge transmits BPDUs on its designated ports only when it receives one from the root on its root port, so news of a failure far from the root travels slowly. Under RSTP **every bridge originates BPDUs every Hello**, which makes a silent neighbour detectable locally. The RSTP BPDU (protocol version 2) uses the flag bits classic BPDUs left unused to carry the sender's port role, its learning and forwarding state, and the proposal and agreement flags. RFC 4318 also adds `dot1dStpTxHoldCount` (range 1 to 10, default 3), which limits how fast a port may transmit BPDUs. ## Compatibility with 802.1D RSTP interworks with 802.1D bridges **per port**. A port that receives 802.1D BPDUs starts sending them and loses the rapid mechanisms on that port only; the rest of the switch keeps RSTP. When the old bridge is later removed, the port does not notice by itself: RFC 4318's `dot1dStpPortProtocolMigration` object (the IEEE's `mcheck`) forces the port to try RSTP BPDUs again. ## What RSTP does not change RSTP still builds **one tree for every VLAN**. Each redundant uplink that the tree blocks carries nothing at all, and a failure anywhere still touches the whole bridged domain. Running a tree per VLAN, or grouping VLANs into instances with MSTP, addresses the first problem; neither addresses the size of the failure domain.

  • Why did RSTP separate port roles from port states?
    In 802.1D a blocked port could be a redundant path or a port still settling, and the protocol could not tell which was safe to promote. RSTP names the role, what the port is for in the tree, separately from the state, whether it forwards and learns. An alternate port is discarding but already known to lead to the root, so it can become root port and forward immediately.
  • Does RSTP still need timers at all?
    Yes, as fallbacks. Hello still paces BPDUs, and information from a neighbour that falls silent still ages out. Forward Delay is used whenever the handshake cannot run, on a shared half-duplex segment or toward a neighbour speaking only 802.1D: there a designated port walks discarding, learning, forwarding on timers. The handshake removes the wait on point-to-point links; it does not remove the timers.

saying these in an interview costs you the question

  • RSTP elects the root bridge differently from classic 802.1D spanning tree.
  • RSTP is faster only because its timers are set shorter.
  • Alternate and backup are new port states added by RSTP.
  • RSTP runs a separate spanning tree for every VLAN.
  • An RSTP switch cannot operate alongside 802.1D switches.