Chapter 3: Advanced STP Tuning: CCNP Enterprise: Core Networking
Chapter 3: Advanced STP Tuning: CCNP Enterprise: Core Networking
Chapter 3: Advanced STP Tuning: CCNP Enterprise: Core Networking
Tuning
• STP Topology Tuning - This section explains some of the options for modifying
the root bridge location or moving blocking ports to designated ports.
mechanisms such as root guard, BPDU guard, and STP loop guard.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 2
STP Topology Tuning
• In a properly designed network a switch is deliberately selected to become the root
bridge and the designated and alternate ports are modified.
• Network design considerations factor in hardware platform, resiliency, and network
topology.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 3
STP Topology Tuning
Root Bridge Placement
To ensure root bridge placement set the system priority on:
• The root bridge to the lowest value
• The secondary root bridge to a value slightly higher than that of the root bridge
• All other switches to a value higher than the secondary root bridge
Command Description
spanning-tree vlan vlan-id priority priority The priority is a value between 0 and 61,440, in
increments of 4,096.
spanning-tree vlan vlan-id root {primary | The primary keyword sets the priority to 24,576,
secondary} [diameter diameter] and the secondary keyword sets the priority to
28,672. The optional diameter command makes it
possible to tune the Spanning Tree Protocol (STP)
convergence and modifies the timers.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 4
STP Topology Tuning
Configuring the Root Bridge
In the example:
• The initial priority for VLAN 1 on SW1
is verified, 32,769.
• SW1 is configured to be the primary
root for VLAN 1
• The priority is verified again to
ensure the change took place.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 5
STP Topology Tuning
Configuring the Backup Root Bridge
In the example:
• The initial priority for VLAN 1 on SW2
is verified, 32,769.
• SW2 is configured to be the
secondary root for VLAN 1
• The priority is verified again to ensure
the change took place.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 6
STP Topology Tuning
Modifying STP Root Port & Blocked Switch Port Locations
Calculating total path cost to the root
bridge:
• SW1 sends a BPDU to SW3 with
the path cost of 0.
• SW3 receives the BPDU and adds
its root port cost (4) to cost from the
BPDU (0), resulting in the cost of 4.
• SW3 sends a BPDU to SW5 with
the path cost of 4.
• SW5 receives the BPDU and adds
its root port cost (4) to the cost from
the BPDU (4), resulting in the cost
of 8 for SW5 to reach the root
bridge.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 7
STP Topology Tuning
Verifying the Total Path Cost
The example highlights the total path cost to the root bridge from SW3 and SW5.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 9
STP Topology Tuning
Modifying STP Port Priority
STP port priority influences which port becomes the alternate port when multiple links are
used between switches. Use the command spanning-tree [vlan vlan-id] port-priority priority
to change the STP port priority on a switch’s interface.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 10
Additional STP Protection
Mechanisms
• A network forwarding loop occurs when there are multiple active paths between two
devices. Broadcast and multicast traffic are forwarded out every switch port continuing
the forwarding loop.
• The network’s throughput is drastically effected as the switches are processing
numerous frames. The switches CPU utilization will be high and memory space will be
consumed. The switches might crash and users will likely notice the impact on the
network.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 11
Additional STP Protection Mechanisms
Additional STP Protection Mechanisms
Common issues for Layer 2 forwarding loops:
• STP is disabled on a switch.
• A load balancer is misconfigured and sends traffic out multiple ports with the same MAC
address.
• A virtual switch that bridges two physical ports.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 12
Additional STP Protection Mechanisms
Root Guard
Root guard is an STP feature that prevents a configured port from becoming a
root port.
• It does this by placing the port in an ErrDisabled state if a superior BDPU is
received on that port.
• Root guard is placed on designated ports towards other switches that
should never become root bridges.
• Root guard is enabled on a port-by-port basis.
Use the interface command spanning-tree guard root to enable root guard.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 13
Additional STP Protection Mechanisms
STP Portfast
STP portfast disables the topology notification notification (TCN) generation and causes
access ports that come up to bypass the learning and listening states and enter the
forwarding state immediately. If a BPDU is received on a portfast-enabled port, the portfast
functionality is removed from that port.
Command Description
spanning-tree portfast Interface command to enable portfast on a
specific access port
spanning-tree portfast default Global command to enable portfast on all
access ports
spanning-tree portfast disable Disable portfast on a port
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 15
Additional STP Protection Mechanisms
BPDU Guard
BPDU guard is a safety mechanism that shuts down ports configured with STP portfast
upon receiving a BPDU.
Command Description
spanning-tree portfast bpduguard default Global command to enable BPDU guard on
all STP portfast ports
spanning-tree portfast bpduguard default Interface command to enables or disable
{enable | disable} BPDU guard on a specific interface
show spanning-tree interface interface-id Displays whether BPDU guard is enabled for
detail the specified interface
Note: BPDU Guard is typically configured with all host-facing ports that are enabled with
portfast.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 16
Additional STP Protection Mechanisms
BPDU Guard Examples
The following shows how to configure BPDU guard and a BPDU guard-enabled port
detecting a BPDU.
Command Description
errdisable recovery cause bpduguard Recovers ports shutdown by BPDU guard
errdisable recovery interval time-seconds The period that Error Recovery checks for ports
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 18
Additional STP Protection Mechanisms
BPDU Guard Error Recovery Example
The following example shows how to configure the Error Recovery service.
With the global BPDU configuration the port With the interface-specific BPDU
sends a series of 10 – 12 BPDUs. If the configuration the port does not send any
switch receives any BPDUs, it checks to BPDUs on an ongoing basis. If the remote
identify which switch is more preferred. port has BPDU guard, that generally shuts
• The preferred switch doesn’t process any down the port as a loop prevention
BPDUs but still passes them along to mechanism.
inferior switches.
• A non-preferred switch processes the
BPDUs that are received but doesn’t
transmit any BPDUs to superior switches.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 20
Additional STP Protection Mechanisms
Verifying a BPDU Filter
The following shows using the show spanning-tree interface interface-id detail
command to verify that BPDU filter is enabled.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 21
Additional STP Protection Mechanisms
Problems with Unidirectional Links
Network devices that utilize fiber-optic cables for connectivity can encounter
unidirectional traffic flows if one strand is broken. BPDUs will not able to be
transmitted causing other switches on the network to eventually time out the
existing root port and change root ports resulting in a forwarding loop.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 22
Additional STP Protection Mechanisms
STP Loop Guard
STP Loop guard prevents any alternative or root ports from becoming designated ports due
to loss of BPDUs on the root port. Loop guard places the original port into an ErrDisabled
state while BPDUs are not being received and transitions back through the STP states
when it begins receiving BPDUs again.
Command Description
spanning-tree loopguard default Global command to enable loop guard
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 24
Additional STP Protection Mechanisms
Unidirectional Link Detection
Unidirectional Link Detection (UDLD) allows for the bidirectional monitoring of
fiber-optic cables.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 25
Additional STP Protection Mechanisms
UDLD Commands
The following are commands for configuring and verifying UDLD:
Command Description
udld enable [aggressive] Global command to enable UDLD. *Optional
aggressive keyword sets the mode to aggressive.
udld port [aggressive] Interface command to enable UDLD *Optional
aggressive keyword sets the mode to aggressive.
udld port disable Disable UDLD on a specific interface
udld recovery [interval time] Enables UDLD recovery. The time default value is 5
minutes.
show udld neighbors Displays the status of UDLD neighborship
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 26
Additional STP Protection Mechanisms
Configuring & Verifying UDLD Examples
The following are examples for configuring and verifying UDLD:
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 27
Prepare for the Exam
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 28
Prepare for the Exam
Key Topics for Chapter 3
Description
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 29
Prepare for the Exam
Key Terms for Chapter 3
Terms
BPDU filter
Root guard
STP loop guard
BPDU guard
STP portfast
Unidirectional Link Detection (UDLD)
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 30
Prepare for the Exam
Command Reference for Chapter 3
Task Command Syntax
spanning-tree vlan vlan-id root {primary | secondary}
Configure the STP priority for a switch [diameter diameter]
so that it is a root bridge or a backup root bridge OR
spanning-tree vlan vlan-id priority priority
Configure the STP port cost spanning tree [vlan vlan-id] cost cost
Configure the STP port priority on the downstream
spanning-tree [vlan vlan-id] port-priority priority
port
Enable root guard on an interface spanning-tree guard root
spanning-tree portfast default
OR
Enable STP portfast globally, for a specific port, or
spanning-tree portfast
for a trunk port
OR
spanning-tree portfast trunk
spanning-tree portfast bpduguard default
Enable BPDU guard globally or for a specific
OR
switch port
spanning-tree bpduguard {enable | disable}
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 31
Prepare for the Exam
Command Reference for Chapter 3 (Cont.)
Task Command Syntax
spanning-tree portfast bpdufilter default
Enable BPDU guard globally or for a specific
OR
interface
spanning-tree bpdufilter enable
spanning-tree loopguard default
Enable STP loop guard globally or for a specific
OR
interface
spanning-tree guard loop
Enable automatic error recovery for BPDU
errdisable recovery cause bpduguard
guard.
spanning-tree portfast bpdufilter default
Enable BPDU guard globally or for a specific
OR
interface
spanning-tree bpdufilter enable
spanning-tree loopguard default
Enable STP loop guard globally or for a specific
OR
interface
spanning-tree guard loop
Enable automatic error recovery for BPDU
errdisable recovery cause bpduguard
guard.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 32
Prepare for the Exam
Command Reference for Chapter 3 (Cont.)
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 33