STP Port Roles and Port States Explained

STP Port Roles and Port States Explained
Networking ATN Campus October 01, 2026 53 views

STP Port Roles and Port States Explained

After learning how STP elects the Root Bridge, the next important concept is understanding STP port roles and port states.

STP uses these roles and states to decide which switch ports should forward traffic and which redundant paths should remain non-forwarding to prevent Layer 2 loops.

```

Why Does STP Need Port Roles?

```

Consider a network with redundant links:

          SW1
         /   \
        /     \
      SW2-----SW3

Without a loop-prevention mechanism, Ethernet frames could circulate around the network.

STP assigns different roles to ports so that the network has a loop-free logical topology while keeping redundant paths available for recovery.

```

Main STP Port Roles

```

In classic 802.1D STP, the important port roles are:

  • Root Port
  • Designated Port
  • Non-Designated Port

In Rapid Spanning Tree Protocol (RSTP), the roles include:

  • Root Port
  • Designated Port
  • Alternate Port
  • Backup Port

For CCNA-level learning, the most important roles to understand are Root, Designated, and Alternate.

```

1. Root Port

```

The Root Port is the port on a non-root switch that provides the switch's best path toward the Root Bridge.

Each non-root switch normally has one Root Port for a given spanning tree instance.

             Root Bridge
              +------+
              | SW1  |
              +--+---+
                 |
                 |
              Root Port
                 ↓
              +--+---+
              | SW2  |
              +------+

The Root Bridge itself does not have a Root Port because it is already the root.

```

2. Designated Port

```

A Designated Port is the forwarding port selected for a network segment.

The Designated Port provides the best path from that segment toward the Root Bridge.

        SW1
    Root Bridge
         |
         |
   Designated Port
         |
        SW2

On the Root Bridge, its active STP ports are generally Designated Ports because the Root Bridge has the best path to itself.

```

3. Alternate Port

```

An Alternate Port is an RSTP port that provides an alternative path toward the Root Bridge but is not currently the selected Root Port.

              SW1
           Root Bridge
            /      \
           /        \
         SW2--------SW3
                   ^
                   |
            Alternate Path

The alternate path can become active if the current preferred path fails, depending on the network topology and RSTP operation.

```

Root Port vs Designated Port vs Alternate Port

```
Port Role Purpose Typical State
Root Port Best path toward Root Bridge Forwarding
Designated Port Best forwarding port for a segment Forwarding
Alternate Port Backup path toward Root Bridge Discarding in RSTP
```

What Are STP Port States?

```

Port roles tell us what a port does, while port states describe what the port is currently doing in the STP process.

Traditional 802.1D STP uses these states:

  • Blocking
  • Listening
  • Learning
  • Forwarding
  • Disabled
```

1. Blocking State

```

In the classic STP model, a port in the Blocking state does not forward normal data frames.

It can still receive and process BPDUs so that the switch can participate in STP calculations.

    Data Frames
         X
         |
    +----+----+
    | Switch  |
    +---------+
         ^
         |
       BPDUs

Blocking helps prevent redundant Layer 2 paths from creating loops.

```

2. Listening State

```

In classic STP, a port moves through the Listening state while STP determines the appropriate topology.

The port does not forward normal user data during this state.

The switch processes BPDUs and participates in the spanning-tree decision process.

```

3. Learning State

```

In the Learning state, the switch begins learning source MAC addresses and building its MAC address table.

The port still does not forward normal user data frames yet.

    Frame arrives
         |
         v
  Learn source MAC
         |
         v
   MAC Address Table
```

4. Forwarding State

```

In the Forwarding state, the port can forward normal data traffic and continue participating in STP.

Root Ports and Designated Ports normally operate in a forwarding role when they are active.

```

5. Disabled State

```

A port that is administratively disabled does not participate in normal forwarding or STP operation.

    interface GigabitEthernet0/1
     shutdown

The exact operational state shown by Cisco can depend on platform and STP implementation.

```

Classic STP Port State Progression

```
   Blocking
       |
       v
   Listening
       |
       v
    Learning
       |
       v
   Forwarding

The classic STP model uses these transitional states to prevent temporary loops while the topology converges.

```

STP Roles vs States

```

This distinction is extremely important for CCNA students.

Port Role Answers
Root Port Which port provides the best path toward the Root Bridge?
Designated Port Which port is selected to forward for a segment?
Alternate Port Which port provides an alternative path toward the Root Bridge?
Port State Answers
Blocking Not forwarding normal data
Listening Participating in topology calculation
Learning Learning MAC addresses
Forwarding Forwarding normal traffic
```

STP Topology Example

```
                SW1
             ROOT BRIDGE
             /         \
            /           \
      Designated       Designated
          |               |
         SW2-------------SW3
           \             /
            \___________/

    SW2 → Root Port toward SW1
    SW3 → Root Port toward SW1

    One redundant path may become
    non-forwarding to prevent a loop.
```

How Does STP Choose the Root Port?

```

A non-root switch compares available paths toward the Root Bridge. STP selects the path with the best BPDU information, with path cost being an important factor.

When multiple paths have equal cost, additional tie-breakers are used, including sender Bridge ID and sender Port ID information.

The exact selection process is more detailed than simply saying "the fastest port wins," so CCNA students should understand that STP compares several values in sequence.

```

What Happens When a Link Fails?

```
         SW1
          |
      Root Path
          |
         SW2
          |
      Backup Link
          |
         SW3

   Primary path fails
          ↓
   STP recalculates
          ↓
   Backup path can become
   the forwarding path

The purpose of maintaining an alternate path is to provide redundancy while preventing that path from creating a loop during normal operation.

```

STP vs RSTP

```
Feature STP RSTP
Standard 802.1D 802.1w
Convergence Generally slower Generally faster
Alternate Role Not defined as an RSTP role Yes
Port State Model Blocking, Listening, Learning, Forwarding Discarding, Learning, Forwarding

RSTP simplifies the state model and uses additional mechanisms to achieve faster convergence.

```

Cisco STP Verification

```

Use the following command:

```

Switch# show spanning-tree 
```

To check a particular VLAN:

```

Switch# show spanning-tree vlan 10 
```

Look for information such as:

  • Root Bridge
  • Root path cost
  • Root Port
  • Designated Ports
  • Port roles
  • Port states
```

Practical Packet Tracer Lab

```

Topology

          SW1
         /   \
        /     \
      SW2-----SW3

Tasks

  1. Connect three Cisco switches.
  2. Create redundant links between the switches.
  3. Configure VLAN 10.
  4. Check which switch becomes the Root Bridge.
  5. Identify the Root Port on SW2.
  6. Identify the Root Port on SW3.
  7. Identify Designated Ports.
  8. Identify the non-forwarding/alternate path.
  9. Disconnect the preferred path.
  10. Observe how STP/RSTP changes the topology.

Useful Commands

```

Switch# show spanning-tree
Switch# show spanning-tree vlan 10
Switch# show spanning-tree summary 

Quick Quiz

```

Question 1

What is a Root Port?

Show Answer

The port on a non-root switch that provides the best path toward the Root Bridge.

Question 2

What is a Designated Port?

Show Answer

The port selected to forward traffic for a particular Layer 2 segment as part of the spanning-tree topology.

Question 3

What is an Alternate Port?

Show Answer

In RSTP, it is a backup path toward the Root Bridge that is not currently selected as the Root Port.

Question 4

Which classic STP state allows normal data forwarding?

Show Answer

Forwarding.

Question 5

Which classic STP state learns MAC addresses but does not forward normal user traffic?

Show Answer

Learning.

Question 6

What is the RSTP state corresponding to the non-forwarding condition?

Show Answer

Discarding.

```

Key Takeaways

```
  • STP uses port roles and states to create a loop-free Layer 2 topology.
  • A Root Port provides the best path from a non-root switch toward the Root Bridge.
  • A Designated Port is selected to forward for a Layer 2 segment.
  • An Alternate Port provides a backup path in RSTP.
  • Classic STP uses Blocking, Listening, Learning, and Forwarding states.
  • RSTP uses Discarding, Learning, and Forwarding states.
  • Port roles and port states describe different aspects of STP operation.
  • show spanning-tree is an essential Cisco command for troubleshooting STP.
```
```

Want to Learn STP, RSTP and Switching? Visit ATN Campus

Want to learn STP, RSTP, VLANs, trunking, switching, routing, and network troubleshooting through practical training?

Visit ATN Campus and learn networking theory together with hands-on Cisco labs and practical real-world networking scenarios.

Build Practical Networking Skills

  • CCNA – Cisco Certified Network Associate
  • CCNP – Cisco Certified Network Professional
  • STP & RSTP
  • VLANs & Trunking
  • EtherChannel & LACP
  • Inter-VLAN Routing
  • Network Security
  • CEH – Certified Ethical Hacker
  • Cisco Packet Tracer Labs
  • Python for Network Automation

Whether you are starting your networking journey, preparing for CCNA or CCNP, or looking for practical IT skills, ATN Campus can help you move from theory to hands-on networking.

???? Want to learn networking? Visit ATN Campus.

???? Learn Networking. ???? Master Routing & Switching. ???? Practice with Real Labs. ???? Prepare for Certifications. ???? Build Your IT Career with ATN Campus.
Document ATN CAMPUS