CCNP SWITCH/Implementing Spanning Tree
Spanning Tree Protocols
- DEC STP
- Invented in 1985 by Radia Perlman at the Digital Equipment Corporation.
- 802.1D
- Published in 1990 by the IEEE and based on the algorithm design by Perlman. Subsequent versions were published in 1998 and 2004 incorporating various extensions.
- Common Spanning Tree(CST)
- Common Spanning Tree(CST) assumes one 802.1D spanning-tree instance for the entire bridged network, regardless of the number of VLANs. Maintains only one instance of STP and therefor uses less CPU and memory than other STP varieties.
- Per VLAN SPanning Tree Plus(PVST+)
- PVST+ is a Cisco enhancement of STP that provides a separate 802.1D spanning-tree instance for each VLAN configured in the network. The separate instance supports enhancement such as PortFast, BPDU guard, BPDU filter, root guard, and loop guard. One instance per VLAN requires more CPU and memory than CST.
- Rapid STP(RSTP)
- IEEE 802.1w is an evolution of STP that provides faster convergence of STP. This version addresses many of the convergence issues in STP. It only maintains one RSTP instance per STP domain.
- Multiple Spanning Tree(MST)
- MST is an IEEE standard inspired from the earlier Cisco proprietary Multi-Instance Spanning Tree Protocol (MISTP) implementation. MST maps multiple VLANs that have the same traffic flow requirements into the same spanning-tree instance. The Cisco implementation provides up to 16 instances of RSTP (802.1w). The CPU and memory requirements of this version are less than PVRST+ but more than RSTP.
- Per VLAN Rapid Spanning Tree Plus(PVRST+)
- PVRST+is a Cisco enhancement of RSTP that is similar to PVST+. It provides a separate instance of 802.1w per VLAN. This version addressed both the convergence issues and the suboptimal traffic flow issues. To do this, this version has the largest CPU and memory requirements.
Comparison
Protocol | Standard | Resource Needed | Convergence |
---|---|---|---|
CST | 802.1D | Low | Slow - All VLANs |
PVST+ | Cisco | High | Slow - Per VLAN |
RSTP | 802.1w | Medium | Fast - All VLANs |
PVRST+ | Cisco | Very High | Fast - Per VLAN |
MSTP | 802.1s | Medium/High | Fast - VLAN List |
STP
STP Operation
- Elect the root bridge: STP Elects the Root Bridge with the lowest BID. The BID consists of the bridge priority and the MAC address. The Root Bridge only have Designated Ports.
- Select the root ports on all nonroot bridges: The protocol establishes one root port on each nonroot bridge. The root port is the lowest-cost path from the nonroot bridge to the root bridge. Root ports send and receive traffic. When the Switch has two or more equal-cost ports it elects the port with the lowest port ID as the root port. The port ID consists of a priority and the port number.
- Select the designated port on each segment: On each segment, STP establishes one designated port on the bridge that has the lowest path cost to the root bridge. In the event of a tie, the bridge ID acts as thetiebreaker.
Port Roles
- Root port
- This port exists on nonroot bridges and is the switch port with the best path to the root bridge. Root ports forward data traffic toward the root bridge, and the source MAC address of frames received on the root port can populate the MAC table. Only one root port is enabled per bridge.
- Designated Port
- This port exists on root and nonroot bridges. For root bridges, all switch ports are designated ports. For nonroot bridges, a designated port is the switch port that receives and forwards data frames toward the root bridge as needed. Only one designated port is enabled per segment. If multiple switches exist on the same segment, an election process determines the designated switch, and the corresponding switch port begins forwarding frames for the segment. Designated ports can populate the MAC table.
- Nondesignated port
- The nondesignated port is a switch port that is not forwarding (blocking) data frames and not populating the MAC address table with the source addresses of frames seen on that segment.
- Disabled port
- The disabled port is a switch port that is shut down.
Port States
Port Cost
STP Example
Rapid Spanning Tree Protocol
RSTP is an evolution of STP with better performance than STP event with proprietary enhancments like PortFast, UplinkFast, and BackboneFast. STP was developed in a time where recovering from a network faliure was allowed to take several minutes. But in todays High Availability network with routed solutions sub-second convergence is preferred. In most cases RSTP performs better than STP with Cisco proprietary extensions. IEEE802.1w is backwards compatible with IEEE802.1D.
The main difference between STP and RSTP is that RSTP uses a handshake protocol between neighbor switches to transition from discarding to forwarding immediately.
RSTP Port States
RSTP Port Roles
- Root
- The root port is the switch port on every nonroot bridge that is the chosen path to the root bridge. Only one root port can be on every switch. The root port assumes the forwarding state in a stable active topology. In Figure 3-4, the root port is marked as R.
- Designated
- Each segment has at least one switch port as the designated port for that segment. In a stable, active topology, the switch with the designated port receives frames on the segment that are destined for the root bridge. There can be only one designated port per segment. The designated port assumes the forwarding state. All switches that are connected to a given segment listen to all BPDUs and determine the switch that will be the designated switch for a particular segment.
- Alternate
- The alternateport is a switch port that offers an alternative path toward the root bridge. The alternate port assumes a discarding state in a stable, active topology. An alternate port is present on nondesignated switches and makes a transition to a designated port if the current designated path fails.
- Backup
- The backup portis an additional switch port on the designated switch with a redundant link to the segment for which the switch is designated. A backup port has a higher port ID than the designated port on the designated switch. The backup port assumes the discarding state in a stable, active topology.
- Disabled
- A port that has no role within the operation of spanning tree.
RSTP Link Types
- Root Ports
- Do not use the link type parameter. Root ports can make a rapid transition to the forwarding state as soon as the port receives the BPDU of the root and it puts the nondesignated ports in blocking state. This operation is called sync.
- Alternate and backup ports
- Do not use the link type parameter in most cases because these ports need to arrive at these states based on the operation of the RSTP. The only times you would configure link type parameter explicitly is when you understand the final state of these ports due to your full understanding of the topology.
- Designated ports
- Make the most use of the link type parameter. Rapid transition to the forwarding state for the designated port occurs only if the link type parameter indicates a point-to-point link.
Unlike PortFast, an edge port that receives a BPDU immediately loses its edge port status and becomes a normal spanning-tree port. When an edge port receives a BPDU, it generates a topology change notification (TCN).
RSTP
When a designated port is in a discarding or learning state (and only in this case), it sets the proposal bit on the BPDUs it sends out. This is what occurs for port p0 of the root bridge, as shown in Step 1 of Figure. Because Switch A receives superior information, it immediately knows that p1 is the new root port. Switch A then starts a sync process that puts nonedge designated ports in blocking state as it needs to verify that all its ports are in-sync with the new superior BPDU received.