Home > Rapid Spanning Tree Protocol RSTP Tutorial

Rapid Spanning Tree Protocol RSTP Tutorial

June 5th, 2011 Go to comments

Note: Before reading this article you should understand how STP works. So if you are not sure about STP, please read my article about Spanning Tree Protocol tutorial first.

Rapid Spanning Tree Protocol (RSTP)

One big disadvantage of STP is the low convergence which is very important in switched network. To overcome this problem, in 2001, the IEEE with document 802.1w introduced an evolution of the Spanning Tree Protocol: Rapid Spanning Tree Protocol (RSTP), which significantly reduces the convergence time after a topology change occurs in the network. While STP can take 30 to 50 seconds to transit from a blocking state to a forwarding state, RSTP is typically able to respond less than 10 seconds of a physical link failure.

RSTP works by adding an alternative port and a backup port compared to STP. These ports are allowed to immediately enter the forwarding state rather than passively wait for the network to converge.

RSTP bridge port roles:

* Root port – A forwarding port that is the closest to the root bridge in terms of path cost
* Designated port – A forwarding port for every LAN segment
* Alternate port – A best alternate path to the root bridge. This path is different than using the root port. The alternative port moves to the forwarding state if there is a failure on the designated port for the segment.
* Backup port – A backup/redundant path to a segment where another bridge port already connects. The backup port applies only when a single switch has two links to the same segment (collision domain). To have two links to the same collision domain, the switch must be attached to a hub.
* Disabled port – Not strictly part of STP, a network administrator can manually disable a port

Now let’s see an example of three switches below:


Suppose all the switches have the same bridge priority so the switch with lowest MAC address will become root bridge -> Sw1 is the root bridge and therefore all of its ports will be Designated ports (forwarding).

Two ports fa0/0 on Sw2 & Sw3 are closest to the root bridge (in terms of path cost) so they will become root ports.

On the segment between Sw2 and Sw3, because Sw2 has lower MAC than Sw3 so it will advertise better BPDU on this segment -> fa0/1 of Sw2 will be Designated port and fa0/1 of Sw3 will be Alternative port.


Now for the two ports connecting to the hub, we know that there will have only one Designated port for each segment (notice that the two ports fa0/2 & fa0/3 of Sw2 are on the same segment as they are connected to a hub). The other port will be Backup port according to the definition of Backup port above. But how does Sw2 select its Designated and Backup port? The decision process involves the following parameters inside the BPDU:

* Lowest path cost to the Root
* Lowest Sender Bridge ID (BID)
* Lowest Port ID

Well, both fa0/2 & fa0/3 of Sw2 has the same “path cost to the root” and “sender bridge ID” so the third parameter “lowest port ID” will be used. Because fa0/2 is inferior to fa0/3, Sw2 will select fa0/2 as its Designated port.



Note: Alternative Port and Backup Port are in discarding state.

RSTP Port States:

There are only three port states left in RSTP that correspond to the three possible operational states. The 802.1D disabled, blocking, and listening states are merged into the 802.1w discarding state.

* Discarding – the port does not forward frames, process received frames, or learn MAC addresses – but it does listen for BPDUs (like the STP blocking state)
* Learning – receives and transmits BPDUs and learns MAC addresses but does not yet forward frames (same as STP).
* Forwarding – receives and sends data, normal operation, learns MAC address, receives and transmits BPDUs (same as STP).

STP State (802.1d) RSTP State (802.1w)
Blocking Discarding
Listening Discarding
Learning Learning
Forwarding Forwarding
Disabled Discarding

Although the learning state is also used in RSTP but it only takes place for a short time as compared to STP. RSTP converges with all ports either in forwarding state or discarding state.

RSTP Quick Summary:

RSTP provides faster convergence than 802.1D STP when topology changes occur.
* RSTP defines three port states: discarding, learning, and forwarding.
* RSTP defines five port roles: root, designated, alternate, backup, and disabled.

Note: RSTP is backward compatible with legacy STP 802.1D. If a RSTP enabled port receives a (legacy) 802.1d BPDU, it will automatically configure itself to behave like a legacy port. It sends and receives 802.1d BPDUs only.

Comments (10) Comments
Comment pages
1 2 3 4 623
  1. Dusan
    June 22nd, 2016

    All , especially this and FHRPs

  2. Anonymous
    June 24th, 2016

    guys need your inputs..
    There is STP issue in our network , We have voice gateway which is connected to a root switch for the VLAN 20 , from the root switch we are connecting two ports to the voice gateway .
    both the ports are in forwarding states and the issue is we are not able to ping the voice gateway IP..

    Tried to shutdown the one of the interface in switch and able to ping the IP..but when both are enable not able to ping..kindly suggest what can be done to resolve the issue.

  3. hamburgWhich two spanning-tree port states does RSTP combine
    October 6th, 2016

    Which two spanning-tree port states does RSTP combine to allow faster convergence? (Choose two.)

    answers: Blocking & Listening


  4. raju
    November 11th, 2016

    I had read multiple documents to understand the RSTP concepts but still I have multiple questions to get clarity. If you answer the below questions for me, which I can develop good confidence on RSTP.

    1.Let’s say I have only one switch.I enabled RSTP in my switch. by default, all ports are on edge ports.

    a) Will edge port forward BPDUs ?
    b) If yes”, will they continuously forward BPDUs? How long did they forward ?

    2. Let’s say Switch A and Switch B is connected. Switch A is Root Bridge.

    Case:1 Switch A (D/F)————————(R/F) Switch B

    Case:2 Switch A (D/F)————————(R/F) Switch B

    Case:3 Switch A (D/F)———–HUB————–(R/F)Switch B

    When the connection between S-A and S-B fails, then S-B thins ks itself as a Root Bridge and move its non -edge ports to (Designated /Discarding) and send proposal bit set in BPDU.In this process, if S-B receives better BPDU with proposal bit set, S-B sends an Agreement and move its port (Alternate/Discarding) to (Root / forwarding).

    a) How much time did it take to (A/D) Alternate / Discarding port to move to (Root / Forwarding) ?
    b) How much time did it take to (D/F) Designated / Forwarding port to move to (Root / Forwarding) ?
    c) Connection fails between S-A and HUB.The link between HUB and Switch -B is up.How much time did it take to (A/D) Alternate / Discarding port to
    move to (Root / Forwarding) ?

    3. In STP only Root bridge will generate but In RSTP, Is all the Switches will generate BPDU periodically (2sec) what is the benefit?

    4. In RSTP, link failure is considered as a topology change Only non-edge interfaces (Point to Point links Switch to Switches) that move to the forwarding state are considered as a topology change. Link failure at Edge port is not considered as topology change.

    I want to understand the below points. Once a switch detects a topology change,

    a) It will start a “topology change while timer” (4sec). what is the benefit of this?
    b) If Switch receives BPDUs with TC bit set, It clears the MAC addresses learned on all its ports, except the one that receives the topology change.why?

  5. JustLearning2
    January 26th, 2017

    Hi all, I’m just beginning to learn more about STP/RSTP as well. So, I’m not fully confident on my responses to Raju’s questions. I’m more or less just throwing my thoughts on the table as well.

    1a. You mention you only had a single switch. I was under the impression that STP/RSTP were used in topologies where more than one switch exists, in order to build a logical hierarchy for all switches within that network. With that said, with no other switch available to create a loop between switches, I believe the switch would eventually transition in to STP blocking mode.

    Taken from Cisco’s website on STP: “As long as the port participates in STP, some device can assume the root bridge function and affect active STP topology. To assume the root bridge function, the device would be attached to the port and would run STP with a lower bridge priority than that of the current root bridge.”


  6. Satyajit
    July 14th, 2017

    Good knowledge

  7. KR
    August 12th, 2017

    Great info!

  8. Girish B
    June 5th, 2018

    easily we we can understand RSTP concept thanks for your effort…

  9. S9
    October 18th, 2018

    Which RPVST+ port state is excluded from all STP operations?
    A. learning
    B. forwarding
    C. blocking
    D. disabled
    Correct Answer: D, but why? I thought it was C?!

  10. testking360
    April 29th, 2019

    Which RPVST+ port state is excluded from all STP operations?
    A. learning
    B. forwarding
    C. blocking
    D. disabled

    Cisco Nexus 5000 Series NX-OS Layer 2 Switching Configuration Guide, Release 5.2(1)N1(3)
    Chapter: Configuring Rapid PVST+

    Rapid PVST+ Port State Overview
    Propagation delays can occur when protocol information passes through a switched LAN. As a result, topology changes can take place at different times and at different places in a switched network. When a LAN port transitions directly from nonparticipation in the spanning tree topology to the forwarding state, it can create temporary data loops. Ports must wait for new topology information to propagate through the switched LAN before starting to forward frames.

    Each LAN port on a software using Rapid PVST+ or MST exists in one of the following four states:
    * Blocking – The LAN port does not participate in frame forwarding.
    * Learning – The LAN port prepares to participate in frame forwarding.
    * Forwarding – The LAN port forwards frames.
    * Disabled – The LAN port does not participate in STP and is not forwarding frames.

    – testking360.com

Comment pages
1 2 3 4 623
Add a Comment