Spanning Tree Protocol (STP) is a crucial networking concept used in Layer 2 networks to prevent loops.
Root Bridge:
Port Roles:
Ports in STP transition through several states during convergence:
To improve efficiency and convergence time, STP includes optional features:
PortFast:
UplinkFast:
BackboneFast:
RSTP, defined in IEEE 802.1w, significantly enhances STP’s performance. Key differences:
Faster Convergence:
New Port Roles:
Simplified Port States:
Edge Ports:
While the exam does not require you to interpret live packet captures, it may test your ability to identify which BPDU fields influence topology decisions.
The most critical field to recognize is the Bridge ID, which is used in the root bridge election process. It is a combination of:
Bridge priority (default: 32768)
MAC address
Other important fields include:
Root Path Cost: cumulative cost to reach the root bridge
Port ID: identifies the sending interface
Message Age, Max Age, Hello Time, and Forward Delay: STP timers
Exam Tip:
If asked, “Which field determines the selection of the root bridge?”, the correct answer is Bridge ID.
One of the most common points of confusion in STP is the distinction between port roles and port states. These represent two different dimensions of operation.
Port roles define a port’s responsibility in the STP topology.
Port states define the operational behavior of the port—whether it is forwarding traffic, learning MAC addresses, or neither.
Port Roles:
Root Port: the port with the lowest cost path to the root bridge
Designated Port: forwards traffic toward the root on a given segment
Blocked Port: prevents loops by not forwarding traffic
Disabled Port: administratively or physically down
Port States:
Blocking: does not forward traffic or learn MACs
Listening: prepares to transition to learning state; does not forward
Learning: starts building the MAC address table
Forwarding: fully active in forwarding traffic and learning MACs
Disabled: inactive state (interface down)
Remember: A port may be in the Designated role but in Listening state, for example, during topology convergence. The role describes its intended function, while the state describes its current behavior.
Rapid Spanning Tree Protocol (RSTP, IEEE 802.1w) improves convergence times and redefines some port roles.
Here is a comparison of roles between the traditional STP and RSTP:
| RSTP Role | Closest STP Equivalent | Description |
|---|---|---|
| Root | Root Port | Best path toward the root bridge |
| Designated | Designated Port | Active forwarding port on a segment |
| Alternate | Blocked Port | Backup to the root port on a different switch |
| Backup | Blocked Port | Backup to the Designated Port on the same segment |
| Disabled | Disabled | Inactive or administratively shut down |
Note:
In RSTP, the Listening state is eliminated. Instead, Discarding replaces Blocking, Listening, and Disabled states, reducing transition times.
Key mapping to remember:
Alternate Port in RSTP = Blocked Port in STP, but it allows faster failover.
While many STP enhancements originated from Cisco terminology—such as PortFast, UplinkFast, or Root Guard—Juniper provides equivalent mechanisms under different naming conventions. These equivalents are essential to recognize, especially for CLI-based configuration recognition questions.
| Cisco Feature | Juniper Equivalent | Function |
|---|---|---|
| PortFast | edge |
Marks a port as an edge (end host) to skip STP transition |
| BPDU Guard | bpdu-block-on-edge |
Disables edge ports if a BPDU is unexpectedly received |
| Root Guard | no-root-port |
Prevents a port from becoming a root port |
| Loop Guard | bpdu-timeout-action |
Prevents unintended forwarding in absence of BPDUs |
Example CLI in Junos:
set protocols rstp interface ge-0/0/1 edge
set protocols rstp interface ge-0/0/1 bpdu-block-on-edge
Important:
Even though terms like “PortFast” may be from the Cisco world, they can appear in exam scenarios for conceptual recognition. You are expected to match them with Junos implementations.
| Focus Area | Key Exam Points |
|---|---|
| BPDU Field | Bridge ID is used for root election |
| Role vs State | Role = logical function; State = forwarding/learning behavior |
| RSTP Role Comparison | Alternate ≈ Blocked; Backup = same-segment redundancy |
| Junos CLI Equivalents | edge (PortFast), bpdu-block-on-edge (BPDU Guard), no-root-port (Root Guard) |
How does a switch become the root bridge in Spanning Tree?
The switch with the lowest Bridge ID becomes the root bridge.
Bridge ID consists of priority + MAC address. STP compares Bridge IDs during election. The switch with the lowest value wins and becomes the root bridge. All path calculations in the topology are performed relative to the root bridge. Network engineers often manually lower the priority on the desired root switch to control topology.
Demand Score: 86
Exam Relevance Score: 90
What is the main difference between STP and RSTP?
RSTP provides faster convergence than STP.
Traditional STP can take 30–50 seconds to converge after a topology change. RSTP improves convergence by using rapid port state transitions and handshake mechanisms. It introduces new port roles such as alternate and backup ports. This significantly reduces network downtime during link failures.
Demand Score: 82
Exam Relevance Score: 87
Why might an RSTP port remain in blocking state?
RSTP blocks redundant links to prevent loops.
Ethernet networks require loop prevention. When multiple paths exist between switches, RSTP selects the best path to the root bridge and blocks redundant paths. The blocked port remains as an alternate path and can quickly transition to forwarding if the primary path fails.
Demand Score: 78
Exam Relevance Score: 83
What triggers a topology change in Spanning Tree?
Link failures, port state changes, or switch additions/removals.
When a topology change occurs, STP recalculates the network tree to maintain a loop-free topology. RSTP speeds up this process using rapid transitions and synchronization. Understanding these triggers helps troubleshoot sudden traffic disruptions in switched networks.
Demand Score: 75
Exam Relevance Score: 80