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
In a nutshell
  • 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.

Roles decidedfrom BPDUsForwarding rolesroot and designatedStates setforwardingRoles decidedfrom BPDUsBlocking rolesalternate and backupStates setdiscarding

How it works

Port roles

SW1 is the root bridge and both its ports are designated. SW2 and SW3 each have a root port toward SW1. On the SW2 to SW3 link, SW2 with the lower bridge ID has the designated port and SW3 has an alternate port in the discarding state.

RoleWhere it isState
Root portOn a non root switch, the port with the best path to the root; one per switchForwarding
Designated portOn each segment, the port with the best path to the root; every port of the root bridge is designatedForwarding
Alternate portAn RSTP port that has a different, worse path to the root through another switch; a standby for the root portDiscarding
Backup portAn RSTP port that connects to the same segment as a designated port of its own switch; a standby for the designated portDiscarding
DisabledThe port is administratively down or not running the protocolNot used

STP has three roles: root, designated and non designated. RSTP splits the last one into alternate and backup.

Root bridgeall ports designatedSwitch Aroot portSegmentdesignated portSwitch Balternate portSwitch Bstandby for root port

Role selection follows a fixed order on each switch.

  1. Every port on the root bridge is designated.
  2. 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.
  3. On each segment, the switch with the lowest root path cost advertises it, and that port is designated.
  4. 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.

StateReceives BPDUsLearns MAC addressesForwards frames
DisabledNoNoNo
BlockingYesNoNo
ListeningYesNoNo
LearningYesYesNo
ForwardingYesYesYes

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 stateSTP states it replacesForwards framesLearns MAC addresses
DiscardingDisabled, blocking, listeningNoNo
LearningLearningNoYes
ForwardingForwardingYesYes

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.

Designated portproposalNeighbor portsync other portsNeighbor portagreementDesignated portforwards at once

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.
STPRSTP
Standard802.1D802.1w
Port states53
Non forwarding rolesNon designatedAlternate, backup
BPDUsRoot originates, others relayEvery switch sends
Direct link failureAbout 30 secondsTypically a few seconds or less
Indirect failureUp to about 50 secondsTypically a few seconds
Exam tip

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.

Watch out

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.