Tema 7
Tema 7
Module 1: STP
Concepts
Adriano Nuhani
Forwarding Data
Port State BPDU MAC Address Table
Frames
Blocking Receive only No update No
STP can be configured to operate in an environment with multiple VLANs. In Per-VLAN Spanning Tree
(PVST) versions of STP, there is a root bridge elected for each spanning tree instance. This makes it
possible to have different root bridges for different sets of VLANs. STP operates a separate instance of
STP for each individual VLAN. If all ports on all switches are members of VLAN 1, then there is only
one spanning tree instance.
1.3 Evolution of STP
Evolution of STP
Different Versions of STP
• Many professionals generically use spanning tree and STP to refer to the various implementations
of spanning tree, such as Rapid Spanning Tree Protocol (RSTP) and Multiple Spanning Tree
Protocol (MSTP). In order to communicate spanning tree concepts correctly, it is important to refer
to the implementation or standard of spanning tree in context.
• The latest IEEE documentation on spanning tree (IEEE-802-1D-2004) says, "STP has now been
superseded by the Rapid Spanning Tree Protocol (RSTP)."The IEEE uses "STP" to refer to the
original implementation of spanning tree and "RSTP" to describe the version of spanning tree
specified in IEEE-802.1D-2004.
• Because the two protocols share much of the same terminology and methods for the loop-free
path, the primary focus will be on the current standard and the Cisco proprietary implementations
of STP and RSTP.
• Cisco switches running IOS 15.0 or later, run PVST+ by default. This version incorporates many of
the specifications of IEEE 802.1D-2004, such as alternate ports in place of the former non-
designated ports. Switches must be explicitly configured for rapid spanning tree mode in order to
run the rapid spanning tree protocol.
Evolution of STP
Different Versions of STP (Cont.)
STP
Description
Variety
This is the original IEEE 802.1D version (802.1D-1998 and earlier) that provides a loop-free topology in a
STP network with redundant links. Also called Common Spanning Tree (CST), it assumes one spanning tree
instance for the entire bridged network, regardless of the number of VLANs.
Per-VLAN Spanning Tree (PVST+) is a Cisco enhancement of STP that provides a separate 802.1D spanning
PVST+ tree instance for each VLAN configured in the network. PVST+ supports PortFast, UplinkFast, BackboneFast,
BPDU guard, BPDU filter, root guard, and loop guard.
802.1D-
This is an updated version of the STP standard, incorporating IEEE 802.1w.
2004
Rapid Spanning Tree Protocol (RSTP) or IEEE 802.1w is an evolution of STP that provides faster
RSTP
convergence than STP.
Rapid This is a Cisco enhancement of RSTP that uses PVST+ and provides a separate instance of 802.1w per
PVST+ VLAN. Each separate instance supports PortFast, BPDU guard, BPDU filter, root guard, and loop guard.
Multiple Spanning Tree Protocol (MSTP) is an IEEE standard inspired by the earlier Cisco proprietary Multiple
MSTP
Instance STP (MISTP) implementation. MSTP maps multiple VLANs into the same spanning tree instance.
Multiple Spanning Tree (MST) is the Cisco implementation of MSTP, which provides up to 16 instances of
MST RSTP and combines many VLANs with the same physical and logical topology into a common RSTP
instance. Each instance supports PortFast, BPDU guard, BPDU filter, root guard, and loop guard.
Evolution of STP
RSTP Concepts
• RSTP (IEEE 802.1w) supersedes the original 802.1D while retaining backward compatibility. The
802.1w STP terminology remains primarily the same as the original IEEE 802.1D STP terminology.
Most parameters have been left unchanged. Users that are familiar with the original STP standard
can easily configure RSTP. The same spanning tree algorithm is used for both STP and RSTP to
determine port roles and topology.
• RSTP increases the speed of the recalculation of the spanning tree when the Layer 2 network
topology changes. RSTP can achieve much faster convergence in a properly configured network,
sometimes in as little as a few hundred milliseconds. If a port is configured to be an alternate port it
can immediately change to a forwarding state without waiting for the network to converge.
Note: Rapid PVST+ is the Cisco implementation of RSTP on a per-VLAN basis. With Rapid PVST+ an
independent instance of RSTP runs for each VLAN.
Evolution of STP
RSTP Port States and Port Roles
There are only three port states Root ports and designated ports are the
in RSTP that correspond to the same for both STP and RSTP. However,
three possible operational states there are two RSTP port roles that
in STP. The 802.1D disabled, correspond to the blocking state of STP. In
blocking, and listening states are STP, a blocked port is defined as not being
merged into a unique 802.1w the designated or root port. RSTP has two
discarding state. port roles for this purpose.
Evolution of STP
RSTP Port States and Port Roles (Cont.)
The alternate port has an alternate path to the root bridge. The backup port is a backup to a shared
medium, such as a hub. A backup port is less common because hubs are now considered legacy
devices.
Evolution of STP
PortFast and BPDU Guard
• When a device is connected to a switch port or when a switch powers up, the switch port goes
through both the listening and learning states, each time waiting for the Forward Delay timer to
expire. This delay is 15 seconds for each state for a total of 30 seconds. This can present a
problem for DHCP clients trying to discover a DHCP server because the DHCP process may
timeout. The result is that an IPv4 client will not receive a valid IPv4 address.
• When a switch port is configured with PortFast, that port transitions from blocking to forwarding
state immediately, avoiding the 30 second delay. You can use PortFast on access ports to allow
devices connected to these ports to access the network immediately. PortFast should only be used
on access ports. If you enable PortFast on a port connecting to another switch, you risk creating a
spanning tree loop.
• A PortFast-enabled switch port should never receive BPDUs because that would indicate that
switch is connected to the port, potentially causing a spanning tree loop. Cisco switches support a
feature called BPDU guard. When enabled, it immediately puts the switch port in an errdisabled
(error-disabled) state upon receipt of any BPDU. This protects against potential loops by effectively
shutting down the port. The administrator must manually put the interface back into service.
Evolution of STP
Alternatives to STP
• Over the years, organizations required greater resiliency and availability in the LAN. Ethernet
LANs went from a few interconnected switches connected to a single router, to a sophisticated
hierarchical network design including access, distribution and core layer switches.
• Depending on the implementation, Layer 2 may include not only the access layer, but also the
distribution or even the core layers. These designs may include hundreds of switches, with
hundreds or even thousands of VLANs. STP has adapted to the added redundancy and complexity
with enhancements, as part of RSTP and MSTP.
• An important aspect to network design is fast and predictable convergence when there is a failure
or change in the topology. Spanning tree does not offer the same efficiencies and predictabilities
provided by routing protocols at Layer 3.
• Layer 3 routing allows for redundant paths and loops in the topology, without blocking ports. For
this reason, some environments are transitioning to Layer 3 everywhere except where devices
connect to the access layer switch. In other words, the connections between access layer switches
and distribution switches would be Layer 3 instead of Layer 2.
1.4 Module Practice and Quiz
• Module Practice and Quiz
What Did I Learn In This Module?
• Redundant paths in a switched Ethernet network may cause both physical and logical Layer 2 loops.
• A Layer 2 loop can result in MAC address table instability, link saturation, and high CPU utilization on switches and end-
devices. This results in the network becoming unusable.
• STP is a loop-prevention network protocol that allows for redundancy while creating a loop-free Layer 2 topology. Without
STP, Layer 2 loops can form, causing broadcast, multicast and unknown unicast frames to loop endlessly, bringing down a
network.
• Using the STA, STP builds a loop-free topology in a four-step process: elect the root bridge, elect the root ports, elect
designated ports, and elect alternate (blocked) ports.
• During STA and STP functions, switches use BPDUs to share information about themselves and their connections. BPDUs
are used to elect the root bridge, root ports, designated ports, and alternate ports.
• When the root bridge has been elected for a given spanning tree instance, the STA determines the best paths to the root
bridge from all destinations in the broadcast domain. The path information, known as the internal root path cost, is
determined by the sum of all the individual port costs along the path from the switch to the root bridge.
• After the root bridge has been determined the STA algorithm selects the root port. The root port is the port closest to the root
bridge in terms of overall cost, which is called the internal root path cost.
• After each switch selects a root port, switches will select designated ports. The designated port is a port on the segment
(with two switches) that has the internal root path cost to the root bridge.
• If a port is not a root port or a designated port, then it becomes an alternate (or backup) port. Alternate ports and backup
ports are in discarding or blocking state to prevent loops.
Module Practice and Quiz
What Did I Learn In This Module? (Cont.)
• When a switch has multiple equal-cost paths to the root bridge, the switch will determine a port using the following criteria:
lowest sender BID, then the lowest sender port priority, and finally the lowest sender port ID.
• STP convergence requires three timers: the hello timer, the forward delay timer, and the max age timer.
• Port states are blocking, listening, learning, forwarding, and disabled.
• In PVST versions of STP, there is a root bridge elected for each spanning tree instance. This makes it possible to have
different root bridges for different sets of VLANs.
• STP is often used to refer to the various implementations of spanning tree, such as RSTP and MSTP.
• RSTP is an evolution of STP that provides faster convergence than STP.
• RSTP port states are learning, forwarding and discarding.
• PVST+ is a Cisco enhancement of STP that provides a separate spanning tree instance for each VLAN configured in the
network. PVST+ supports PortFast, UplinkFast, BackboneFast, BPDU guard, BPDU filter, root guard, and loop guard.
• Cisco switches running IOS 15.0 or later, run PVST+ by default.
• Rapid PVST+ is a Cisco enhancement of RSTP that uses PVST+ and provides a separate instance of 802.1w per VLAN.
• When a switch port is configured with PortFast, that port transitions from blocking to forwarding state immediately, bypassing
the STP listening and learning states and avoiding a 30 second delay.
• Use PortFast on access ports to allow devices connected to these ports, such as DHCP clients, to access the network
immediately, rather than waiting for STP to converge on each VLAN.
Module Practice and Quiz
What Did I Learn In This Module? (Cont.)
• Cisco switches support a feature called BPDU guard which immediately puts the switch port in an error-disabled state upon
receipt of any BPDU to protect against potential loops.
• Over the years, Ethernet LANs went from a few interconnected switches that were connected to a single router, to a
sophisticated hierarchical network design. Depending on the implementation, Layer 2 may include not only the access layer,
but also the distribution or even the core layers. These designs may include hundreds of switches, with hundreds or even
thousands of VLANs. STP has adapted to the added redundancy and complexity with enhancements as part of RSTP and
MSTP.
• Layer 3 routing allows for redundant paths and loops in the topology, without blocking ports. For this reason, some
environments are transitioning to Layer 3 everywhere except where devices connect to the access layer switch.
Module 2: EtherChannel
Module Objectives
Module Title: EtherChannel
When an EtherChannel is
configured, the resulting virtual
interface is called a port channel.
The physical interfaces are
bundled together into a port
channel interface, as shown in the
figure.
EtherChannel Operation
Advantages of EtherChannel
EtherChannel technology has many advantages, including the following:
• Most configuration tasks can be done on the EtherChannel interface instead of on each
individual port, ensuring configuration consistency throughout the links.
• EtherChannel relies on existing switch ports. There is no need to upgrade the link to a faster
and more expensive connection to have more bandwidth.
• Load balancing takes place between links that are part of the same EtherChannel.
• EtherChannel creates an aggregation that is seen as one logical link. When several
EtherChannel bundles exist between two switches, STP may block one of the bundles to
prevent switching loops. When STP blocks one of the redundant links, it blocks the entire
EtherChannel. This blocks all the ports belonging to that EtherChannel link. Where there is only
one EtherChannel link, all physical links in the EtherChannel are active because STP sees only
one (logical) link.
• EtherChannel provides redundancy because the overall link is seen as one logical connection.
Additionally, the loss of one physical link within the channel does not create a change in the
topology.
EtherChannel Operation
Implementation Restrictions
EtherChannel has certain implementation restrictions, including the following:
• Interface types cannot be mixed. For example, Fast Ethernet and Gigabit Ethernet
cannot be mixed within a single EtherChannel.
• Currently each EtherChannel can consist of up to eight compatibly-configured
Ethernet ports. EtherChannel provides full-duplex bandwidth up to 800 Mbps (Fast
EtherChannel) or 8 Gbps (Gigabit EtherChannel) between one switch and another
switch or host.
• The Cisco Catalyst 2960 Layer 2 switch currently supports up to six EtherChannels.
• The individual EtherChannel group member port configuration must be consistent on
both devices. If the physical ports of one side are configured as trunks, the physical
ports of the other side must also be configured as trunks within the same native
VLAN. Additionally, all ports in each EtherChannel link must be configured as Layer 2
ports.
• Each EtherChannel has a logical port channel interface. A configuration applied to the
port channel interface affects all physical interfaces that are assigned to that interface.
EtherChannel Operation
AutoNegotiation Protocols
EtherChannels can be formed through negotiation using one of two protocols, Port
Aggregation Protocol (PAgP) or Link Aggregation Control Protocol (LACP). These
protocols allow ports with similar characteristics to form a channel through dynamic
negotiation with adjoining switches.
When enabled, PAgP also manages the EtherChannel. PAgP packets are sent every 30 seconds.
PAgP checks for configuration consistency and manages link additions and failures between two
switches. It ensures that when an EtherChannel is created, all ports have the same type of
configuration.
Note: In EtherChannel, it is mandatory that all ports have the same speed, duplex setting, and VLAN
information. Any port modification after the creation of the channel also changes all other channel ports.
EtherChannel Operation
PAgP Operation (Cont.)
PAgP helps create the EtherChannel link by detecting the configuration of each side and ensuring that links
are compatible so that the EtherChannel link can be enabled when needed. The modes for PAgP as follows:
• On - This mode forces the interface to channel without PAgP. Interfaces configured in the on mode do
not exchange PAgP packets.
• PAgP desirable - This PAgP mode places an interface in an active negotiating state in which the
interface initiates negotiations with other interfaces by sending PAgP packets.
• PAgP auto - This PAgP mode places an interface in a passive negotiating state in which the interface
responds to the PAgP packets that it receives but does not initiate PAgP negotiation.
The modes must be compatible on each side. If one side is configured to be in auto mode, it is placed in a
passive state, waiting for the other side to initiate the EtherChannel negotiation. If the other side is also set
to auto, the negotiation never starts and the EtherChannel does not form. If all modes are disabled by using
the no command, or if no mode is configured, then the EtherChannel is disabled. The on mode manually
places the interface in an EtherChannel, without any negotiation. It works only if the other side is also set to
on. If the other side is set to negotiate parameters through PAgP, no EtherChannel forms, because the side
that is set to on mode does not negotiate. No negotiation between the two switches means there is no
checking to make sure that all the links in the EtherChannel are terminating on the other side, or that there
is PAgP compatibility on the other switch.
EtherChannel Operation
PAgP Mode Settings Example
The table shows the various combination of PAgP modes on S1 and S2 and the resulting channel establishment outcome.
S1 S2 Channel Establishment
On On Yes
On Desirable/Auto No
Auto Auto No
EtherChannel Operation
LACP Operation
LACP is part of an IEEE specification (802.3ad) that allows several physical ports to be bundled to form
a single logical channel. LACP allows a switch to negotiate an automatic bundle by sending LACP
packets to the other switch. It performs a function similar to PAgP with Cisco EtherChannel. Because
LACP is an IEEE standard, it can be used to facilitate EtherChannels in multivendor environments. On
Cisco devices, both protocols are supported.
LACP provides the same negotiation benefits as PAgP. LACP helps create the EtherChannel link by
detecting the configuration of each side and making sure that they are compatible so that the
EtherChannel link can be enabled when needed. The modes for LACP are as follows:
• On - This mode forces the interface to channel without LACP. Interfaces configured in the on
mode do not exchange LACP packets.
• LACP active - This LACP mode places a port in an active negotiating state. In this state, the port
initiates negotiations with other ports by sending LACP packets.
• LACP passive - This LACP mode places a port in a passive negotiating state. In this state, the
port responds to the LACP packets that it receives but does not initiate LACP packet negotiation.
EtherChannel Operation
LACP Mode Settings Example
The table shows the various combination of LACP modes on S1 and S2 and the resulting channel establishment outcome.
S1 S2 Channel Establishment
On On Yes
On Active/Passive No
Active Active Yes
Active Passive Yes
Passive Active Yes
Passive Passive No
2.2 Configure EtherChannel
Configure EtherChannel
Configuration Guidelines
The following guidelines and restrictions are useful for configuring EtherChannel:
• EtherChannel support - All Ethernet interfaces must support EtherChannel with no
requirement that interfaces be physically contiguous.
• Speed and duplex - Configure all interfaces in an EtherChannel to operate at the
same speed and in the same duplex mode.
• VLAN match - All interfaces in the EtherChannel bundle must be assigned to the
same VLAN or be configured as a trunk (shown in the figure).
• Range of VLANs - An EtherChannel supports the same allowed range of VLANs on
all the interfaces in a trunking EtherChannel. If the allowed range of VLANs is not the
same, the interfaces do not form an EtherChannel, even when they are set
to auto or desirable mode.
Configure EtherChannel
Configuration Guidelines (Cont.)
• The figure shows a configuration that would allow an EtherChannel to form between S1 and
S2.
• If these settings must be changed, configure them in port channel interface configuration
mode. Any configuration that is applied to the port channel interface also affects individual
interfaces. However, configurations that are applied to the individual interfaces do not affect
the port channel interface. Therefore, making configuration changes to an interface that is
part of an EtherChannel link may cause interface compatibility issues.
• The port channel can be configured in access mode, trunk mode (most common), or on a
routed port.
Configure EtherChannel
LACP Configuration Example
Configuring EtherChannel with LACP requires the following three steps:
• Step 1. Specify the interfaces that compose the EtherChannel group using the interface
range interface global configuration mode command. The range keyword allows you to select several
interfaces and configure them all together.
• Step 2. Create the port channel interface with the channel-group identifier mode active command in
interface range configuration mode. The identifier specifies a channel group number. The mode
active keywords identify this as an LACP EtherChannel configuration.
• Step3. To change Layer 2 settings on the port channel interface, enter port channel interface configuration
mode using the interface port-channel command, followed by the interface identifier. In the example, S1 is
configured with an LACP EtherChannel. The port channel is configured as a trunk interface with the allowed
VLANs specified.
2.3 Verify and Troubleshoot
EtherChannel
Verify and Troubleshoot EtherChannel
Verify EtherChannel
As always, when you configure devices in your network, you must verify your
configuration. If there are problems, you will also need to be able to troubleshoot and fix
them. There are a number of commands to verify an EtherChannel configuration:
• The show interfaces port-channel command displays the general status of the port
channel interface.
• The show etherchannel summary command displays one line of information per
port channel.
• The show etherchannel port-channel command displays information about a
specific port channel interface.
• The show interfaces etherchannel command can provide information about the role
of a physical member interface of the EtherChannel.
Verify and Troubleshoot EtherChannel
Common Issues with EtherChannel Configurations
All interfaces within an EtherChannel must have the same configuration of speed and
duplex mode, native and allowed VLANs on trunks, and access VLAN on access ports.
Ensuring these configurations will significantly reduce network problems related to
EtherChannel. Common EtherChannel issues include the following:
• Assigned ports in the EtherChannel are not part of the same VLAN, or not configured
as trunks. Ports with different native VLANs cannot form an EtherChannel.
• Trunking was configured on some of the ports that make up the EtherChannel, but
not all of them. It is not recommended that you configure trunking mode on individual
ports that make up the EtherChannel. When configuring a trunk on an EtherChannel,
verify the trunking mode on the EtherChannel.
• If the allowed range of VLANs is not the same, the ports do not form an
EtherChannel even when PAgP is set to the auto or desirable mode.
• The dynamic negotiation options for PAgP and LACP are not compatibly configured
on both ends of the EtherChannel.
Verify and Troubleshoot EtherChannel
Troubleshoot EtherChannel Example
In the figure, interfaces F0/1 and F0/2 on switches S1 and S2 are connected with an
EtherChannel. However, the EtherChannel is not operational.
Verify and Troubleshoot EtherChannel
Troubleshoot EtherChannel Example (Cont.)
Step 1. View the EtherChannel Summary Information: The output of the show
etherchannel summary command indicates that the EtherChannel is down.
Verify and Troubleshoot EtherChannel
Troubleshoot EtherChannel Example (Cont.)