Overview

15 Rapid Spanning Tree Protocol

Modern LANs demand faster layer-2 recovery than classic IEEE 802.1D Spanning Tree Protocol can provide, so Rapid Spanning Tree Protocol (IEEE 802.1w) was introduced to drastically cut convergence time. Cisco implements both per-VLAN versions—PVST+ for STP and Rapid PVST+ for RSTP—so each VLAN can have its own spanning tree; this improves traffic engineering but increases control-plane load in environments with many VLANs. Multiple Spanning Tree Protocol (IEEE 802.1s) addresses that trade-off by mapping many VLANs into a few RSTP-based instances, delivering fast convergence without running a separate instance per VLAN.

RSTP retains the same core topology-calculation logic as STP (root bridge election, root/designated selections) but accelerates transitions using a synchronization mechanism rather than waiting on timers. It changes operational details: all switches originate BPDUs, port states are simplified to discarding, learning, and forwarding, and port costs can use “short” (legacy) or “long” values to account for very high-speed links. RSTP is backward compatible; when it detects non-RSTP neighbors (such as STP-only switches or hosts), it falls back to timer-based behavior. Host-facing ports can still bypass delays with PortFast, which in RSTP terms aligns with the edge link concept.

RSTP refines port roles by replacing STP’s non-designated role with alternate and backup: alternate offers a standby path toward the root, while backup is a same-segment standby on the same switch (rare in modern designs). Tie-breakers also include the local port ID when multiple local ports share a segment. Convergence is dramatically faster: ports react after missing three BPDUs (about six seconds by default), can immediately forward after successful sync on point-to-point links, and switches actively counter inferior BPDUs with superior ones to restore the correct root. Link types shape behavior—point-to-point (full-duplex switch links) can use rapid transitions, shared (half-duplex) behaves like classic STP, and edge (host-facing, configured via PortFast) transitions immediately and does not trigger topology-change notifications.

MSTP groups multiple VLANs into each instance. VLANs 1 to 50 are grouped together in MSTP instance 0, and VLANs 51 to 100 are grouped together in MSTP instance 1. This allows the switches to balance traffic over the links in the LAN without requiring a separate STP instance for each VLAN.
15_01
A LAN after RSTP has created a loop-free topology. The only difference in the topology between STP and RSTP is that the non-designated ports are now called alternate ports.
15_02
An RSTP port can transition to the forwarding state in one of two ways. 1) If the RSTP sync mechanism succeeds, the port immediately transitions to the forwarding state. 2) If the RSTP sync mechanism fails, the port transitions from discarding to learning to forwarding, like a regular STP port.
15_03
A port will become an alternate port if it is neither root nor designated, and if the switch is not the designated bridge for the segment. In almost all cases, a port that is neither root nor designated will be an alternate port.
15_04
SW1 and SW3 both have multiple ports connected to the same segment. SW1 G0/1 becomes an alternate port because SW1 is not the designated bridge for the segment. SW3 G0/1 becomes a backup (B) port because SW3 is the designated bridge for the segment.
15_05
RSTP speeds up convergence after a topology change like this from 50 seconds to just over 6 seconds. 1) Due to a hardware failure, SW1 stops receiving BPDUs on G0/1 (without the port going down). 2) G0/1 remains the root port for 6 seconds (3x the hello timer of 2 seconds). 3) G0/0 becomes the root port and, after performing the RSTP sync process, immediately moves to the forwarding state.
15_06
RSTP speeds up convergence after a topology change like this from 50 seconds to less than one second. 1) Due to a hardware failure, the SW2 to SW3 link goes down. 2) SW2 names itself the root bridge and sends BPDUs to SW1, which are inferior to the ones SW1 still receives from SW3. 3) SW1 G0/1 becomes a designated port and sends superior BPDUs to SW2. 4) SW2 accepts SW3 as the root bridge, then G0/1 becomes a root port and moves to the forwarding state.
15_07
RSTP differentiates between three link types: point-to-point, shared, and edge. Any full-duplex link is considered a point-to-point link. Any half-duplex link is considered a shared link. Any link between a switch and an end host (and operating in full duplex) is considered an edge link.
15_08

Summary

  • STP, standardized by IEEE 802.1D, was modified by Cisco to make PVST+. Likewise, RSTP, standardized by IEEE 802.1w, was modified by Cisco to make Rapid PVST+. PVST+ and Rapid PVST+ both run separate spanning tree instances for each VLAN.
  • Whether a switch runs PVST+ or Rapid PVST+ by default depends on the switch model and IOS version.
  • The running version of STP can be confirmed with show spanning-tree. The output Spanning tree enabled protocol ieee means PVST+, and Spanning tree enabled protocol rstp means Rapid PVST+.
  • You can configure a switch to use PVST+ or Rapid PVST+ with the spanning-tree mode {pvst | rapid-pvst} command in global config mode.
  • Multiple Spanning Tree Protocol (MSTP), standardized by 802.1s, allows multiple VLANs to be grouped together in each instance.
  • The fundamental difference between STP and RSTP is speed. Rather than relying on timers, RSTP-enabled switches can use a sync mechanism to rapidly transition their ports to the forwarding state.
  • The algorithm used to decide the root bridge, root ports, and designated ports in RSTP is identical to that of STP.
  • Whereas STP switches only forward BPDUs from the root bridge out of their designated ports, RSTP switches send BPDUs out of their designated ports every two seconds, even if they didn’t receive a BPDU from the root bridge.
  • The original STP port costs are called the short costs. RSTP introduced the long method of calculating port costs to accommodate ports of greater speeds.
  • With the long method, 10 Mbps = 2,000,000, and a tenfold speed increase decreases the cost tenfold (with a top speed of 10 Tbps, which has a cost of 2).
  • A switch may use the short or long method of calculating costs by default, depending on the switch model and IOS version. Use the show spanning-tree pathcost method command to confirm.
  • Use the spanning-tree pathcost method {short | long} command in global config mode to configure which cost-calculation method a switch will use.
  • RSTP uses three port states: discarding, learning, and forwarding. The STP disabled, blocking, and listening states were combined into the RSTP discarding state.
  • When an RSTP port is first enabled, it will enter the discarding state. Alternate and backup ports will remain in that state. Root and designated ports will transition to the forwarding state.
  • If the RSTP sync mechanism succeeds, the port will transition immediately to the forwarding state. If the sync mechanism fails, it will spend 15 seconds each in the discarding and learning states before reaching the forwarding state.
  • RSTP uses four port roles: root, designated, alternate, and backup. The alternate and backup roles are equivalent to the STP non-designated role.
  • An alternate port provides an alternate path toward the root bridge. Any port that is not a root or designated port is an alternate port if the switch is not the designated bridge for the segment.
  • A backup port provides a backup path to the same segment as a designated port on the same switch. This will only occur if two ports on the same switch are connected to the same segment with a hub, which is extremely rare in modern networks.
  • Any port that is not a root or designated port is a backup port if the switch is the designated bridge for the segment.
  • If multiple ports on the same switch are connected to the same segment, the lowest local port ID is used as a tiebreaker for the root port and designated port selection processes.
  • Whereas an STP-enabled switch waits 20 seconds (the max age timer) after ceasing to receive BPDUs on a port to react, RSTP only waits until a port misses three BPDUs (6 seconds).
  • In some cases, RSTP can shorten a 50-second convergence process to less than 1 second.
  • Whereas switches running STP ignore inferior BPDUs until the max age timer runs out, switching running RSTP will respond to inferior BPDUs with superior BPDUs.
  • RSTP differentiates between three link types: point-to-point, shared, and edge.
  • A point-to-point link is a link that operates in full duplex. Ports with this link type can use the RSTP sync mechanism to rapidly transition to the forwarding state. Full-duplex ports will automatically use this link type.
  • A shared link is a link that operates in half duplex. Ports with this link type can not use the RSTP sync mechanism. Half-duplex ports will automatically use this link type.
  • An edge link is a point-to-point link that connects to an end host and is configured to use PortFast. Ports with the edge link type can immediately transition to the forwarding state without using the RSTP sync mechanism.
  • To manually configure the point-to-point/shared link types, use the spanning-tree link-type {point-to-point | shared} command in interface config mode. To configure the edge link type, use the spanning-tree portfast command in interface config mode.

FAQ

What is Rapid Spanning Tree Protocol (RSTP) and how does it improve on classic STP?RSTP (IEEE 802.1w) is a faster-evolving version of STP (IEEE 802.1D). Instead of waiting on timers, RSTP uses a synchronization mechanism between switches to move eligible ports to forwarding immediately. The topology calculation (root bridge, root/designated port selection) is the same, but convergence is much quicker.
What are the main STP variants I should know for the CCNA?- STP (802.1D): single spanning tree, slower convergence.
- PVST+ (Cisco): per-VLAN spanning tree for 802.1D.
- RSTP (802.1w): single spanning tree, rapid convergence.
- Rapid PVST+ (Cisco): per-VLAN RSTP, rapid convergence.
- MSTP (802.1s): groups multiple VLANs into a few RSTP-based instances.
When should I consider MSTP instead of Rapid PVST+?In environments with many VLANs. Rapid PVST+ creates one STP instance per VLAN (more CPU, memory, and BPDU load). MSTP lets you map many VLANs into a small number of instances to reduce overhead while still load-balancing across links.
How do I check and set the spanning-tree mode on a Cisco switch?- Show which STP variant is running: show spanning-tree (look for “protocol ieee” for PVST+ or “protocol rstp” for Rapid PVST+).
- Set mode: spanning-tree mode pvst or spanning-tree mode rapid-pvst.
How do RSTP port costs differ from classic STP costs?STP uses “short” costs (up to 10 Gbps). RSTP introduced “long” costs (up to 10 Tbps). You can view the method with show spanning-tree pathcost method and set it with spanning-tree pathcost method {short | long}. A quick memory tip: with long costs, every 10x increase in speed reduces cost by 10x (e.g., 10 Gbps = 2000).
What are the RSTP port states?RSTP uses three states: discarding, learning, and forwarding. Discarding combines STP’s disabled, blocking, and listening. Ports that can sync with an RSTP neighbor can move to forwarding immediately; otherwise they use the STP-like timer path (15s discarding + 15s learning).
What are the RSTP port roles and how do alternate and backup differ?- Root: forwarding toward the root bridge.
- Designated: forwarding away from the root bridge (one per segment).
- Alternate: discarding; an alternate path toward the root via another switch (typically connected to a designated port on the neighbor).
- Backup: discarding; a second port on the same switch to the same segment (e.g., via a hub).
How are tie-breakers handled when multiple local ports compete?If multiple local ports contend for root or designated on the same segment, the port with the lowest local port ID wins. This tie-breaker is applied after the usual criteria (root cost, neighbor BID, neighbor port ID).
How does RSTP react to topology changes faster than STP?RSTP reacts after missing three BPDUs (~6 seconds by default) instead of waiting for STP’s 20-second max age. It then syncs and can immediately move the best port to forwarding. RSTP also actively responds to inferior BPDUs by sending superior BPDUs, enabling sub-second reconvergence in some failures.
What are RSTP link types and how do they affect convergence?- Point-to-point: full-duplex switch-to-switch; supports rapid sync. Can be set with spanning-tree link-type point-to-point (usually auto).
- Shared: half-duplex (e.g., via a hub); behaves like STP, no rapid transition. Can be set with spanning-tree link-type shared (usually auto).
- Edge: full-duplex to end hosts; immediately forwards and does not trigger TCNs. Configure via PortFast: spanning-tree portfast. View types with show spanning-tree (Type column: P2p, Shr, P2p Edge).

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Acing the CCNA Exam, Volume 1 ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Acing the CCNA Exam, Volume 1 ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Acing the CCNA Exam, Volume 1 ebook for free