Spanning Tree Protocol (STP)
Spanning Tree Protocol (STP)
center, STP is still a fairly popular technology in the data center environment. It is a
Layer 2 control plane protocol that runs on switches to ensure that you do not create
topology loops when you have these redundant paths in the network. STP features
on the Cisco Nexus platform are similar to STP features on Cisco IOS platforms and
Rapid Per VLAN Spanning Tree Plus (Rapid PVST+) is an updated, faster
implementation of STP that allows you to create one spanning tree topology for each
VLAN. It is the default STP mode on Cisco Nexus switches. Rapid PVST+ is enabled
by default on the default VLAN (VLAN1) and on all newly created VLANs in software.
It provides for rapid recovery of connectivity following the failure of switch, a switch
port, or a LAN.
Rapid Spanning Tree Protocol (RSTP) IEEE 802.1w represents the evolution of the
802.1w, as do most parameters, which makes it easier for users to configure the new
protocol.
Per VLAN Spanning Tree Plus (PVST+) allows the definition of one spanning-tree
instance per VLAN. Normal PVST+ relies on the use of the older 802.1D STP to re-
Note
Cisco Nexus switches support Rapid PVST+ and Multiple Spanning Tree (MST). You
can run either Rapid PVST+ or MST on a switch, but not both simultaneously.
Note
Cisco Nexus switches will not run non-rapid version of STP. However, these devices
support interoperability with switches that are running non-rapid STP. You will
encounter this situation when you are connecting your Cisco Nexus switches to
Cisco IOS switches with enabled non-rapid version of STP. Or, more often, you will
encounter this situation when connecting to switches of other vendors. The Cisco
Nexus switch that receives 802.1D Bridge Protocol Data Units (BPDUs) on a port,
will revert to the legacy 802.1D mode of operation on that port. It is recommended
that you avoid using switches that can only run non-rapid version of STP.
If the default spanning tree mode on the Cisco Nexus switch is changed, you can
revert to Rapid PVST+ using the following commands, which also set the current
switch to be the primary root bridge for odd-numbered VLANs and secondary root
Use the following command to display detailed information for the current spanning
tree configuration:
Cisco has added extensions to STP that enhance loop prevention, protect against
user configuration errors, and provide better control over the protocol parameters.
PortFast), BPDU filter, BPDU guard, loop guard, root guard, and bridge assurance.
All these extensions can be used with both Rapid PVST+ and MST.
STP Extensions
Cisco has added extensions to STP that enhance loop prevention, protect against
user configuration errors, and provide better control over the protocol parameters.
PortFast), BPDU filter, BPDU guard, loop guard, root guard, and bridge assurance.
All these extensions can be used with both Rapid PVST+ and MST.
Configuring a Layer 2 access port as a spanning-tree Edge Port causes the port to
bypass the spanning tree listening and learning states and move to the forwarding
Spanning-tree edge ports are typically deployed on Layer 2 access ports that are
from topology loops. This design allows those connected devices to access the
network immediately without waiting for STP convergence to take place. Edge ports
also do not generate topology change BPDUs when the link state changes, which
helps reduce STP processing edge ports can be either an access port or a trunk
port.
Note
If you enable the spanning tree edge port feature on a port that is connected to a
interface Ethernet0/0
spanning-tree port type edge
BPDU Guard protects the integrity of ports that are configured as STP edge ports. If
any BPDU is received on an STP edge port, that port is put into an error-disabled
state. The port is shut down and must be manually re-enabled or automatically
using the spanning-tree port type edge bpduguard default command. Global
interface Ethernet0/0
spanning-tree bpduguard enable
You should always enable BPDU guard on all ports that are configured as STP edge
ports. This kind of implementation will prevent adding a switch to a switch port that is
prevent loops. But there are special cases where you need to prevent BPDUs from
You can achieve that by using the BPDU Filter feature, following these guidelines:
● Do not use a BPDU filter unless you absolutely need to use it.
One example where you would configure BPDU filter is in company networks that
have multiple administrators and those administrators do not want for their networks
to share BPDUs. This is a bad implementation practice, however you will find it in
The following figure illustrates a topology that can benefit from the BPDU filter
option:
This figure illustrates a topology that can benefit from the BPDU filter option:
You can enable BPDU filtering globally on all operational spanning tree edge ports
using the spanning-tree port type edge bpdufilter default command. Global
When the spanning tree topology is calculated, all switches determine a loop-free
best path toward the elected root bridge. You should consider defining a root bridge
topology. In the figure, switches DSW1 and DSW2 are the core of the network.
DSW1 is the root bridge for VLAN 1. ASW is an access layer switch. The link
blocked and not passing traffic. This behavior is clearly unwanted, since all traffic
between the core switches must now go through ASW, an access layer switch.
When you enable Root Guard on a port, Root Guard does not allow that port to
become a root port. If a root guard-enabled port receives a BPDU that would make
this port a root port, then that port will be moved to a root-inconsistent state, and will
interface Ethernet0/0
spanning-tree guard root
With bidirectional links, traffic flows in both directions (receive/transmit). If for some
reason one direction of traffic flow fails, the result is a unidirectional link. Because
this prevents spanning tree BPDUs from being properly propagated within the
The following figure depicts what will happen if the transmit circuitry in a Gigabit
There are three mechanisms that you will find on Cisco Nexus switches that you can
use to protect against inadvertent loops: loop guard, bridge assurance, and
Loop Guard detects if an active port is no longer receiving BPDUs, and moves that
port into the STP loop-inconsistent blocking state. When the port starts receiving
BPDUs again, indicating that the unidirectional link failure is no longer present, loop
You can enable loop guard globally on all spanning tree normal and network ports
disabled by default.
interface Ethernet1/1
spanning-tree guard loop
The Bridge Assurance feature, applicable with Rapid PVST+ and MST, is an
extension of the idea that is used by loop guard. When bridge assurance is activated
on an operational port, this port always sends BPDUs, regardless of the port role.
BPDUs. If a port does not receive BPDUs, it goes into the blocking state. Thus, both
Bridge assurance is enabled by default and you can only disable it globally. Also,
bridge assurance is enabled only on spanning tree network ports that are point-to-
point links. You can disable bridge assurance using the no spanning-tree bridge
assurance command.
Note
If your network devices support bridge assurance, use it instead of loop guard. Do
not use loop guard and bridge assurance at the same time. If the unidirectional
problem exists before link comes up, loop guard will not detect such an issue, but
UniDirectional Link Detection (UDLD) is a Layer 2 protocol that works with Layer 1
transmits UDLD packets on an interface with enabled UDLD. If the packets are not
echoed back within a specific time frame, the link is flagged as unidirectional and the
interface is error-disabled. Devices on both ends of the link must support UDLD for
By default, the UDLD feature is disabled. To enable UDLD on fiber-optic LAN ports,
Note
It is recommended that you use both UDLD and bridge assurance (or loop guard).
Bridge assurance will protect your network against STP failures and UDLD will
protect your network against mis-wiring. You can use bridge assurance in a
multivendor environment. UDLD is a proprietary protocol that you can only use with
Cisco equipment.
← AnteriorSiguiente →
Port channels or aggregation of ports is one of the core technologies that you can
bandwidth utilization.
aggregation of links between two switches. To form port channeling from one device
to two different devices, you can use evolution of port channeling technology that is
called vPC.
Port Channels
To add resiliency against link failures and to increase the available bandwidth
between two devices, you can provision multiple physical links between the devices.
However, without a port channel, control plane protocols, such as STP, or routing
protocols, such as Open Shortest Path First (OSPF), treat the links as individual
links. In the case of STP, this process results in blocked ports. Although the
additional links add resiliency and bandwidth, the bandwidth between the two
devices is not fully utilized. In the case of routing protocols, the routing protocol can
use additional links for load balancing. This process, however, requires a routing
adjacency to be formed for every link, which increases routing protocol overhead.
Control plane protocols (such as STP) and routing protocols treat the port channel as
a single link. Spanning tree will not block the links that are part of the port channel,
and routing protocols will only form a single routing adjacency across the port
channel.
uses a configurable selection of fields in the packet headers as input. For example,
you can choose to balance the load across the links by checking just the destination
Port channels, EtherChannels, and port aggregation all refer to the same group of
technologies that enables you to bond multiple physical links into a virtual one. While
port channels and aggregation of ports are general terms, EtherChannel is a Cisco
You can use the port channeling technology to bundle ports of the same type. You
can aggregate either Layer 2 ports, or Layer 3 ports. Layer 3 ports can be configured
channel, all member ports must be in the same trunking mode, either access or
trunk.
In the next figure, port channel links are used to connect several switches, and pairs
of ports are used to create port channel bundles. Because a switch detects each port
channel as one logical connection, the switch will be able to use both ports of each
The classic port channel technology has always been limited to the aggregation of
links that run between two devices, and has been a point-to-point technology.
● Spanning-tree mitigation
The following figure illustrates the port channel physical and logical view:
Cisco Nexus Series Switches support the bundling of interfaces into port channel.
The maximum number of ports in a channel depends on the exact switch hardware
and software combination. For example, on the Cisco Nexus 9000 Series Switches,
On the Cisco Nexus 9000 platform, port channels can be configured on Layer 2 or
Layer 3 interfaces.
When you create a port channel, the default channel mode is set to on, which
defines a static port channel. Cisco Nexus series switches also support the Link
Note
LACP is part of the IEEE 802.1AX specification. Because LACP is an IEEE standard,
you can use it to facilitate port channels in mixed switch environments. LACP checks
for configuration consistency and manages link additions and failures between two
switches. It ensures that when you create a port channel, all ports have the same
type of configuration speed, duplex setting, and VLAN information. Any port
modification after the creation of the channel will also make changes on other
channel ports.
LACP packets are exchanged between ports in passive or active mode. Both modes
allow LACP to negotiate between ports to determine if they can form a port channel.
The successful negotiation is based on the criteria such as the port speed and the
trunking state. The passive mode is useful when you do not know whether the
The following table summarizes different port channel and LACP options:
Channel Mode Port Description
Passive (LACP) ●
Active (LACP) ●
packets
On (static) ●
Ports can form an LACP port channel when they are in different LACP modes, as
Passive Active On
Passive NO YES NO
On NO NO YES
The LACP feature is disabled by default, so you must enable LACP before you begin
LACP configuration. You cannot disable LACP while any LACP configuration is
present.
After you enable LACP, you can configure the channel mode for each individual link
in the LACP port channel as active or passive. This channel configuration mode
allows the link to operate with LACP. Use the following commands to enable LACP
feature lacp
!
interface type slot / port
channel-group number mode { active | on | passive }
The number in the channel-group command specifies the port channel to which this
interface is associated. When you run port channels with no configured protocol, the
← AnteriorSiguiente →
The port channels enable you to aggregate (bond) multiple interfaces together, while
the traffic is load balanced across each of the physical links. Still, the problem is that
all links in the port channel must be connected to the same switch, when the port
A pair of Cisco Nexus switches that use vPC present themselves to other network
devices as a single logical Layer 2 switch. However, the two switches remain as two
The vPC architecture includes modifications to the data plane of the switches to
ensure optimal packet forwarding. The vPC architecture also includes control plane
components to exchange state information between the switches and allow the two
For control plane purposes, the two vPC peer switches should present themselves
as a single logical switch to the Layer 2 domain. For LACP, this appearance is
addresses, which is then combined with the vPC domain ID. If the downstream
device in the vPC did not see a single device on the remote end of the port channel,
the port channel would not form. For STP, the vPC primary switch is responsible for
generating and processing BPDUs and uses its own bridge ID for the BPDUs. The
vPC secondary switch relays BPDU messages but does not itself generate BPDUs
● Allows a single device to use a port channel across two upstream devices
Between the pair of vPC peer switches, an election is held to determine the primary
and secondary vPC device. The election is not preemptive. The vPC role determines
which of the two switches is responsible for the generation and processing of control
plane information for the vPCs. The election also controls the vPC operation in
failure scenarios.
The primary and secondary roles determine the behavior of the vPC peer switches in
certain failure scenarios; most notably, if there is a peer link failure. If the vPC peer
link fails, the vPC primary switch determines, through the peer-keepalive link, if the
vPC secondary peer switch is still operational. If the vPC secondary peer switch is
operational, the primary switch instructs the secondary switch to suspend all vPC
member ports. As a result, the secondary switch also shuts down all switch virtual
interfaces (SVIs) that are associated with any VLANs that are allowed on the vPC
peer link.
Cisco Fabric Services over Ethernet is the primary control plane protocol over the
A pair of Cisco Nexus Switches that uses vPC present themselves to other network
devices as a single logical Layer 2 switch. However, the two switches remain two
The vPC architecture includes modifications to the data plane of the switches to
ensure optimal packet forwarding. vPC architecture also includes control plane
components to exchange state information between the switches and allow the two
● vPC peer link: The vPC peer link is the most important connectivity element in
the vPC system. This link is used to create the illusion of a single control
plane by forwarding BPDUs and LACP packets to the primary vPC switch
from the secondary vPC switch. The peer link is also used to synchronize
MAC address tables between the vPC peers and to synchronize IGMP entries
for IGMP snooping. The peer link provides the necessary transport for
multicast traffic and for the traffic of orphaned ports. When a vPC device is
also a Layer 3 switch, the peer link also carries Hot Standby Router Protocol
(HSRP) packets.
message passing and synchronization. The vPC peers use the Cisco Fabric
forwarding table between the vPC peers. This way, if one vPC peer learns a
new MAC address, that MAC address is also programmed on the Layer 2
Forwarding Protocol (L2F) table of the other peer device. The Cisco Fabric
Services protocol travels on the peer link and does not require any
configuration by the user. To help ensure that the peer link communication for
Cisco Fabric Services over Ethernet is always available, spanning tree has
been modified to keep the peer-link ports always forwarding. You also use the
synchronize the IGMP snooping status, to monitor the status of the vPC
● vPC peer keepalive link: The peer keepalive link is a logical link that often
runs over an out-of-band (OOB) network. The peer keepalive link provides a
Layer 3 communications path that vPC uses as a secondary test to determine
whether the remote peer is operating properly. The switch does not send data
that indicate that the originating switch is operating and running vPC. The
peer keepalive status is used to determine the status of the vPC peer when
the vPC peer link goes down. In this scenario, it helps the vPC switch to
determine whether the peer link itself has failed or whether the vPC peer has
failed entirely.
that spans the two vPC peer switches. The downstream device that is
connected on the vPC sees the vPC peer switches as a single logical switch.
The downstream device does not need to support vPC itself. The downstream
device then connects to the vPC peer switches using a regular port channel,
● vPC domain: The vPC domain includes both vPC peer devices, the vPC peer
keepalive link, vPC peer link, and all port channels in the vPC domain that are
the vPC. You can have only one vPC domain ID on each device.
● vPC member port: The port on one of the vPC peers that is a member of one
● Orphan device: The term orphan device refers to any device that you
through a vPC.
● Orphan port: The term orphan port refers to a switch port that you connected
to an orphan device. The term also means vPC ports whose members are all
connected to a single vPC peer. This situation can occur if a device that you
connected to a vPC loses all its connections to one of the vPC peers.
feature vpc
!
vpc domain 10
peer-keepalive destination 192.168.21.101 source 192.168.21.100 vrf
vPC_VRF
!
interface port-channel 1
vpc peer-link
!
interface port-channel 2
vpc 11
Through the vPC domain, you define vPC peer switches that participate in vPC.
When you enter the vPC domain ID, you enter the subconfiguration mode where you
can then configure additional global parameters for the vPC domain. The vPC
domain ID is a value between 1 and 1000 that uniquely identifies the vPC switch
pair.
The peer keepalive link provides an OOB heartbeat between the vPC peer switches,
virtual routing and forwarding (VRF) instance created specifically for the vPC peer
keepalives, using the port channel 1 that bundles the links between the switches.
Port channel 2 contains the interface to the downstream device, and is moved to
vPC. This port channel must be associated to the port channel on the other vPC
switch using the same vPC number on its port channel interface. The vPC port
number is unique for the vPC within the vPC domain and must be identical on the
Note
Keep in mind that the port channel number and vPC number can be different on the
same switch.
vPC Guidelines
There are several guidelines and considerations that you need to be aware of when
● You must pair Cisco Nexus switches of the same type. For example, you can
deploy vPC on a pair of Cisco Nexus 5600 Series Switches or Cisco Nexus
● A vPC peer link must consist of Ethernet ports with an interface speed of 10
● A vPC is a per-VDC function on the Cisco Nexus 7000 Series Switches. You
independent. A separate vPC peer link and vPC peer keepalive link are
required for each of the VDCs. vPC domains cannot be stretched across
multiple VDCs on the same switch, and all ports for a given vPC must be in
a shared vPC domain ID. It is not possible to add more than two switches or
● You can configure only one vPC domain ID on a single switch or VDC. It is
not possible for a switch or VDC to participate in more than one vPC domain.
● A vPC is a Layer 2 port channel. vPC does not support the configuration of
Layer 3 port channels. Dynamic routing from the vPC peers to the routers that
● You can use vPC as a Layer 2 link to establish a routing adjacency between
two external routers. The routing restrictions for vPCs only apply to routing
adjacencies between the vPC peer switches and routers that are connected
on a vPC.
Note
For more details, you should read the vPC Best Practices Design Guide at
http://www.cisco.com/c/dam/en/us/td/docs/switches/datacenter/sw/design/
vpc_design/vpc_best_practices_design_guide.pdf
vPC Features
The vPC Peer-Gateway enhancement allows a vPC peer device to act as the active
gateway for packets that are addressed to the other peer device router MAC. This
feature enables local forwarding of packets, destined to the other peer device,
storage (NAS) devices or load balancers. These devices might have some
optimization features that allow the devices to avoid a typical default gateway ARP
request.
Note
Dell EMC or NetApp NAS devices are examples of such NAS servers
In the figure, PEER-A is the default gateway in VLAN10. But because NAS uses
MAC address to reach the IP gateway. The ACC-1 switch accepts this packet,
hashes it, and chooses to forward it through the port towards PEER-A. With peer-
gateway enabled, PEER-A will route the packets normally, and will not forward them
When you enable the vPC peer-gateway functionality, each vPC peer device will
locally replicate the MAC address of the interface VLAN that is defined on the other
vPC peer device with the G flag (Gateway flag). In the figure, PEER-A will program
MAC2 (the MAC address of interface VLAN 10) in its MAC table and set the G flag
for this MAC address. PEER-B will do the same for MAC1.
To activate the vPC peer-gateway capability, use the following command line (under
Note
You need to configure both vPC peer devices with this command.
You should always enable vPC peer-gateway in the vPC domain There is no impact
vPC Peer-Switch
environment.
The vPC peer-switch feature allows a pair of vPC peer devices to appear as a single
STP root in the Layer 2 topology (they have the same bridge ID). vPC peer-switch
must be configured on both vPC peer devices to become operational with the peer-
switch command.
The main advantage of the vPC peer-switch feature is the improvement in terms of
convergence time during vPC primary peer device failure/recovery. These up/down
events do not cause any STP recalculations, so the traffic disruption can be lowered
to subsecond values.
This feature also simplifies the STP configuration by eliminating the need to pin the
← AnteriorSiguiente →