802.1w – RSTP

Rapid Spanning Tree is an updated version of the original Spanning Tree protocol, standardized as 802.1w. It includes many of the Cisco proprietary features of PVST+. RSTP is backwards compatible with 802.1d STP but it has a few new features.
To enable RSTP, use:

Sw(config)#spanning-tree mode rapid-pvst

1. New features in RSTP

1.1 RSTP Port States

RSTP uses only 3 states:

  • Discarding – Port is not forwarding data
  • Learning – Port is in a transition state from DIS to FWD
  • Forwarding – Port is forwarding data

1.2. RSTP Port Roles

  • Root Port – Same as in 802.1d – The port that receives the best BPDU on a switch is the Root Port. It is considered the closest port to the Root Bridge
  • Designated Port – Same as in 802.1d – On any segment, the port that sends the best BPDU is considered the Desingated Port.
  • Alternate Port – Alternate to a Root Port – BPDUs from the Root Bridge can be received on other ports than the Root Port, but they are normally disabled. Still, they can offer an alternate path to the Root Bridge, in case the Root Port fails. This is similar to the UplinkFast feature of PVST+. When the path through the Root Port fails, the switch can quickly chose one of the Alternate Ports as the new Root Port.
  • Backup Port – Backup of a Designated Port – On a segment, ports on the same switch as the Designated Bridge can be used as Backup ports of the Designated Port. This means that they can offer a backup path for that segment, but they cannot guarantee a different path towards the Root Bridge

1.2 RSTP BPDU Format

802.1D BPDUs are sent with Version set to 1 and Type set to 1.
RSTP BPDUs are sent with Version set to 2 and Type set to 2. Legacy bridges will drop these frames. Alos, new flags are implemented in the Flags Byte, that encode the Role and State of the sending port:

Bit Function
0 Topology Change
1 – NEW Proposal
2,3 – NEW 00 – Unknown
01 – Alternate / Backup
10 – Root
11 – Designated
4 – NEW Learning
5 – NEW Forwarding
6 – NEW Agreement
7 Topology Change ACK

1.3 New BPDU Handling

In 802.1d, a non-root bridge would only generate BPDUs when it received one on its root port. In 802.1w, a bridge sends BPDUs every Hello Time (default: 2sec), regardless of the BPDUs it receives from the root bridge.
In 802.1d, BPDUs had to go missing for Max Age(default: 20 sec) before the BPDU information was aged out for that port and new information would be processed. In 802.1w, the BPDUs act as a keepalive mechanism, so if 3 BPDUs are missed, the bridge considers the connection to its neighbor down and it ages out BPDU information for that port.

1.4 Uses a Backbone Fast mechanism by default

RSTP includes a mechanism similar to the Backbone Fast enhancement in STP that will work by default without any additional configuration.

1.5 Rapid Transitions to Forwarding State

Rapid Transition is achieved on Edge Ports and on Point to Point links.

1.5.1 Edge Ports

  • An Edge Port is similar to a PVST+ PortFast port.
  • An Edge Port does not generate TCN when its link flaps.
  • An Edge Port that receives a BPDU loses its Edge status

To set an Edge Port, use the same command as in PVST+:

Sw(config-if)# spanning-tree portfast

1.5.2 Link Type

All Links fall in 2 categories in RSTP. By default, all full duplex links are considered Point to Point, while all Half Duplex links are considered Shared Links.
They can also be manually set, using:

Sw(config-if)#spanning-tree link-type {shared|point-to-point}

To verify the link type, use:

Sw# show spanning-tree [vlan VLAN-ID]
Fa0/1               Desg FWD 19        128.1    P2p
Fa0/2               Desg FWD 19        128.2    Shr
Fa0/3               Desg FWD 19        128.3    P2p Edge

1.6 New TCN Mechanism

In RSTP, only non-Edge ports that are moving to a FWD state will cause a TCN. When a bridge sends a TCN, it first starts a TC While timer, equal to 2xHello Time. Over this period, it sends TCN BPDUs out all its non-Edge Designated and Root Ports. It also flushes the MAC addresses associated with these ports.
When a bridge receives a BPDU with TC bit set, it starts a TC While timer, equal to 2xHello Time. Over this period, it sends TCN BPDUs out all its non-Edge Designated and Root Ports, except the port where it received the TCN. It also flushes the MAC addresses associated with these ports.
This way, the TCN is quickly flood and there is no need for the TCN to travel upstream to the Root and then downstream, as in 802.1D STP.

2. Proposal/Handshake Mechanism

Convergence in RSTP is achieved using a Link-by-link handshake mechanism. On each link, when it comes up, both ports are set to a Designated Role and to a BLK State. The 2 bridges send each other BPDUs with the Proposal bit set. The superior bridge (the Root Bridge or the Designated Bridge on the path to the Root) will transition its designated port to a FWD state only after the inferior bridge will be “in sync”.
Being “in sync” means the inferior bridge will put all its non-Edge Designated Ports into a BLK state and will start a similar Handshake mechanism Downstream. When all non-Edge Designated Ports are blocked, the first port can transition to a Root Port Role and a FWD State and will send an Agreement BPDU to the superior bridge. The superior bridge can now transition its port into a FWD State. This way the loops are prevented and the “sync” boundary moves downstream to the other bridges.
As you can see, before agreeing to the RSTP proposal, a bridge must have all other ports “in sync”. A port is considered “in sync” if it is an Edge Port or if it is in a BLK State. If ports are not in BLK, they are transitioned to BLK in order to agree to the proposal.

This kind of mechanism is faster because it doesn’t use timers like in 802.1d STP, but it can only take place over P2P links. On Shared links, the protocol falls back to 802.1d timers mechanism. This also happens if no agreement is received.

3. Compatibility with 802.1d STP

802.1d Bridges do not understand RSTP BPDUs, but RSTP bridges understand STP BPDUs. When a RSTP bridge detects an 802.d BPDU, it falls back to using 802.1d mechanism on that port.

Leave a Reply

Your email address will not be published. Required fields are marked *