Spanning Tree · Topic 2 of 3
Port Roles, Port States and Convergence
Learn STP and RSTP port roles (root, designated, alternate, backup), port states, edge ports and how fast each protocol converges after a failure.
- 6 min
- Includes a diagram
- Roles: root, designated, alternate, backup, disabled. Alternate and backup exist only in RSTP.
- Only root and designated ports forward.
- Every port on the root bridge is designated.
What it is
Once the root bridge is elected, each port on each switch is given a role, which describes its place in the loop free tree, and a state, which describes what the port does with frames right now. Roles are decided by the BPDU comparison. States are the result: a port in the best position forwards, and the others block.
Convergence is the time the network needs to settle on a new loop free tree after a switch or link is added or fails. RSTP is built to make this very short.
How it works
Port roles

| Role | Where it is | State |
|---|---|---|
| Root port | On a non root switch, the port with the best path to the root; one per switch | Forwarding |
| Designated port | On each segment, the port with the best path to the root; every port of the root bridge is designated | Forwarding |
| Alternate port | An RSTP port that has a different, worse path to the root through another switch; a standby for the root port | Discarding |
| Backup port | An RSTP port that connects to the same segment as a designated port of its own switch; a standby for the designated port | Discarding |
| Disabled | The port is administratively down or not running the protocol | Not used |
STP has three roles: root, designated and non designated. RSTP splits the last one into alternate and backup.
Role selection follows a fixed order on each switch.
- Every port on the root bridge is designated.
- On every other switch, the port with the lowest root path cost becomes the root port. Ties are broken by sender bridge ID, then sender port ID.
- On each segment, the switch with the lowest root path cost advertises it, and that port is designated.
- A remaining port is alternate if it receives a better BPDU from another switch, or backup if it receives one from its own switch.
STP port states
STP uses five states. A port moves through them one by one, and that wait is why STP is slow.
| State | Receives BPDUs | Learns MAC addresses | Forwards frames |
|---|---|---|---|
| Disabled | No | No | No |
| Blocking | Yes | No | No |
| Listening | Yes | No | No |
| Learning | Yes | Yes | No |
| Forwarding | Yes | Yes | Yes |
Listening and learning each last one forward delay, which is 15 seconds by default. A port going from blocking to forwarding therefore needs 30 seconds after the decision.
RSTP port states
RSTP uses three states, because listening is merged into discarding.
| RSTP state | STP states it replaces | Forwards frames | Learns MAC addresses |
|---|---|---|---|
| Discarding | Disabled, blocking, listening | No | No |
| Learning | Learning | No | Yes |
| Forwarding | Forwarding | Yes | Yes |
Junos shows a discarding port as BLK in show spanning-tree interface.
How convergence differs
STP waits for timers. If a link fails and the root BPDUs stop, a blocked port waits for the max age of 20 seconds and then spends 30 seconds in listening and learning. After an indirect failure, STP can take about 50 seconds.
RSTP does not wait. It uses a proposal and agreement handshake between neighbors. A switch proposes to be designated on a link, the neighbor blocks its other non edge ports (a sync), and then agrees, so the link moves to forwarding at once. This spreads away from the root one link at a time and usually takes a few seconds at most.
Three RSTP features speed this up.
- Edge ports connect to hosts. They go to forwarding immediately and do not cause topology changes.
- Point to point links, which are full duplex, allow the proposal and agreement handshake. A shared (half duplex) link falls back to timers.
- Alternate ports already hold a path to the root. When the root port fails, the alternate takes over without waiting.
| STP | RSTP | |
|---|---|---|
| Standard | 802.1D | 802.1w |
| Port states | 5 | 3 |
| Non forwarding roles | Non designated | Alternate, backup |
| BPDUs | Root originates, others relay | Every switch sends |
| Direct link failure | About 30 seconds | Typically a few seconds or less |
| Indirect failure | Up to about 50 seconds | Typically a few seconds |
An RSTP port is declared down after three missed hello times, which is 6 seconds with the default hello of 2 seconds. A failed link on a directly connected port is noticed at once, without waiting for those hellos.
Common mistakes
Counting the alternate port as forwarding. Alternate and backup ports discard frames. They only stand ready.
Mixing the STP and RSTP state names. RSTP has no blocking or listening state, only discarding, learning and forwarding.
Expecting every port to be edge. A port toward another switch must not be an edge port. Only host ports should be, because an edge port skips the safety handshake.
On the root bridge, every port is designated. A question that asks for the root port of the root bridge has no valid answer, because the root bridge has no root port.
What to remember for the exam
- Roles: root, designated, alternate, backup, disabled. Alternate and backup exist only in RSTP.
- Only root and designated ports forward.
- Every port on the root bridge is designated.
- STP states: disabled, blocking, listening, learning, forwarding. RSTP states: discarding, learning, forwarding.
- Listening and learning each last the forward delay, 15 seconds by default.
- STP can need about 50 seconds after an indirect failure; RSTP typically needs a few seconds.
- RSTP convergence relies on edge ports, point to point links and the proposal and agreement handshake.
Check yourself
What is the difference between an alternate port and a backup port?
An alternate port has a path to the root through another switch and stands by for the root port; a backup port connects to the same segment as a designated port on its own switch.
Which STP states does the RSTP discarding state replace?
Disabled, blocking and listening.
Why is RSTP faster than STP after a failure?
It uses a proposal and agreement handshake and already knows its alternate port, so it does not wait for the 15 second timers.
Topic 2 of 3 in Spanning Tree
Test yourself on Spanning Tree
The full Juniper JNCIS-ENT JN0-352 question bank has 846 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Juniper. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.