Rapid Spanning Tree Protocol
- Describe enhanced switching technologies (including: VTP, RSTP, VLAN, PVSTP, 802.1q)
One of the greatest drawbacks of PortFast, UplinkFast, and BackboneFast is that they require an all-Cisco network because they are Cisco-proprietary functions. Luckily, the IEEE made its own revised version of Spanning Tree Protocol to incorporate these functions while incorporating an updated algorithm for faster topology convergence. Enter Rapid Spanning Tree
Protocol (RSTP), IEEE specification 802.1w.
To help remember that the 802.11w designation is for RSTP, think of Elmer Fudd: The wascally wabbit wuvs Wapid STP (802.1w).
Spanning Tree Similarities
Aside from the fact that 802.1w Rapid Spanning Tree Protocol and 802.1d Spanning Tree Protocol are both defined by an IEEE 802.1 specification, RSTP shares some core functional principles with STP, making them similar in several ways. Namely, RSTP adopts the same switch and port election process in determining the root bridge, root ports, and designated ports. In other words, the switch with the lowest Bridge ID advertised in its BPDUs becomes the root bridge, and every nonroot switch chooses its root port back to that root bridge based
on the lowest cumulative root path cost. In case of a tie in the root path cost, the Bridge ID is used, followed by the definitive tiebreaker, the port priority. And again, for each segment, a designated port is chosen for each segment to forward frames from one segment to the next. Because RSTP and STP share these core elements, Rapid Spanning Tree Protocol is completely backward-compatible with Spanning Tree Protocol. The only caveat is that you will not be able to enjoy the radical improvements that are incorporated with Rapid Spanning Tree Protocol on switches that are running traditional 802.1d STP. And with that segue, we will now explore the differences between the two spanning tree algorithms and how these changes dramatically improved the convergence issues with Spanning Tree Protocol.
Make sure that you understand and can explain the similarities between 802.1d Spanning Tree Protocol and 802.1w Rapid Spanning Tree Protocol.
RSTP Port States and Roles
RSTP adopted the 802.1d port states with a slight difference. Because the blocking and listening states were essentially nonoperational in terms of actively discovering the network’s topology, RSTP has redefined these to be a discarding state. Discarding ports are similar to blocking ports in that they do not forward frames or learn MAC addresses but still can receive
BPDUs from other switches. Learning and forwarding states are still active spanning tree transition states and maintain the same functionality in RSTP-enabled LANs. As previously mentioned, RSTP still uses the concepts of a root port and designated ports. To incorporate additional functionality that is specific to popular redundant LAN designs, RSTP created two more port roles, as illustrated in Figure 14.4. Based on the principle of UplinkFast, the following two new port roles were created:
- Alternate port: A blocking (or I should say discarding) port that becomes the root port if the active root port fails. In other words, this is a nonforwarding root port that has the second-best path back to the root switch.
- Backup port: A discarding port that becomes the designated port if the active designated port fails. The backup port occurs when you have two or more ports connected to the same LAN segment and provides a redundant backup to the segment (but not necessarily back to the root).
Keep in mind that despite alternate ports and backup ports having specific roles, they are still discarding interfaces.
Notice that the election has occurred in this topology and the top switch has been elected the root switch based on its low Bridge ID. Each nonroot switch chose its root ports based on the fastest path back to the root switch. Similarly, the designated ports were chosen for each LAN segment based on the lowest root path cost. Where RSTP shines can be witnessed in the redundant links between Switches B and C.
In traditional 802.1d, the parallel links between Switches B and C would result in three of the four ports being blocked to avoid a possible loop. If a topology change occurred, one of the blocking ports would transition to the listening state, followed by the learning state, before forwarding again, which could take anywhere from 30 to 50 seconds. With Rapid Spanning Tree, the three ports are still technically discarding frames. However, Switch B’s bottom link port has been given the RSTP alternate role because that port would become the root port if Switch B’s root port went down. In addition, Switch C’s top link port has been named the backup port for that specific segment because that port would be elected the designated port if its current link connected to the designated port went down. To solidify the function of these roles, let’s look at what happens in the event of a link failure.
If the link between Switch B and the root switch fails, as shown in Figure 14.5, the alternate port quickly becomes the new root port and begins forwarding frames. In Figure 14.6, the link connected to the designated port fails, causing the backup port to become the active designated port for that segment. Because the bottom link has gone down, Switch B puts its alternate port into a discarding state, and its previously discarding port transitions to a forwarding state.
Now, let’s see what happens when Switch C loses its link back to the root switch, as shown in Figure 14.7. Because Switch C has lost its root port, it now must find a new root port based on the fastest way back to the root switch (in this case, the port connected to the bottom link).
In the event that Switch C’s new root port fails, the port connected to the top link becomes the new root port, so this interface is elected as an alternate port. Now the roles are reversed for Switch B because its alternate port is now the designated port for that LAN segment because it has the fastest port back to the root. In addition, the port that was once in a discarding state for Switch B is now transitioned to a backup state, because that will become the designated port if the current designated port fails. It is important to keep in mind that although these roles have different names, they are still in a discarding state and are not forwarding frames or learning MAC addresses.
RSTP Link and Edge Types
Another interesting difference between Spanning Tree Protocol and Rapid Spanning Tree Protocol is RSTP’s distinction between the links between switches and connections to end devices. For instance, RSTP considers any connection between switches running in full duplex (directly connected to each other) as link-type point-to-point. If the switch interface is running
in half duplex (connected to a hub), the link is called link-type shared because it is probably connected to a shared network. Finally, nonswitch or hub end devices such as computers are edgetype connections according to RSTP.
Rapid Spanning Tree Protocol actually reacts to topology changes and converges faster depending on these distinctions. Specifically, link-type point-to-point and edge-type connections play a specific role in how fast RSTP adapts to network topology transitions. Because the use of hubs is rather insignificant these days, RSTP does not put any effort into increasing convergence speed for link-type shared connections.
BPDUs and Topology Changes
Rapid Spanning Tree Protocol uses BPDUs to communicate information throughout the topology with one major distinction: each switch generates its own BPDUs and advertises them to neighboring switches. This is significantly different from traditional STP, in which the root bridge generates the BPDUs (except when a topology change is detected), and each switch passes that information to the next switch. What’s more, RSTP takes a chapter out of our routing protocol’s book and uses these BPDUs as keepalives to let neighboring switches know that the switches are still active in the topology. When a switch fails to hear three BPDU keepalives from its neighbor, it considers that neighbor as dead and immediately reacts to the change. That is considerably more aggressive than traditional STP switches, which would wait a max age (20 seconds) before
considering the switch dead. If an RSTP switch receives a BPDU from an 802.1d STP switch, it sends STP BPDUs only to that switch to allow for backward-compatibility. Recall that STP switches send a topology change notification (TCN) back to the root bridge if that change has occurred. This is followed by a notification broadcast from the root bridge to age out old MAC address entries. With RSTP, when a topology change occurs, the TCN still occurs. However, it is sent to all switches from the switch that detects the anomaly, and switches immediately start aging out their MAC address entries in the CAM table. This is similar to the flash flood of updates that occurs with link-state routing protocols such as OSPF. By not having to rely on the root bridge to alert the switched topology of the topology change, the switches can age out their old MAC entries and start adapting to the new topology considerably faster than 802.1d STP.
By now you should recognize that the most unique function of RSTP is its capability to converge in an expedient manner. The core ingredient of this feature is that it no longer reactively relies on conservative timers to transition to a forwarding state.
For instance, on edge ports that are connected to end devices, the interface takes on the same functionality as PortFast with BPDU Guard in that it immediately transitions to a forwarding state. In fact, the way to configure the port as an edge port on a switch is to configure PortFast on the interface. When an edge port receives a BPDU, however, it immediately transitions to
a point-to-point link type.
Where the connection between two switches is a full-duplex point-to-point link, RSTP takes a rather unique approach to converging. When a point-to-point link comes up between two switches, a handshake occurs between the two switches using BPDUs to establish what role their local ports will play for that link. Because there is no reliance on conservative timers to
transition the ports to a forwarding state, the exchange occurs rather quickly.
We’ve already established that switches use traditional STP algorithms to determine their root port and designated ports. However, the process used when ports transition to a forwarding state is a proposal/agreement handshake. Specifically, when a switch receives a BPDU and calculates that its local port will become the designated port for that segment after connecting to a
switch, it immediately sends a proposal to its neighbor to begin forwarding. When RSTP switches receive proposals to forward and determine that the port that received the proposal will become a root port, they put all nonedge ports in a discarding state (if they aren’t already) to avoid any possibility of a loop occurring.
You can think of this as similar to getting a marriage proposal. You would want to discontinue any other relationships to avoid confusion before accepting the proposal. This process of blocking all nonedge point-to-point links before sending a proposal is called synchronization or sync for short. It is so named because the switch ensures that these new links to a root switch and the resulting topology will be accurately synchronized with all other ports.
When the RSTP switch has successfully synced all its ports, it sends an agreement back to the switch that sent the proposal to allow forwarding. It begins to forward out its root port and starts learning MAC addresses itself. When the original switch receives the agreement message on its designated port, it too immediately begins forwarding and learning MAC addresses.
Consider the example shown in Figure 14.8. Suppose Switch A was just added to the topology. After an initial exchange of BPDUs, Switch A realizes that it will be the root switch because it has the lowest Bridge ID, and its local interface will be the designated port for that new segment. Switch A sends a proposal to forward to Switch B. Switch B receives that proposal and knows its local port will be a root port. It begins syncing by blocking all nonedge ports (in this case they are all already discarding because no other switches are attached). Switch B replies to Switch A with an agreement BPDU and immediately begins learning MAC addresses and forwarding on that port. Likewise, Switch A receives the agreement back and transitions its designated port to a forwarding state and begins learning MAC addresses as well.
Let’s complete your understanding of RSTP’s rapid transition to forwarding states by looking at what happens when the switching topology changes and we add another switch and a redundant connection, as shown in Figure 14.9. The initial BPDUs are exchanged, and Switch A recognizes that its port connected to Switch C will be a designated port. Again, Switch A sends
a proposal to transition to a forwarding state to Switch C. When Switch C receives this proposal on its soon-to-be root port, it begins its syncing process. It puts the interface between Switch C and Switch B into a discarding state before sending an agreement back to Switch A to avoid a possible loop. It does not put the port connected to the PC into a discarding state, though, because it is an edge port and does not participate in RSTP. After the agreement is sent, Switch C begins forwarding on its root port. Likewise, Switch A begins forwarding on its designated port after it receives the agreement.
After all this handshaking occurs between Switches C and A, Switch B also realizes that its link will become a designated port for the link between Switch B and C. One more time, a proposal is sent from Switch B to Switch C to begin forwarding. This time, however, Switch C’s port is not the optimal port back to the root bridge, so it does not become a root port. Thus, no agreement is ever sent back to Switch B, and that port stays in a discarding state (technically an alternate state, because that is an alternate route to the root switch). Switch B continues to send proposals until a forward-delay timer expires. At this point it assumes that it is a designated port and starts forwarding.
Here is a summary of the steps involved in this synchronization process:
- After switches are connected to a point-to-point link, they exchange BPDUs.
- If a switch determines that its port will become a designated port, it sends a proposal to start forwarding to its neighbor.
- The neighboring switch receives the proposal. If its port is a root port, it synchronizes the change by putting all nonedge ports into a discarding state and sends an agreement back to the original switch. If its port is a discarding port, it does not respond to the proposal.
- The original switch immediately transitions to a forwarding state if it receives an agreement or eventually transitions to a forwarding state after a forward-delay occurs. Although this sounds as if there are many steps, the process happens relatively quickly. Interestingly enough, the topology would end up in the same state (with the same ports blocking and forwarding) as traditional STP. The key difference is that it can take several seconds to have all switches converge (even in larger networks) as opposed to several minutes with 802.1d STP (because each switch would take 30 to 50 seconds to reach a forward state).
The configuration and verification of Rapid Spanning Tree Protocol is beyond the scope of this book and certification level. If you’re interested in pursuing the implementation of an enterprise RSTP network, con tinue with the Cisco Certified Network Professional (CCNP) certification track after completing your CCNA.
To solidify all the novel terminology and processes we covered in this section, let’s put that new knowledge to the test by considering the topology illustrated in Figure 14.10.
Imagine that you are the proud new owner of Switch C, and you just added it to the RSTP topology. Knowing what you know now, answer the following questions about what transpires in the RSTP network:
- Which port is the root port, and why?
- What state is the other port in?
- Is there a backup port? Why or why not?
- What does Switch D do when it detects Switch C?
- How does Switch C respond?
- What does Switch B do when it detects Switch C?
- How does Switch C respond?
The port connected to Switch D is the root port because it has the fastest path back to the root switch. Switch C’s other port gets put into a discarding state because it has the least optimal path to the root. Specifically, RSTP puts this port into an alternate state because that port will become the root if its current root goes down. There is no backup port in this scenario because there are no parallel links in the design to the same LAN segment.
When Switch D detects Switch C, it discovers that its port will become a designated port and sends a proposal to forward to Switch C. When Switch C receives that proposal, it immediately begins syncing by blocking all nonedge ports. It then sends an agreement back to Switch D and begins forwarding and learning MAC addresses. When Switch D receives that agreement, it too begins forwarding frames on its designated port and starts learning MAC addresses.
When Switch B detects the new link to Switch C, it too realizes that its port will be a designated port and sends a proposal to Switch C. Because Switch C’s port is a suboptimal port, it remains discarding and does not reply to Switch B’s proposal. After a forward delay occurs, Switch B transitions its designated port to a forwarding state and begins forwarding and learning MAC addresses.