0% found this document useful (0 votes)
7 views

Spanning Tree Protocol

Uploaded by

lynnunderwater
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Spanning Tree Protocol

Uploaded by

lynnunderwater
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Spanning tree Protocol

What if a broadcast storm occur on layer 2 domain?

As previously mentioned, switches flood broadcast frames and frames for unknown MAC addresses out
all ports except the port on which those frames were received. In Layer 2 networks with redundant
paths, such as the one illustrated on the slide, switches will continuously flood these types of frames
throughout the network. When a frame is continuously flooded throughout a Layer 2 network, a Layer 2
loop exists. Layer 2 loops can be extremely harmful to a network’s operation and should be avoided. To
avoid Layer 2 loops, you must implement a Layer 2 loop-prevention mechanism such as the spanning
tree protocol (STP).

Switching loops

A switching loop or bridge loop occurs in computer networks when there is more than one Layer 2 (OSI
model) path between two endpoints (e.g. multiple connections between two network switches or two
ports on the same switch connected to each other). The loop creates broadcast storms as broadcasts
and multicasts are forwarded by switches out every port, the switch or switches will repeatedly
rebroadcast the broadcast messages flooding the network.[1] Since the Layer 2 header does not support
a time to live (TTL) value, if a frame is sent into a looped topology, it can loop forever.

A physical topology that contains switching or bridge loops is attractive for redundancy reasons, yet a
switched network must not have loops. The solution is to allow physical loops, but create a loop-free
logical topology using the shortest path bridging (SPB) protocol or the older spanning tree protocols
(STP) on the network switches.

STP

Juniper Business Use Only


Spanning tree is defined on the IEEE 802.1D standard. It is a simple layer 2 protocol that prevents loops
and calculates the best path in a network with redundant paths. It builds a loop free topology known as
a “tree” and when a topology change occur STP can automatically rebuild the tree.

STP is highly recommended in any Layer 2 network environment where redundant paths exist or might
exist.

Versions of STP

Note that newer versions of STP exist including Rapid Spanning Tree Protocol (RSTP), Multiple Spanning
Tree Protocol (MSTP), and VLAN Spanning Tree Protocol (VSTP). These newer versions of STP include
enhancements over the original STP.

How does it work?

1. Switches exchange Bridge Protocol Data Units (BPDUs)


2. A Root Bridge is elected
3. Port roles and states are determined
4. Redundant paths are blocked
5. Tree is fully converged.

Terms and concepts

Bridge ID: unique identifier for each switch in STP, consist in the switch’s priority and its MAC address

Root Bridge: switch with the lowest Bridge ID.

Root Port: The port of each non-root bridge with the shortest path to the root bridge.

Root path cost: a bridge calculated cost to get from it self to the root bridge.

All switches participating in STP have a unique bridge ID. The bridge ID is a combination of the system
MAC address and a configurable priority value. The lowest bridge ID determines the root bridge. Once
the root bridge is determined, each nonroot switch determines the least-cost path from itself to the root
bridge. The port associated with the least-cost path, referred to as the root path cost, becomes the root
port for the switch. Every port on a switch has a configurable port cost associated with it. A nonroot
switch receives periodic STP BPDUs—described on next slide—that contain a root path cost as
determined by the neighboring switch. The local switch adds the received root path cost to each of the
port costs for its interfaces. Whichever interface is associated with the lowest value (root path cost +
port cost) becomes the root port for the switch.

Juniper Business Use Only


Port states

The slide highlights the STP port states along with a brief description of each state. In addition to the
states listed on the slide, an interface can have STP administratively disabled (default behavior). An
administratively disabled port does not participate in the spanning tree but does flood any BPDUs it
receives to other ports associated with the same VLAN. Administratively disabled ports continue to
perform basic bridging operations and forward data traffic based on the MAC address table

BPDU Ethernet Frame

BPDU Ethernet Frame The slide shows the Ethernet frame format of an STP BPDU. Notice that the
Ethernet frame does not contain any 802.1Q-type VLAN tagging. The source address of the frame is the
MAC address of the outgoing port of the sending switch. The destination address is the multicast MAC
address that is reserved for STP. The frame also contains an LLC header that uses a destination service
access point (DSAP) of 0x42, which refers to the bridge STP.

Juniper Business Use Only


BPDU Types STP uses BPDU packets to exchange information between switches. Two types of BPDUs
exist: configuration BPDUs and topology change notification (TCN) BPDUs. Configuration BPDUs
determine the tree topology of a LAN. STP uses the information that the BPDUs provide to elect a root
bridge, to identify root ports for each switch, to identify designated ports for each physical LAN
segment, and to prune specific redundant links to create a loop-free tree topology. TCN BPDUs report
topology changes within a switched network.

Configuration BPDU Format

When an STP network is first turned up, all participating bridges send out configuration BPDUs to
advertise themselves as candidates for the root bridge. Each bridge uses the received BPDUs to help
build the spanning tree and elect the root bridge, root ports, and designated ports for the network.
Once the STP network converges and is stable, the root bridge sends a configuration BPDU once every
few seconds (the hello time default is 2 seconds). The following list provides a brief explanation of each
of the BPDU fields:
• Protocol ID: This value is always 0.
• Protocol Version: This value is always 0.
• BPDU Type: This field determines which of the two BPDU formats this frame contains—configuration
BPDU (0x00) or TCN BPDU (0x80).
• Flags: This field is used to handle changes in the active topology; we discuss this field later.
• Root ID: This field contains the bridge ID (BID) of the root bridge. After convergence, all configuration
BPDUs in the bridged network should contain the same value for this field (for a single VLAN). Some
network sniffers break out the two BID subfields: bridge priority and bridge MAC address.
• Root Path Cost: This value is the cumulative cost of all links leading to the root bridge.
• Bridge ID (BID): This value is the identifier of the bridge that created the current BPDU. This field is the
same for all BPDUs sent by a single switch (for a single VLAN), but it differs between switches. The BID is
a combination of the sender bridge’s priority to become root or designated bridge and the bridge
address (a unique MAC address for the bridge.)
• Port ID: This field contains a unique value for every port. This value is a combination of the outbound
port’s priority and a unique value to represent the port. The default port priority is 128 for every
interface on an EX Series switch. The switch automatically generates the port number and you cannot
configure it. For example, ge-1/0/0 contains the value 128:513, whereas ge-1/0/1 contains the value
128:514.
• Message Age: This field records the time since the root bridge originally generated the information
from which the current BPDU is derived.
• Max Age: This value is the maximum time that a BPDU is saved. It also influences the bridge table
aging timer during the topology change notification process.
• Hello Time: This value is the time between periodic configuration BPDUs.
• Forward Delay: This value is the time a bridge spends in the listening and learning states. It also
influences timers during the topology change notification process

Exchange of BPDUs Switches participating in a switched network running STP exchange BPDUs with
each other. Through the exchanged BPDUs, neighboring switches become familiar with each other and
learn the information necessary to select a root bridge. Each bridge creates its own configuration BPDUs
based upon the BPDUs that it receives from neighboring routers. Non-STP bridges simply flood BPDUs as
they would any multicast Ethernet frame.

Juniper Business Use Only


Root Bridge Election STP elects the root bridge device based on the BID, which actually consists of two
distinct elements: a configurable priority value and a unique device identifier, which is the system MAC
address. Each switch reviews the priority values first to determine the root bridge. If the priority value of
one switch is lower than the priority value of all other switches, that switch is elected as the root bridge.
If the priority values are equal for multiple switches, STP evaluates the system MAC addresses of the
remaining switches and elects the switch with the lowest MAC address as the root bridge.

Port Role and State Determination Once the root bridge election occurs, all nonroot devices perform a
least-cost path calculation to the root bridge. The results of these calculations determine the role of the
switch ports. The role of the individual switch ports determines the port state. All switch ports belonging
to the root bridge assume the designated port role and forwarding state. Each nonroot switch
determines a root port, which is the port closest to the root bridge, based on its least-cost path
calculation to the root bridge. Each interface has an associated cost that is based on the configured
speed. An interface operating at 10 Mbps assumes a cost of 2,000,000, an interface operating at 100
Mbps assumes a cost of 200,000, an interface operating at 1 Gbps assumes a cost of 20,000, and an
interface operating at 10 Gbps assumes a cost of 2000. If a switch has two equal-cost paths to the root
bridge, the switch port with the lower port ID is selected as the root port. The root port for each nonroot
switch is placed in the forwarding state. STP selects a designated bridge on each LAN segment. This
selection process is also based on the least-cost path calculation from each switch to the root bridge.
Once the designated bridge selection occurs, its port, which connects to the LAN segment, is chosen as
the designated port. If the designated bridge has multiple ports connected to the LAN segment, the port
with the lowest ID participating on that LAN segment is selected as the designated port. All designated
ports assume the forwarding state. All ports not selected as a root port or as a designated port assume
the blocking state. While in blocked state, the ports do not send any BPDUs. However, they listen for
BPDUs.

Full Tree Convergence Once each switch determines the role and state for its ports, the tree is
considered fully converged. The convergence delay can take up to 50 seconds when the default
forwarding delay (15 seconds) and max age timer (20 seconds) values are in effect. The formula to
calculate the convergence delay for STP is 2x the forwarding delay + the maximum age.

Reconvergence example

Juniper Business Use Only


Steps:

1. Switch G fails
2. Switch E’s port leaves forwarding state
3. Switch E sends TCNs out root port every 2 seconds until E’s root port receives TCN ACK
4. Switch B sends TCN ACK
5. Switch B sends TCN out root port
6. Switch A sends TCN ACK
7. Root bridge sets topology change flag and sends
an updated configuration BPDU
8. Switch B and C relay the topology change flag to
downstream switches
9. All nonroot bridges change the mac address
forwarding table aging timer to equal the
forwarding delay time (15 sec)

Stp slow convergence time

For STP to recover from a link failure, it takes approximately 50 seconds: 20 seconds for a BPDU to age
out, 15 seconds for the listening state, and 15 seconds for the learning state. This recalculation of the
spanning tree is a time-consuming process and can result in delayed message delivery as ports transition
between states. Users perceive these delays as service interruptions and certain applications, protocols,
or processes can time out. These results are unacceptable in current high-availability networks, which
led to the evolution of STP to RSTP. STP and RSTP maintain the spanning tree differently. Both use

Juniper Business Use Only


BPDUs to communicate the current tree topology. With STP, the root bridge initiates these messages
and they propagate throughout the tree every hello time interval. With RSTP, a non-root bridge sends a
BPDU with its current information every hello time interval, regardless of receiving BPDUs from the root
bridge.

RSTP

RSTP Defined Rapid Spanning Tree Protocol (RSTP) was originally defined in the IEEE 802.1w draft and
was later incorporated into the IEEE 802.1D-2004 specification. RSTP introduces a number of
improvements to STP while performing the same basic function. RSTP Convergence Improvements RSTP
provides better reconvergence time than the original STP. RSTP identifies certain links as point-to-point.
When a point-to-point link fails, the alternate link can transition to the forwarding state without waiting
for any protocol timers to expire. RSTP provides fast network convergence when a topology change
occurs and it greatly decreases the state transition time compared to STP. To aid in the improved
convergence, RSTP uses additional features and functionality, such as edge port definitions and rapid
direct and indirect link failure detection and recovery.

RSTP Introduces New Port Roles

RSTP introduces the alternate and backup port roles. An alternate port is a switch port that has an
alternate—generally higher-cost—path to the root bridge. In the event that the root port fails, the
alternate port assumes the role of the root port and is placed in the forwarding state. Alternate ports
are placed in the discarding state but receive superior BPDUs from neighboring switches. Alternate ports
are found on switches participating in a shared LAN segment for which they are not functioning as the
designated bridge. When a designated bridge has multiple ports connected to a shared LAN segment, it
selects one of those ports as the designated port. The designated port is typically the port with the
lower port ID. RSTP considers all other ports on the designated switch that connects to that same shared
LAN segment as backup ports. In the event that the designated port is unable to perform its role, one of
the backup ports assumes the designated port role upon successful negotiation and it is placed in the
forwarding state. Backup ports are placed in the discarding state. While in the discarding state, backup
ports receive superior BPDUs from the designated port.

Continued Use of Root and Designated Ports

RSTP continues to use the root and designated port roles. Only ports selected for the root port or
designated port role participate in the active topology.

Juniper Business Use Only


RSTP uses fewer port states than STP. Any administratively disabled port excluded from the active
topology through configuration, or dynamically excluded from forwarding and learning, is placed in the
discarding state. Ports that are actively learning but not currently forwarding are in the learning state,
whereas ports that are both learning and forwarding simultaneously are in the forwarding state. As the
slide indicates, only root and designated ports use the forwarding state

Rapid Spanning Tree BPDUs

As previously mentioned, STP uses BPDUs to elect a root bridge, identify root ports for each switch,
identify designated ports for each physical LAN segment, prune specific redundant links to create a loop-
free tree topology, and report and acknowledge topology changes. RSTP configuration BPDUs also
function as keepalives. All RSTP bridges send configuration BPDUs every 2 seconds by default. You can
alter this value, if necessary. By monitoring neighboring switches through the use of BPDUs, RSTP can
detect failures of network components much more quickly than STP can. If a neighboring switch receives
no BPDU within three times the hello interval, it assumes connectivity is faulty and updates the tree. By
default, RSTP detects a failure within 6 seconds, whereas it might take up to 50 seconds when using STP
(maximum age of 20 seconds plus the listening and learning states of 30 seconds). Ethernet interfaces
operating in full-duplex mode are considered point-to-point links. When a failure occurs, a switch port
operating as a point-to-point link can become a new root port or designated port and transition to the
forwarding state without waiting for the timers to expire as with STP. Switch ports operating in half-
duplex mode are considered to be shared (or LAN) links and must wait for the timer to expire before
transitioning to the forwarding state

Topology Changes

When using STP, state transitions on any participating switch port cause a topology change to occur.
RSTP reduces the number of topology changes and improves overall stability within the network by
generating TCNs only when nonedge ports transition to the forwarding state. Nonedge ports are
typically defined as ports that interconnect switches. Edge ports are typically defined as ports that
connect a switch to end stations. RSTP also provides improved network stability because it does not
generate a TCN when a port transitions to the discarding state. With RSTP, TCNs are not generated when
a port is administratively disabled, excluded from the active topology through configuration, or
dynamically excluded from forwarding and learning. When a TCN is necessary and is generated, the
initiating device floods all designated ports as well as the root port. Unlike traditional STP, neighboring
switches that are not in the path of the initiator to the root bridge do not need to wait for this
information from the root bridge. As the changes propagate throughout the network, the switches flush
the majority of the MAC addresses located in their bridge tables. The individual switches do not,
however, flush MAC addresses learned from their locally-configured edge ports or MAC addresses
learned from the port through which they received the TCN.

Juniper Business Use Only


Interoperability Considerations

Switches configured for STP and RSTP will interoperate with one another. However, you should keep a
few basic considerations in mind. If a switch supports only STP and interconnects with a switch running
RSTP, it will discard the RST BPDUs. The RSTP-capable switch, upon receiving STP BPDUs, reverts to STP
mode, thus allowing interoperability between the two devices.

Juniper Business Use Only

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy