Certopolis

CompTIA Network+ (V9)

Spanning tree STP vs RSTP explained for Network+

Spanning tree blocks redundant switch links so frames cannot loop. The switch with the lowest bridge ID becomes root, and priority is compared before MAC address. RSTP (802.1w) merges the blocking, listening and disabled states into one discarding state, adds alternate and backup roles, and converges faster by handshake rather than timers.

Electing the root bridge

Cisco's guide says the switch with the highest-priority bridge ID, meaning the lowest numerical value, is elected root. The bridge ID combines a priority, an extended system ID and a MAC address, and the priority occupies the most significant bits. The default priority is 32768.

Priority is compared first. If switch 1 is set to 4096 and switch 2 keeps 32768, switch 1 becomes root even if switch 2 has the lowest MAC address. The MAC address only decides when priorities are equal.

BPDUs flow outward from the root and carry the root bridge ID, path cost to the root, sender bridge ID, port ID and timers. Default 802.1D timers: hello 2 seconds, forward delay 15 seconds, max age 20 seconds.

802.1D port states

Blocking: the port does not take part in frame forwarding.

Listening: the first transitional state after blocking.

Learning: the port prepares to forward. It discards frames from the attached segment but adds end-station addresses to its address table.

Forwarding: the port forwards frames. Disabled: the port does not take part in STP and does not forward.

The forward delay timer sets how long each of the listening and learning states lasts before the port forwards. At the 15-second default, a blocked port takes 30 seconds to reach forwarding, which is why classic STP is slow.

What RSTP changes

States: disabled, blocking and listening merge into discarding. Discarding ports are not in the active topology and do not learn MAC addresses. Learning and forwarding keep their meanings.

Roles: the root port receives the best BPDU on the bridge. The designated port sends the best BPDU on a segment. An alternate port is blocked and receives better BPDUs from another bridge, so it can replace a failed root port. A backup port is blocked and receives better BPDUs from the same bridge, as when two ports on one switch connect to the same hub.

Speed: an edge port, connected to an end station, moves straight to forwarding, and loses edge status if it receives a BPDU. If a port misses three consecutive hellos, its information is aged out at once instead of waiting for max age. A proposal and agreement handshake lets designated ports reach forwarding without waiting for timers.

RSTP works with legacy 802.1D switches, but on a link to one it falls back to 802.1D behaviour and loses the fast convergence there.

Where the exam catches people

  • Believing the lowest MAC address always wins the root election: priority is compared first; MAC only breaks ties.
  • Believing a higher bridge priority value makes a switch root: the lowest numerical bridge ID wins.
  • Believing the learning state forwards user frames: it builds the address table but still discards frames.
  • Believing an RSTP alternate and backup port are the same: alternate hears better BPDUs from another bridge; backup hears them from its own bridge.
  • Believing RSTP has a listening state: blocking, listening and disabled merged into discarding.

Written from CompTIA's documentation

Try 3 questions on this

Pick an answer to see why each option is right or wrong.

  1. Switch 1 has a bridge priority of 4096, while switch 2 keeps the default 32768 but has the lowest MAC address in the network. Which of the following becomes the root bridge?

    Right. In the game that’s Renown for your Network Implementation building.

    Not that one: B is right. In the game your Network Implementation building would lose a little Renown, and this question would come back later.

  2. A switch running RSTP has two ports cabled to the same hub; one port is designated for that segment and the other is discarding. Which of the following roles does the discarding port hold?

    Right. In the game that’s Renown for your Network Implementation building.

    Not that one: B is right. In the game your Network Implementation building would lose a little Renown, and this question would come back later.

  3. A port on a switch running classic spanning tree is adding received frames' source addresses to its address table but is not yet passing user frames. Which of the following states is it in?

    Right. In the game that’s Renown for your Network Implementation building.

    Not that one: C is right. In the game your Network Implementation building would lose a little Renown, and this question would come back later.