STP is enabled by default for all VLANs in a switch. To change the priority to a lower value for root switch elections, use one of the following commands:
Switch(config)#spanning-treevlan 1 priority 4096
Switch(config)#spanning-treevlan 1 root
STP Topology Changes and Enhancements
In the event of a topology change, formerly blocked ports might transition to a forwarding state. It might take up to 50 seconds to transition from a blocking state to a forwarding state.
An exception to these 50 seconds is if the following Cisco enhancements are in place to speed up convergence:
PortFast skips the listening and learning states on end-devices such as servers, PCs, and printers. PortFast can cause switching loops if a hub or switch is connected. BPDU Guard adds protection by disabling a port if the interface receives a BPDU.
UplinkFast skips the listening and learning transitions when a direct failure occurs on its root port on a switch with redundant uplinks to a distribution switch.
BackboneFast speeds up convergence by skipping the max age time when switches learn of a failure indirectly.
EtherChannel is a Cisco method of bundling redundant links between switches to act as a single aggregated link. This allows utilization of all the link’s bandwidth, because STP treats the link as a single interface (no blocking/discarding ports). In the case of a link failure, EtherChannel automatically distributes the traffic load over the remaining links in milliseconds.
To add an interface to an EtherChannel bundle (up to eight), use the channel-group channel# mode on command in the interface configuration.
Rapid Spanning Tree Protocol
Incorporates several of Cisco’s STP enhancements and ensures a safe and quick transition to a forwarding state and topology convergence by removing the overdependence on STP timers.
|RSTP Port States|
|Disabled||The interface is administratively shut down or disabledfrom port violation.||Disabled|
|Discarding||Does not forward any user data. All ports start out in this state.Does not send, but still can receive BPDUs to react totopology changes.||Blocking and listening|
|Learning||Begins to build MAC addresses learned on the interface.No user data is sent.||Learning|
|Forwarding||User data is forwarded.||Forwarding|
RSTP Link Types
Link type point-to-point Full-duplex links between switches
Link type shared Half-duplex links between switches or hubs
Edge type Connections to end devices such as PCs, printers, and servers
Edge ports immediately transition to a forwarding state when connected to RSTP ports. For point-to-point link types, transitioning to a forwarding state involves a synchronization process:
- After switches are connected to a point-to-point link, they exchange BPDUs.
- If a switch determines its port will become a designated port, it sends a proposal to start forwarding to its neighbor.
- The neighboring switch receives the proposal. If its port is a root port, it synchronizes the change by putting all nonedge ports into a discarding state and sending an agreement back to the original switch. If its port is a discarding port, it does not respond to the proposal.
- The original switch immediately transitions to a forwarding state if it receives an agreement or eventually transitions to a forwarding state after a forward delay occurs.
RSTP uses BPDUs as keepalives to detect if a neighboring switch goes down. When the topology change is detected, RSTP immediately starts aging out the affected MAC address and tells its neighbors to do the same.