Purpose of STP Redundancy in Layer 2 Switched Networks STP Recalculation
Purpose of STP Redundancy in Layer 2 Switched Networks STP Recalculation
Redundancy in Layer 2 Switched Networks STP compensates for a failure in the network by
recalculating and opening up previously blocked ports.
● This topic covers the causes of loops in a Layer 2
network and briefly explains how spanning tree
protocol works. Redundancy is an important
part of the hierarchical design for eliminating
single points of failure and preventing
disruption of network services to users.
Redundant networks require the addition of
physical paths, but logical redundancy must also
be part of the design. Having alternate physical
Issues with Redundant Switch Links
paths for data to traverse the network makes it
possible for users to access network resources, ● Path redundancy provides multiple network
despite path disruption. However, redundant services by eliminating the possibility of a single
paths in a switched Ethernet network may point of failure. When multiple paths exist
cause both physical and logical Layer 2 loops. between two devices on an Ethernet network,
and there is no spanning tree implementation
● Ethernet LANs require a loop-free topology with
on the switches, a Layer 2 loop occurs. A Layer 2
a single path between any two devices. A loop
loop can result in MAC address table instability,
in an Ethernet LAN can cause continued
link saturation, and high CPU utilization on
propagation of Ethernet frames until a link is
switches and end-devices, resulting in the
disrupted and breaks the loop.
network becoming unusable.
Layer 2 Loops
● Layer 2 broadcasts in a network, such as ARP ● Block Redundant Paths: STP ensures that there
Requests are very common. Layer 2 multicasts is only one logical path between all destinations
are typically forwarded the same way as a on the network by intentionally blocking
broadcast by the switch. IPv6 packets are never redundant paths that could cause a loop. When
forwarded as a Layer 2 broadcast, ICMPv6 a port is blocked, user data is prevented from
Neighbor Discovery uses Layer 2 multicasts. entering or leaving that port.
● A host caught in a Layer 2 loop is not accessible ● Create a Loop-Free Topology: A blocked port
to other hosts on the network. Additionally, due has the effect of making that link a non-
to the constant changes in its MAC address forwarding link between the two switches. This
table, the switch does not know out of which creates a topology where each switch has only a
port to forward unicast frames. single path to the root bridge, similar to
branches on a tree that connect to the root of
● To prevent these issues from occurring in a the tree.
redundant network, some type of spanning tree
must be enabled on the switches. Spanning tree ● Recalculate in case of Link Failure: The physical
is enabled, by default, on Cisco switches to paths still exist to provide redundancy, but
prevent Layer 2 loops from occurring. these paths are disabled to prevent the loops
from occurring. If the path is ever needed to
compensate for a network cable or switch
The Spanning Tree Algorithm failure, STP recalculates the paths and unblocks
the necessary ports to allow the redundant path
● STP is based on an algorithm invented by Radia to become active. STP recalculations can also
Perlman while working for Digital Equipment
occur any time a new switch or new inter- ● MAC address: When two switches are
switch link is added to the network. configured with the same priority and have the
same extended system ID, the switch having the
MAC address with the lowest value, expressed
STP OPERATIONS in hexadecimal, will have the lower BID.
Using the STA, STP builds a loop-free topology in a four- 1. Elect the Root Bridge
step process: ● The STA designates a single switch as the root
1. Elect the root bridge. bridge and uses it as the reference point for all
path calculations. Switches exchange BPDUs to
2. Elect the root ports. build the loop-free topology beginning with
selecting the root bridge.
3. Elect designated ports.
● All switches in the broadcast domain participate
4. Elect alternate (blocked) ports.
in the election process. After a switch boots, it
● During STA and STP functions, switches use begins to send out BPDU frames every two
Bridge Protocol Data Units (BPDUs) to share seconds. These BPDU frames contain the BID of
information about themselves and their the sending switch and the BID of the root
connections. BPDUs are used to elect the root bridge, known as the Root ID.
bridge, root ports, designated ports, and
● The switch with the lowest BID will become the
alternate ports.
root bridge. At first, all switches declare
● Each BPDU contains a bridge ID (BID) that themselves as the root bridge with their own
identifies which switch sent the BPDU. The BID BID set as the Root ID. Eventually, the switches
is involved in making many of the STA decisions learn through the exchange of BPDUs which
including root bridge and port roles. switch has the lowest BID and will agree on one
root bridge.
● The BID contains a priority value, the MAC
address of the switch, and an extended system
ID. The lowest BID value is determined by the
combination of these three fields.
● Extended System ID: The extended system ID ● Because the default BID is 32768, it is possible
value is a decimal value added to the bridge for two or more switches to have the same
priority value in the BID to identify the VLAN for priority. In this scenario, where the priorities
this BPDU. are the same, the switch with the lowest MAC
address will become the root bridge. The
administrator should configure the desired root the IEEE 802.1D standard, also known as the
bridge switch with a lower priority. short path cost, for both STP and RSTP.
● In the figure, all switches are configured with ● Although switch ports have a default port cost
the same priority of 32769. Here the MAC associated with them, the port cost is
address becomes the deciding factor as to configurable. The ability to configure individual
which switch becomes the root bridge. The port costs gives the administrator the flexibility
switch with the lowest hexadecimal MAC to manually control the spanning tree paths to
address value is the preferred root bridge. In the root bridge.
this example, S2 has the lowest value for its
MAC address and is elected as the root bridge
for that spanning tree instance.
Link Speed STP Cost: IEEE RSTP Cost: IEEE
● Note: The priority of all the switches is 32769.
The value is based on the 32768 default bridge 802.1D-1998 802.1w-2004
priority and the extended system ID (VLAN 1
assignment) associated with each switch 10 Gbps 2 2,000
(32768+1).
1 Gbps 4 20,000
● All ports on the root bridge are designated Elect a Root Port from Multiple Equal-Cost Paths
ports.
When a switch has multiple equal-cost paths to the root
● If one end of a segment is a root port, the other bridge, the switch will determine a port using the
end is a designated port. following criteria:
● All ports attached to end devices are designated ● Lowest sender BID
ports.
● Lowest sender port priority
● On segments between two switches where
neither of the switches is the root bridge, the ● Lowest sender port ID
port on the switch with the least-cost path to
the root bridge is a designated port.
Lowest Sender BID: This topology has four switches
with switch S1 as the root bridge. Port F0/1 on switch S3
and port F0/3 on switch S4 have been selected as root
ports because they have the root path cost to the root
bridge for their respective switches. S2 has two ports,
F0/1 and F0/2 with equal cost paths to the root bridge.
The bridge IDs of S3 and S4, will be used to break the
tie. This is known as the sender’s BID. S3 has a BID of
32769.5555.5555.5555 and S4 has a BID of
32769.1111.1111.1111. Because S4 has a lower BID, the
F0/1 port of S2, which is the port connected to S4, will
be the root port.
STP Timers and Port States
Blocking
● No BPDU received
Learning
EVOLUTION OF STP
● Forward Delay = 15 seconds
Different Versions of STP
Forwarding
● Many professionals generically use spanning
tree and STP to refer to the various
Operational Details of Each Port State implementations of spanning tree, such as
Rapid Spanning Tree Protocol (RSTP) and
The table summarizes the operational details of each Multiple Spanning Tree Protocol (MSTP). In
port state order to communicate spanning tree concepts
correctly, it is important to refer to the
implementation or standard of spanning tree in
context.
Port State BPDU MAC Forwarding
Address Data Frames ● The latest IEEE documentation on spanning tree
Table (IEEE-802-1D-2004) says, "STP has now been
superseded by the Rapid Spanning Tree
Blocking Receive No update No Protocol (RSTP)."The IEEE uses "STP" to refer to
only the original implementation of spanning tree
and "RSTP" to describe the version of spanning
tree specified in IEEE-802.1D-2004.
Listening Receive No update No
and send ● Because the two protocols share much of the
same terminology and methods for the loop-
Learning Receive Updating No free path, the primary focus will be on the
and send table current standard and the Cisco proprietary
implementations of STP and RSTP.
Forwarding Receive Updating Yes ● Cisco switches running IOS 15.0 or later, run
and send table PVST+ by default. This version incorporates
many of the specifications of IEEE 802.1D-2004,
such as alternate ports in place of the former
Disabled None No update No
non-designated ports. Switches must be
sent or
explicitly configured for rapid spanning tree
received
mode in order to run the rapid spanning tree
protocol.
Learning Learning
RSTP Concepts
● When a device is connected to a switch port or
Forwarding Forwarding
when a switch powers up, the switch port goes
through both the listening and learning states,
each time waiting for the Forward Delay timer
Root ports and designated ports are the same for both to expire. This delay is 15 seconds for each state
STP and RSTP. However, there are two RSTP port roles for a total of 30 seconds. This can present a
that correspond to the blocking state of STP. In STP, a problem for DHCP clients trying to discover a
blocked port is defined as not being the designated or DHCP server because the DHCP process may
root port. RSTP has two port roles for this purpose. timeout. The result is that an IPv4 client will not
receive a valid IPv4 address.
Alternatives to STP
ETHERCHANNEL
EtherChannel OPERATION
Link Aggregation
EtherChannel has certain implementation restrictions, PAgP (pronounced “Pag - P”) is a Cisco-proprietary
including the following: protocol that aids in the automatic creation of
EtherChannel links. When an EtherChannel link is
● Interface types cannot be mixed. For example, configured using PAgP, PAgP packets are sent between
Fast Ethernet and Gigabit Ethernet cannot be EtherChannel-capable ports to negotiate the forming of
mixed within a single EtherChannel. a channel. When PAgP identifies matched Ethernet
● Currently each EtherChannel can consist of up links, it groups the links into an EtherChannel. The
EtherChannel is then added to the spanning tree as a
to eight compatibly-configured Ethernet ports.
EtherChannel provides full-duplex bandwidth single port.
up to 800 Mbps (Fast EtherChannel) or 8 Gbps When enabled, PAgP also manages the EtherChannel.
(Gigabit EtherChannel) between one switch and PAgP packets are sent every 30 seconds. PAgP checks
another switch or host. for configuration consistency and manages link
● The Cisco Catalyst 2960 Layer 2 switch currently additions and failures between two switches. It ensures
that when an EtherChannel is created, all ports have the
supports up to six EtherChannels.
same type of configuration.
● The individual EtherChannel group member
Note: In EtherChannel, it is mandatory that all ports
port configuration must be consistent on both
devices. If the physical ports of one side are have the same speed, duplex setting, and VLAN
configured as trunks, the physical ports of the information. Any port modification after the creation of
other side must also be configured as trunks the channel also changes all other channel ports.
within the same native VLAN. Additionally, all
ports in each EtherChannel link must be
configured as Layer 2 ports.
PAgP helps create the EtherChannel link by detecting
● Each EtherChannel has a logical port channel the configuration of each side and ensuring that links
interface. A configuration applied to the port are compatible so that the EtherChannel link can be
channel interface affects all physical interfaces enabled when needed. The modes for PAgP as follows:
that are assigned to that interface.
● On - This mode forces the interface to channel
without PAgP. Interfaces configured in the on
mode do not exchange PAgP packets. S1 S2 Channel
Establishment
● PAgP desirable - This PAgP mode places an
interface in an active negotiating state in which
the interface initiates negotiations with other On On Yes
interfaces by sending PAgP packets.
On Desirable/Auto No
● PAgP auto - This PAgP mode places an interface
in a passive negotiating state in which the
interface responds to the PAgP packets that it Desirable Desirable Yes
receives but does not initiate PAgP negotiation.
Desirable Auto Yes
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 Auto Desirable Yes
EtherChannel negotiation. If the other side is also set to
auto, the negotiation never starts and the EtherChannel Auto Auto No
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 LACP Operation
negotiation. It works only if the other side is also set to
LACP is part of an IEEE specification (802.3ad) that
on. If the other side is set to negotiate parameters
allows several physical ports to be bundled to form a
through PAgP, no EtherChannel forms, because the side
single logical channel. LACP allows a switch to negotiate
that is set to on mode does not negotiate. No
an automatic bundle by sending LACP packets to the
negotiation between the two switches means there is
other switch. It performs a function similar to PAgP with
no checking to make sure that all the links in the
Cisco EtherChannel. Because LACP is an IEEE standard, it
EtherChannel are terminating on the other side, or that
can be used to facilitate EtherChannels in multivendor
there is PAgP compatibility on the other switch.
environments. On Cisco devices, both protocols are
supported.
PAgP Mode Settings Example 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:
The table shows the various combination of PAgP ● On - This mode forces the interface to channel
modes on S1 and S2 and the resulting channel without LACP. Interfaces configured in the on
establishment outcome. mode do not exchange LACP packets.
CONFIGURE ETHERCHANNEL
Configuration Guidelines