RSTP

  • Classic spanning tree can be quite slow, taking up to 50 seconds for the network to converge after a change in the topology.

  • Because rapid spanning tree is fast and superior to classic spanning tree, it is the default on most devices now.

![[stp comparision.png]]

MSTP is superior to Cisco’s rapid-PVST.

  • You have can assign VLANs 1 to 100 to instance 1, and VLANs 101 to 200 to instance 2, and then configure the primary and secondary root bridges for instance 1 and instance 2, so its much easier to configure and manage instead of configuring separately for each VLAN.

  • MSTP is best for large networks. For small to medium networks without a huge number of VLANs, Cisco’s Rapid PVST+ is what you’ll run on your switches.

RSTP

RSTP is not a timer-based spanning tree algorithm like 802.1D. Therefore, RSTP offers an improvement over the 30 seconds or more that 802.1D takes to move a link to forwarding. The heart of the protocol is a new bridge-bridge handshake mechanism, which allows ports to move directly to forwarding.

Differences with STP

Similarities with STP

  • RSTP serves the same purpose as STP, blocking specific ports to prevent Layer 2 loops.

  • RSTP elects the root bridge, root ports, designated ports with the same rules as STP.

Differences with STP

i.) COST

![[rstp port cost.png]]

  • Classic spanning tree defines port speeds up to 10 Gbps, and port speeds faster than this are all given a cost of 1.

ii.) PORT STATES

![[rstp port states.png]]

  • Blocking and disabled port states of classic STP are combined into discarding state, and the listening state is simply not used.

  • If a port is administratively disabled, meaning it has the shutdown command applied to it, it will be in a discarding state in RSTP (previously disabled state).

  • If a port is enabled but blocking traffic to prevent Layer 2 loops, it is also in a discarding state (blocking state).

iii.) PORT ROLES

  • Root port role remains unchanged.

    • Port with lowest root cost to root bridge is the root port for the switch

    • The root bridge does not have a root port.

  • Designated port role also remains unchanged.

    • The port on a segment/collision domain that sends the best BPDU is that segment’s designated port, (only one per segment).

    • The other port on the segment is either a root port, or a non-designated port.

  • Non-designated port role was split into two separate roles.

    • Alternate port role

    • Backup port role

Alternate port role

  • The RSTP alternate port role is a discarding port that receives a superior BPDU from another switch.

  • This is the same as blocking ports in classic STP.

![[alternate port.png]]

  • Here, SW1 is the root bridge.

  • When BPDUs are sent, SW3 receives a superior BPDU from SW2 (superior because the bridge ID of SW2 is lower than SW3).

  • So, SW2’s interface is designated, and SW3’s is an alternate port.

An alternate port basically functions as a backup to the root port.

  • If the root port (SW3) fails, the switch can immediately move its best alternate port to forwarding, as the new root port with no transitional states.

  • This immediate move to forwarding state functions like a classic STP optional feature called UplinkFast. ^uplinkfast

  • Because it is built into RSTP, you do not need to activate UplinkFast when using RSTP or Rapid PVST+.

BackboneFast ^backbonefast

  • Let’s say SW2’s root port is cut off, so it stops receiving BPDUs from the root bridge.

  • It will then assume it is the root bridge, so it will send it’s own BPDUs to SW3.

  • However, SW3 is now receiving BPDUs from both SW1 and SW2, but SW2’s BPDUs are inferior (have a higher bridge ID).

  • Without this backbonefast functionality, SW3 would just ignore these BPDUs from SW2 until it’s non-designated port, in classic STP, finally changes to a forwarding state and forwards the superior BPDUs to SW2, which then accepts SW1 as its root bridge again.

![[backbone fast.png]]

  • However, BackboneFast allows SW3 to expire the max age timer on that interface and rapidly forward the superior BPDUs to SW2.

UplinkFast and BackboneFast are optional features in classic STP but are build into RSTP.

Backup port role

  • The RSTP backup port role is a discarding port that receives a superior BPDU from another interface on the same switch.

  • This only happens when two interfaces are connected to the same collision domain, via a hub.

![[backup port.png]]

  • Now an ethernet hub is connected between SW2 and SW3.

  • When BPDUs are sent in this nework, the BPDU sent out of SW2’s designated port is flooded by the hub, and as you can see here it receives that same BPDU on a different interface.

  • That’s why this interface is a backup port, not an alternate port.

RSTP backup ports function as a backup for a designated port.

  • If SW2’s designated port fails, its backup port immediately begins forwarding traffic as a designated port.

  • The interface with the lowest port ID will be selected as the designated port, and the other will be the backup port.

Quiz 1

![[rstp quiz.png]]

  • Root bridge is SW1 (because all switches have the same priority and SW1 has the lowest MAC address).

  • SW1's interfaces are designated ports.

  • SW2's g0/0 and SW3’s g0/2 are root ports (they have the lowest root cost).

(The hub doesn’t participate in STP so it doesn’t add any cost to the BPDU)

  • SW4 choose g0/1 as its root port (because the neighbor bridge ID is lower via g0/1, because SW2 has a lower MAC address than SW3).

  • SW2’s g0/1 connected to SW4’s g0/1 becomes designated.

Connection between SW3 and SW4,

  • SW3 has a lower root cost, so one of its interfaces will be the designated port.

  • g0/0 has the lower port ID, so it will be the designated port in this collision domain.

  • SW3’s g0/1 receives the superior BPDU, with the lower port ID, from the same switch, so it's a backup port.

  • SW4’s g0/0 receives the superior BPDU from a different switch, so it is an alternate port.

from CLI,

  • Rapid-PVST is the default on modern Cisco switches, so you probably won’t have to use command 'spanning-tree mode rapid-pvst'.

In 'show spanning-tree',

  • It says ‘Spanning tree enabled protocol rstp’. Previously when we were using classic STP, it said ‘ieee’.

  • Although it says ‘rstp’, this is in fact Cisco’s Rapid PVST+ running.

  • SW3’s g0/1 interface has the ‘backup’ role.

  • The status is still listed as BLK for ‘blocking’, although this state is actually called ‘discarding’ in rapid STP.

  • SW4’s G0/0 interface is an ‘Alternate’ port.

  • Once again, this command lists the status as ‘blocking’, but remember the rapid STP name for this state is actually ‘discarding’.

Compatibility

  • The interface(s) on the rapid STP-enabled switch connected to the classic STP-enabled switch will operate in classic STP mode, with the same timers, the same blocking -> listening -> learning -> forwarding state process.

  • So, if you have a really old switch that doesn’t run rapid STP, you can still use it in a network of rapid STP-enabled switches, they will adjust the operation of those specific interfaces to match the slower switch.

![[rstp stp.png]]

  • So, if SW4 was running classic STP, SW2 and SW3 would make these interfaces run in classic STP mode, but their interfaces connected to SW1 would remain in rapid STP mode.

RSTP BPDU

  • RSTP BPDU protocol version : 2 Classic spanning tree version : 0

  • BPDU type : 2

  • BPDU flags

    • Classic STP BPDU : 2 bits (1st bit and the 8th bit).

    • Rapid STP BPDU uses all 8 bits.

    • These flags are used in the negotiation process that allows rapid STP to converge much faster than classic STP.

In rapid STP, ALL switches originate and send their own BPDUs from their designated ports.

  • In classic STP, only the root bridge originated BPDUs, the other switches just forwarded the BPDUs they received.

  • Switches also ‘age’ the BPDU information much more quickly.

    • In classic STP, a switch waits 10 hello intervals (20 seconds).

    • In rapid STP, a switch considers a neighbor lost if it misses 3 BPDUs (6 seconds).

    • It will then ‘flush’ (delete), all MAC addresses learned on that interface. Because the neighbor is down, it knows it cant reach anything through that interface any more.

    • ![[rstp age.png]]

    • If this connection is cut off, this switch will think: I can’t reach this neighbor anymore. I’ll clear all entries for this interface from my MAC table

    • And its other interface will become the root port (which was an alternate port).

    • Then, if PC1 wants to send traffic to PC2 again, it will go through the normal process of flooding until it learns the MAC address on this new interface, and traffic will now follow this path.

  • Edge

  • Point-to-point

  • Shared

Basically, the point-to-point and shared link types just distinguish between full- and half-duplex connections, and the edge type is a port that uses portfast.

Edge

SW1(config-if)# spanning-tree portfast

  • Connected to end hosts.

  • Because there is no risk of creating a loop, they can move straight to the forwarding state without the negotiation process.

  • Same like a classic STP port with PortFast enabled. [[Spanning Tree Protocol (2)#Portfast]]

  • Portfast functionality was built into RSTP, just like UplinkFast, BackboneFast.

Point-to-point

SW1(config-if)# spanning-tree link-type point-to-point

  • These ports connect directly to another switch.

  • Because they connect to a switch, not a hub, they function in full-duplex mode.

  • No need to configure (switch should be able to detect that it is connected directly to another switch and will operate in full-duplex as a point-to-point port).

Shared

SW1(config-if)# spanning-tree link-type shared

  • Due to the nature of hubs and the likelihood of collisions, these links must function in half duplex.

  • No need to configure the interface, the switch will detect it.

![[rstp link types.png]]

Summary

RSTP uses a negotiation process to allow it to rapidly move the necessary ports to a forwarding state, and rapidly adjust to changes in the network topology, instead of using timers.

  • RSTP port states (discarding, learning, forwarding)

    • Listening port state was deemed unnecessary.

    • Learning state is often skipped due to the built-in features of rapid STP, like UplinkFast and BackboneFast.

  • RSTP port roles (root, designated, alternate, backup)

    • RSTP distinguishes between two types of ports in the discarding state.

    • Alternate ports are discarding ports which receive a superior BPDU from another switch (usual case).

    • Backup ports receive a superior BPDU from an interface on the same switch (if connected to a hub).

  • STP optional features built into RSTP

    • UplinkFast (alternate port)

    • BackboneFast

    • Portfast (edge port)

  • RSTP BPDU

    • Protocol version ( RSTP BPDU : 2, classic STP : 0)

    • In RSTP all switches send BPDUs, not just the root bridge.

  • RSTP link types

    • Edge ports are connected to end hosts. You configure an edge port by enabling portfast on the interface.

    • Point-to-point means it is connected directly to another switch.

    • Shared means it is connected to a hub, and must use half-duplex.

Quiz 2

![[rstp quizz.png]]

  • SW4 picked it’s g0/0 interface because SW3 has a lower bridge ID than SW2, even though they have the same root cost because the hub doesn’t add any cost.

  • SW2's g0/1 is selected as designated port and not SW4's g0/1, because SW2 has the lower root cost.

  • SW2’s g0/2 interface is backup interface, because it receives a superior BPDU from an interface on the same switch, the g0/1 interface.

  • All ports connected to end hosts should be edge ports.

  • All full-duplex connections between switches are point-to-point links.

  • Half-duplex connections with the hub are shared links.

![[rstp lab.png]]

  • All interfaces in root bridge are designated ports, only if there is one collision domain.

  • That's why SW1's f0/3 is a backup port.

The root bridge has a designated port in each collision domain it is connected to.

  • SW4's f0/24 is both point-to-point and an edge port.

  • SW1's f0/24 is both shared and an edge port.

Last updated