Introduction
The current 802.1d Spanning-Tree Protocol (STP) standard was designed at a time where recovering connectivity after an outage within a minute or so was considered adequate performance. With the advent of Layer 3 (L3) switching in LAN environments, bridging now competes with routed solutions where protocols such as Open Shortest Path First (OSPF) and Enhanced Interior Gateway Routing Protocol (EIGRP) are able to provide an alternate path in less time.
Cisco enhanced the original 802.1d specification with features such as uplink fast, backbone fast, and portfast to speed up the convergence time of a bridged network. The drawback is that these mechanisms are proprietary and need additional configuration.
Rapid Spanning-Tree Protocol (RSTP; IEEE 802.1w) can be seen as an evolution of the 802.1d standard more than a revolution. The 802.1d terminology remains primarily the same, and most parameters have been left unchanged so users familiar with 802.1d can rapidly configure the new protocol comfortably. In most cases, RSTP performs better than Cisco's proprietary extensions without any additional configuration. 802.1w is also capable of reverting back to 802.1d in order to interoperate with legacy bridges (thus dropping the benefits it introduces) on a per-port basis. This document briefly explains the enhancements added by RSTP to the previous 802.1d standard.
Note: The availability of RSTP was first implemented as part of Multiple Spanning-Tree Protocol (MSTP) in CatOS 7.1 and Native IOS 12.1(11)EX and later. It will be available as a standalone protocol with the Rapid-Per-VLAN-Spanning-Tree (Rapid-PVST) mode in IOS 12.1(13)E and in CatOS 7.5. Under this mode, the switch runs an RSTP instance on each VLAN, following the usual PVST+ Cisco approach.
New Port Roles and Port States
802.1d defined four different port states: listening, learning,blocking, and forwarding. Refer to table below for more information. This was a bit confusing because it mixed the state of a port (whether it blocks or forwards traffic) and the role it plays in the active topology (root port, designated port, and so on). For example, from an operational point of view, there is no difference between a port in blocking state and a port in listening state; they both discard frames and do not learn MAC addresses. The real difference lies in the role the spanning-tree assigns to the port. It can safely be assumed that a listening port is either designated or root and is on its way to the forwarding state. Unfortunately, once in forwarding state, there is no way to infer from the port state whether the port is root or designated, which contributes to demonstrating the failure of this state-based terminology. RSTP addresses this by decoupling the role and the state of a port.
Port States
There are only three port states left in RSTP, corresponding to the three possible operational states. The 802.1d states disabled, blocking, and listening have been merged into a unique 802.1w discarding state.
table 1
Port Roles
The role is now a variable assigned to a given port. The root port and designated port roles remain, while the blocking port role is now split into the backup and alternate port roles. The Spanning-Tree Algorithm (STA) determines the role of a port based on Bridge Protocol Data Units (BPDUs). To keep things simple, the thing to remember about a BPDU is that there is always a way of comparing any two of them and deciding whether one is more useful than the other. This is based on the value stored in the BPDU and occasionally on the port on which they are received. This considered, the following paragraphs explain very practical approaches to port roles.
Root Port Roles
The port receiving the best BPDU on a bridge is the root port: This is the port that is the closest to the root bridge in terms of path cost. The STA elects a single root bridge in the whole bridged network (per-VLAN). The root bridge sends BPDUs that are more useful than the ones that any other bridge can send. The root bridge is the only bridge in the network that does not have a root port. All other bridges receive BPDUs on at least one port.
Designated Port Role
A port is designated if it can send the best BPDU on the segment to which it is connected. 802.1d bridges create a bridged domain by linking together different segments (Ethernet segments for example). On a given segment, there can be only one path toward the root bridge (if there were two, there would be a bridging loop in the network). All bridges connected to a given segment listen to each other's BPDUs and agree on the bridge sending the best BPDU as the designated bridge for the segment. The corresponding port on that bridge is designated.
Alternate and Backup Port Roles
These two port roles correspond to the blocking state of 802.1d. A blocked port is defined as not being the designated or root port. A blocked port receives a more useful BPDU than the one it would send out on its segment. Remember that a port absolutely needs to receive BPDUs in order to stay blocked. RSTP introduces these two roles for this purpose.
An alternate port is a port blocked by receiving more useful BPDUs from another bridge, as shown in the following diagram:
A backup port is a port blocked by receiving more useful BPDUs from the same bridge it is on, as shown in the following diagram:
This distinction was already made internally within 802.1d. This is essentially how Cisco's uplink fast functions. The rationale behind this is that an alternate port provides an alternate path to the root bridge and could therefore replace the root port should it fail. Of course, a backup port provides redundant connectivity to the same segment and cannot guarantee an alternate connectivity to the root bridge. It was therefore excluded from the uplink group.
Port Roles: Conclusion
RSTP calculates the final topology for the spanning-tree using exactly the same criteria as 802.1d. There is absolutely no change in the way the different bridge and port priorities are used. The name blocking is used for the discarding state in Cisco implementation. CatOS release 7.1 and later still display the listening and learning states, giving even more information about a port than the IEEE standard requires. However, the new feature is that there now is a difference between the role the protocol has determined for a port and its current state. For example, it is now perfectly valid for a port to be designated and blocking at the same time. While this will typically happen for very short periods of time, it simply means that this port is in a transitory state towards designated forwarding.
New BPDU Format
A few changes have been introduced by RSTP to the BPDU format. Only two flags, Topology Change (TC) and TC Acknowledgment (TCA), were defined in 802.1d, however RSTP now uses all six remaining bits of the flag byte in order to do the following:
encode the role and state of the port originating the BPDU
handle the proposal/agreement mechanism
Another important change is that the RSTP BPDU is now of type 2, version 2. The implication of this is that legacy bridges must drop this new BPDU. This property makes it easy for a 802.1w bridge to detect legacy bridges connected to it.