Site is Under Maintenance
Please come back again in...
00 Days
00 Hours
00 Minutes
00 Seconds

STP vs. RSTP Port States and Roles

The Spanning-Tree Protocol (STP) (IEEE 802.1D) is primarily designed to prevent Layer 2 loops and broadcast storms while ensuring network redundancy. Developed during a time when recovery from outages lasting a minute or more was deemed acceptable. STP has become less suitable as technology has advanced and businesses have demanded quicker recovery solutions.

To address these needs, the Rapid Spanning-Tree Protocol (RSTP) (IEEE 802.1w) was introduced, bringing significant enhancements over STP. RSTP features new port states and roles, as well as notably faster convergence times. For network administrators, RSTP is the preferred choice for maintaining an available network, especially in environments where quick recovery is essential.

This tutorial offers a comprehensive overview of the STP and RSTP standards, covering the following topics:
  • The STP election process
    • STP port states and roles
    • The RSTP election process
      • RSTP port states and roles

    STP Overview

    For switches within the same network to effectively run the Spanning-Tree Protocol (STP), they must be enabled for STP to determine which switch will be elected as the "root bridge." This designated root bridge is responsible for sending configuration Bridge Protocol Data Units (BPDUs) and other essential information to its directly connected switches, which then forward these BPDUs to their neighboring switches. Each switch has a Bridge ID (BID), priority value, which combines a priority value (32768) with the switch's MAC address. The switch with the lowest BID is elected as the root bridge.

    STP Port States

    STP defines five port states for switches:

    1. Disabled: The port is turned off due to an administrative command.

    2. Blocking: When a device connects, the port initially enters this state, preventing data from passing through.

    3. Listening: The switch listens for incoming BPDUs and can send them as well.

    4. Learning: The switch receives a superior BPDU, halts its own BPDU transmissions, and relays the superior BPDUs to its neighbors.

    5. Forwarding: In this state, the port actively forwards traffic.

    State Port Roles

    • Root Port: These are the ports on non-root switches that have the best cost path to the root bridge. They are responsible for forwarding data to the root bridge.
    • Designated Port: These ports are found on both the root and designated switches. All ports on the root bridge are designated ports.
    • Blocked Port: All other ports connecting to bridges or switches are placed in a blocked state. Note that access points leading to workstations or PCs are not affected.

    STP Election Process

    When switches are powered on, they begin by sending configuration BPDUs that include their Bridge IDs (BIDs), each switch initially considering itself the root bridge. When a switch receives a BPDU with a superior (or lower value) BID, it stops sending its own configuration BPDUs and instead relays the superior BPDUs to its neighboring switches.

    After the root bridge is identified, a secondary election process commences to determine the "root port" for each switch - the port that will forward frames to the root bridge. This process follows these steps util a root port is selected.

    1. A switch port receives superior BPDUs from another switch and recognizes that switch as the root bridge.

    2. The port with the lowest path to the root bridge is chosen as the root port, if applicable.

    3. If multiple ports have the same path cost, the switch selects the port with the lowest sender BID.

    4. If the sender BIDs are identical (usually indicating the same switch), the port with the lowest physical port number on the sending switch becomes the selected root port (this serves as the final tiebreaker).

    Election Process Diagrams

    Single Switches

    Let's examine the process for Switch 2 in the following diagram below:

    A switch port receives superior BPDUs, and both Port 1 and Port 2 on Switch 2 receive the same superior BPDU from Switch 1. As a result, further steps are necessary to determine which port will be the root port. Port 3 on Switch 2 is disqualified because it is receiving BPDUs from Switch 3.

    Step 1: Evaluate the Port with the Lowest Root Path Cost

    Both Port 1 and Port 2 have equal path costs, leaving us with a tie.

    Step 2: Check the Sender BID

    Since both Port 1 and Port 2 have the same sender BID (that of Switch 1), we move to the final tiebreaker.

    Step 3: Determining the Lowest Port Number

    Port 1 of Switch 2 is connected to the lowest port number on Switch 1 (also Port 1); therefore, Port 1 is elected as the root port for Switch 2.

    Stacked Switches (MS Classic)

    The outcome of the STP Election Process can vary when using Stacking Technologies. Let's examine the process for Switch 2 while considering the following points:
    • Single Logical Control Plane: A switch stack operates as one logical unit, which simplifies the management and operation of the switches within the stack.
    • Chassis MAC Address: In a switch stack, a unique chassis MAC address is generated (e.g., 00:18:0A:4F:XX) that is specific to the switch organization. This ensures consistent identification across the stack.
    • Active Switch Election: Upon boot, the switch stack converges and deterministically elects an Active Switch. This Active Switch is responsible for handling all control plane functions.
    • Incremental Switch Stack Port IDs: The Port IDs within the stack increment starting from the Active Switch, which helps maintain an organizes structure for port identification and management.

    A Switch Port Receiving Superior BPDUs

    When a switch port receives superior BPDUs, both Port 1 and Port 2 receive the same superior BPDU from Switch 1, prompting further steps to determine the root port.

    1. Lowest Root Path Cost: Ports 1 and 2 have equal path costs, leading to a tie.
      
    2. Lowest Sender BID: Both ports also have the same Bridge ID (BID), which is that of Switch 1, so we proceed to the final tiebreaker.

    3. Lowest Port Number of the Sending Switch: Port 1 of Switch 2 connects to Port 1 of a Member switch, while Port 2 connects to Port 1 of the Active switch. Since the Active switch typically sends BPDUs with lower Port IDs than the Member switch, Port 2 of Switch 2 is elected as the root port.

    Stacked Switches (MS390/Catalyst)

    In the case of MS390/Catalyst switches, the outcome of the Stack Election process does not affect how Switch Stack Port IDs are incremented. Consequently, a Member switch can send BPDUs with lower Port IDs than those of the Active switch. This means that it’s not uncommon for ports connected to a Member switch to be elected as the root port, particularly if the process reaches the fourth tiebreaker.

    Rapid Spanning Tree Protocol (RSTP)

    As the name implies, RSTP provides a quicker transition to a port-forwarding state compared to the classic Spanning Tree Protocol (STP). While STP has five switchport states, RSTP simplifies this to three:

    RSTP Port States

    • Disabled: The port is disabled due to an administrative command.
    • Discarding: The port enters this state when a device is connected, preventing traffic to avoid loops.
    • Learning: The switch receives a superior BPDU, stops sending its own BPDUs, and relays the superior BPDUs.
    • Forwarding: The port actively forwards traffic.

    RSTP Port Roles

    • Root: Ports on non-root switches that provide the best cost path to the root bridge, forwarding data to the root.
    • Designated: Ports on the root bridge and designated switches; all ports on the root bridge are designated.
    • Alternate: Receives BPDUs from another switch but remains in a blocked state, ready to take over if needed.
    • Backup: Receives BPDUs from its own switch but remains blocked. This role is uncommon in production environments, typically appearing only when hubs are in use.

    Alternate and Backup Ports in RSTP

    In RSTP, the election process mirrors that of STP, but it introduces two new port roles: alternate and backup, replacing the single blocked port role.

    Alternate Port

    An alternate port receives BPDUs from another switch while remaining in a blocked state. For instance, if a switch has two paths to the root bridge, one port will be designated as the root port, and the other will become the alternate port. Should the root port fail at any time, the alternate port can quickly transition to become the new root port, ensuring network redundancy.

    Backup Port

    A backup port receives BPDUs from its own switch but remains blocked. For example, if a switch has two ports connecting to different switches, one port will be elected as the root port, while the other will be designated as the backup port. This setup allows for an additional layer of redundancy within the same switch, although the backup port does not actively forward traffic unless the root port fails.

    Comparing STP and RSTP Port States


    In summary, RSTP simplifies port states by combining some of the roles used in STP, resulting in faster convergence times and more efficient management of network resources.

    Rate This Article

    Thanks for reading: STP vs. RSTP Port States and Roles, Sorry, my English is bad:)

    Getting Info...

    About the Author

    I'm Aevon...Just a gal with an insane passion for all things cybersecurity. 17 years in the industry and still love what I'm doing.

    Post a Comment

    Cookie Consent
    We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
    Oops!
    It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
    AdBlock Detected!
    We have detected that you are using adblocking plugin in your browser.
    The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
    Site is Blocked
    Sorry! This site is not available in your country.