Documente Academic
Documente Profesional
Documente Cultură
1 Protocol operation
1
2 1 PROTOCOL OPERATION
3. Assuming that the cost of traversing any network segment is 1, 5. This diagram illustrates all port states as computed by the
the least cost path from bridge 4 to the root bridge goes through spanning tree algorithm. Any active port that is not a root port or
network segment c. Therefore, the root port for bridge 4 is the a designated port is a blocked port.
one on network segment c.
Least cost path from each network segment. The bridges case, a single bridge may have multiple candidates for its
on a network segment collectively determine which root port. In these cases, candidates for the root port have
bridge has the least-cost path from the network segment already received BPDUs oering equally-low (i.e. the
to the root. The port connecting this bridge to the network best) root path costs and equally-low (i.e. the best)
segment is then the designated port (DP) for the segment. bridge IDs, and the nal tie breaker goes to the port that
Disable all other root paths. Any active port that is not received[6]the lowest (i.e. the best) port priority ID, or
a root port or a designated port is a blocked port (BP). port ID.
Modications in case of ties. The above rules over- In summary, the sequence of events to determine the best
simplify the situation slightly, because it is possible that received BPDU (which is the best path to the root) is
there are ties, for example, the root bridge may have two
or more ports on the same LAN segment, two or more Lowest root bridge ID - Determines the root bridge
ports on a single bridge are attached to least-cost paths
to the root or two or more bridges on the same network Lowest cost to the root bridge - Favors the upstream
segment have equal least-cost paths to the root. To break switch with the least cost to root
such ties:
Lowest sender bridge ID - Serves as a tie breaker if
Breaking ties for root ports. When multiple paths from a multiple upstream switches have equal cost to root
bridge are least-cost paths, the chosen path uses the neigh-
bor bridge with the lower bridge ID. The root port is thus Lowest sender port ID - Serves as a tie breaker if
the one connecting to the bridge with the lowest bridge a switch has multiple (non-Etherchannel) links to a
ID. For example, in gure 3, if switch 4 was connected to single upstream switch, where:
network segment d instead of segment f, there would be
two paths of length 2 to the root, one path going through Bridge ID = priority (4 bits) + locally assigned
bridge 24 and the other through bridge 92. Because there system ID extension (12 bits) + ID [MAC ad-
are two least cost paths, the lower bridge ID (24) would dress] (48 bits); the default bridge priority is
be used as the tie-breaker in choosing which path to use. 32768, and
Breaking ties for designated ports. When the root bridge Port ID = priority (4 bits) + ID (Interface num-
has more than one port on a single LAN segment, the ber) (12 bits); the default port priority is 128.
bridge ID is eectively tied, as are all root path costs (all
equal zero). The designated port then becomes the port
on that LAN segment with the lowest port ID. Its put into 1.1 Data rate and STP path cost
Forwarding mode while all other ports on the root bridge
on that same LAN segment become non-designated ports The access speeds of the links determine the path cost
and are put into blocking mode.[5] Not all bridge/switch that STP/RSTP assumes. The STP path cost default
manufacturers follow this rule, instead making all root was originally calculated by the formula 1 Gigabit / sec-
bridge ports designated ports, and putting them all in for- ond/bandwidth. When faster speeds became available the
warding mode. A nal tie-breaker is required as noted in default values were adjusted as otherwise speeds above
the section The nal tie-breaker. 1 Gbit/s would have been indistinguishable by STP. Its
When more than one bridge on a segment leads to a least- successor RSTP uses a similar formula with a larger nu-
cost path to the root, the bridge with the lower bridge ID is merator: 20 Terabit / second/bandwidth. These formulas
used to forward messages to the root. The port attaching lead to the sample values in the table below:[7]:154
that bridge to the network segment is the designated port
for the segment. In gure 4, there are two least cost paths
from network segment d to the root, one going through 1.2 Bridge Protocol Data Units
bridge 24 and the other through bridge 92. The lower
bridge ID is 24, so the tie breaker dictates that the desig- Main article: Bridge Protocol Data Unit
nated port is the port through which network segment d
is connected to bridge 24. If bridge IDs were equal, then
The above rules describe one way of determining what
the bridge with the lowest MAC address would have the
spanning tree will be computed by the algorithm, but
designated port. In either case, the loser sets the port as
the rules as written require knowledge of the entire net-
being blocked.
work. The bridges have to determine the root bridge
The nal tie-breaker. In some cases, there may still be and compute the port roles (root, designated, or blocked)
a tie, as when the root bridge has multiple active ports with only the information that they have. To ensure
on the same LAN segment (see above, Breaking ties that each bridge has enough information, the bridges use
for designated ports) with equally low root path costs special data frames called Bridge Protocol Data Units
and bridge IDs, or, in other cases, multiple bridges are (BPDUs) to exchange information about bridge IDs and
connected by multiple cables and multiple ports. In each root path costs.
4 2 EVOLUTIONS AND EXTENSIONS
A bridge sends a BPDU frame using the unique MAC Forwarding - A port receiving and sending data,
address of the port itself as a source address, and a des- normal operation. STP still monitors incoming BP-
tination address of the STP multicast address 01:80:C2: DUs that would indicate it should return to the
00:00:00. blocking state to prevent a loop.
There are two types of BPDUs in the original STP Disabled - Not strictly part of STP, a network ad-
specication[7]:63 (the Rapid Spanning Tree (RSTP) ex- ministrator can manually disable a port
tension uses a specic RSTP BPDU):
BPDUs are exchanged regularly (every 2 seconds by 1.3 Bridge Protocol Data Unit elds
default) and enable switches to keep track of network
changes and to start and stop forwarding at ports as re- IEEE 802.1D and IEEE 802.1aq BPDUs have the follow-
quired. ing format:
Although the purpose of a standard is to promote in- Disabled - Not strictly part of STP, a network ad-
terworking of equipment from dierent vendors, dif- ministrator can manually disable a port
ferent implementations of a standard are not guaran-
teed to work, due for example to dierences in de- RSTP switch port states:
fault timer settings. The IEEE encourages vendors to
provide a "Protocol Implementation Conformance State-
ment", declaring which capabilities and options have been Discarding - No user data is sent over the port
[10]
implemented, to help users determine whether dier-
Learning - The port is not forwarding frames yet,
ent implementations will interwork correctly.
but is populating its MAC-address-table
Also, the original Perlman-inspired Spanning Tree Pro-
tocol, called DEC STP, is not a standard and diers from Forwarding - The port is fully operational
the IEEE version in message format as well as timer set-
tings. Some bridges implement both the IEEE and the RSTP operational details:
DEC versions of the Spanning Tree Protocol, but their
interworking can create issues for the network adminis-
trator, as illustrated by the problem discussed in an on- Detection of root switch failure is done in 3 hello
line Cisco document. [11] times, which is 6 seconds if the default hello times
have not been changed.
As discussed in the port role details above, RSTP Networks. There are two restrictions to the compatibility
maintains backup details regarding the discarding of VSTP:
status of ports. This avoids timeouts if the current
forwarding ports were to fail or BPDUs were not re- 1. VSTP supports only 253 dierent spanning-tree
ceived on the root port in a certain interval. topologies. If there are more than 253 VLANs, it
is recommended to congure RSTP in addition to
RSTP will revert to legacy STP on an interface if a VSTP, and VLANs beyond 253 will be handled by
legacy version of an STP BPDU is detected on that RSTP.
port.
2. MVRP does not support VSTP. If this protocol is in
use, VLAN membership for trunk interfaces must
2.2 Per-VLAN Spanning Tree and Per- be statically congured .
VLAN Spanning Tree Plus
By default, VSTP uses the RSTP protocol as its core
In Ethernet switched environments where multiple spanning-tree protocol, but usage of STP can be forced
Virtual LANs exist, it is often desirable to create mul- if the network includes old bridges .
tiple spanning trees so that trac from dierent VLANs
uses dierent links. Cisco's proprietary versions of Span- For more information about conguring VSTP on Ju-
ning Tree Protocol, Per-VLAN Spanning Tree (PVST) niper Networks switches, see the ocial documentation
and Per-VLAN Spanning Tree Plus (PVST+), create a Understanding VSTP.
separate spanning tree for each VLAN. Both PVST and
PVST+ protocols are Cisco proprietary protocols, and
few switches from other vendors support them. They 2.5 Multiple Spanning Tree Protocol
use a dierent multicast address: 01:00:0C:CC:CC:
CD. Some devices from Force10 Networks, Alcatel- The Multiple Spanning Tree Protocol (MSTP), originally
Lucent, Extreme Networks, Avaya, Brocade Communi- dened in IEEE 802.1s and later merged into IEEE
cations Systems and BLADE Network Technologies sup- 802.1Q2005, denes an extension to RSTP to further
port PVST+.[15][16][17] Extreme Networks does so with develop the usefulness of virtual LANs (VLANs). This
two limitations: Lack of support on ports where the Multiple Spanning Tree Protocol congures a separate
VLAN is untagged/native, and also on the VLAN with Spanning Tree for each VLAN group and blocks all but
ID 1. PVST works only with ISL (Ciscos proprietary one of the possible alternate paths within each Spanning
protocol for VLAN encapsulation) due to its embedded Tree.
Spanning Tree ID. This is the default protocol on Cisco If there is only one Virtual LAN (VLAN) in the network,
switches that support ISL. Due to high penetration of the single (traditional) STP works appropriately. If the net-
IEEE 802.1Q VLAN trunking standard and PVSTs de- work contains more than one VLAN, the logical network
pendence on ISL, Cisco dened an additional PVST+ congured by single STP would work, but it is possible to
standard that is compatible with 802.1Q encapsulation. make better use of the alternate paths available by using
This became the default protocol for Cisco switches when an alternate spanning tree for dierent VLANs or groups
Cisco discontinued and removed ISL support from its of VLANs.
switches. PVST+ can tunnel across an MSTP Region.[18]
MSTP allows formation of MST regions that can run mul-
tiple MST instances (MSTI). Multiple regions and other
STP bridges are interconnected using one single common
2.3 Rapid Per-VLAN Spanning Tree spanning tree (CST).
This is Ciscos proprietary version of Rapid Spanning MSTP is similar to Cisco Systems' Multiple Instances
Tree Protocol. It creates a spanning tree for each VLAN, Spanning Tree Protocol (MISTP), and is an evolution of
just like PVST. Cisco refers to this as Rapid Per-VLAN the Spanning Tree Protocol and the Rapid Spanning Tree
Spanning Tree (RPVST). Protocol. It was introduced in IEEE 802.1s as an amend-
ment to 802.1Q, 1998 edition. Standard IEEE 802.1Q-
2005 now includes MSTP.
2.4 VLAN Spanning Tree Protocol Unlike some proprietary per-VLAN spanning tree
implementations,[19] MSTP includes all of its spanning
In Juniper Networks environment, if compatibility to tree information in a single BPDU format. Not only does
Ciscos proprietary PVST protocol is required, VLAN this reduce the number of BPDUs required on a LAN to
Spanning Tree Protocol (VSTP) can be congured. communicate spanning tree information for each VLAN,
VSTP maintains a separate spanning-tree instance for but it also ensures backward compatibility with RSTP
each VLAN congured in the switch. The VSTP protocol (and in eect, classic STP too). MSTP does this by en-
is only supported by the EX and MX Series from Juniper coding additional region information after the standard
7
[4] Alternatively the network administrator can congure the [14] IEEE 802.1D-2004, IEEE, 2004-06-04, Since the original
spanning tree a root primary/secondary. When congur- Spanning Tree Protocol (STP) has been removed from the
ing the root primary and root secondary the switch will 2004 revision of IEEE Std 802.1D, an implementation of
automatically change the priority accordingly, 24576 and RSTP is required for any claim of conformance for an im-
28672 respectively with the default conguration. plementation of IEEE Std 802.1Q-2003 that refers to the
current revision of IEEE Std 802.1D
[2] Perlman, Radia (2000). Interconnections, Second Edition. [18] Bridging Between IEEE 802.1Q VLANs. Cisco Sys-
USA: Addison-Wesley. ISBN 0-201-63448-1. tems. Retrieved 2011-01-25.
[5] 802.1d-1998 section 8.3.1: The Designated Port for each [21] Peter Ashwood-Smith (24 Feb 2011). Shortest Path
LAN is the Bridge Port for which the value of the Root Bridging IEEE 802.1aq Overview (PDF). Huawei. Re-
Path Cost is the lowest: if two or more Ports have the same trieved 11 May 2012.
value of Root Path Cost, then rst the Bridge Identier
of their Bridges, and their Port Identiers are used as tie [22] Jim Duy (11 May 2012). Largest Illinois healthcare
breakers. system uproots Cisco to build $40M private cloud. PC
Advisor. Retrieved 11 May 2012. Shortest Path Bridging
[6] 802.1d-1998 section 8.3.2 b) A Bridge that receives a will replace Spanning Tree in the Ethernet fabric.
Conguration BPDU on what it decides is its Root Port
[23] IEEE Approves New IEEE 802.1aq Shortest Path Bridg-
conveying better information (i.e. highest priority Root
ing Standard. Tech Power Up. 7 May 2012. Retrieved
Identier, lowest Root Path Cost, highest priority trans-
11 May 2012.
mitting Bridge and Port), passes that information on to all
the LANs for which it believes itself to be the Designated
Bridge.
6 External links
[7] 802.1D IEEE Standard for Local and Metropolitan
Area Networks. Media Access Control (MAC) Bridges
Cisco home page for the Spanning-Tree protocol
(PDF). IEEE. 2004. Retrieved 19 April 2012.
family (discusses CST, MISTP, PVST, PVST+,
[8] LAN/MAN Standards Committee of the IEEE Computer RSTP, STP)
Society, ed. (1990). ANSI/IEEE Std 802.1D. IEEE.
Educational explanation of STP www.cisco.com
[9] LAN/MAN Standards Committee of the IEEE Computer
STP article in the Wireshark wiki Includes a sample
Society, ed. (1998). ANSI/IEEE Std 802.1D, 1998 Edi-
PCAP-le of captured STP trac.
tion, Part 3: Media Access Control (MAC) Bridges. IEEE.
Perlman, Radia. Algorhyme. University of Cal-
[10] LAN/MAN Standards Committee of the IEEE Computer
ifornia at Berkeley. Archived from the original on
Society, ed. (2004). ANSI/IEEE Std 802.1D - 2004: IEEE
Standard for Local and Metropolitan Area Networks: Me-
2011-07-19. Retrieved 2011-09-01.
dia Access Control (MAC) Bridges. IEEE. IEEE Standards
[11] Understanding Issues Related to Inter-VLAN Bridging ANSI/IEEE 802.1D-2004 standard, section
(PDF). Cisco Systems, Inc. 11072. 17 discusses RSTP (Regular STP is no longer
a part of this standard. This is pointed out in
[12] Waldemar Wojdak (March 2003). Rapid Spanning Tree
Protocol: A new solution from an old technology. Com-
section 8.)
pactPCI Systems. Retrieved 2008-08-04. ANSI/IEEE 802.1Q-2005 standard, section
13 discusses MSTP
[13] Understanding Rapid Spanning Tree Protocol (802.1w)".
Retrieved 2008-11-27. RFCs
9
7.2 Images
File:Commons-logo.svg Source: https://upload.wikimedia.org/wikipedia/en/4/4a/Commons-logo.svg License: PD Contributors: ? Origi-
nal artist: ?
File:Spanning_tree_protocol_at_work_1.svg Source: https://upload.wikimedia.org/wikipedia/commons/d/d7/Spanning_tree_
protocol_at_work_1.svg License: CC BY 3.0 Contributors: self-made, based on en:User:Ngriffeth's en:Image:STP1.jpg Original artist:
GhosT
File:Spanning_tree_protocol_at_work_2.svg Source: https://upload.wikimedia.org/wikipedia/commons/a/a9/Spanning_tree_
protocol_at_work_2.svg License: CC BY 3.0 Contributors: self-made, based on en:User:Ngriffeth's en:Image:STP2.jpg Original artist:
GhosT
File:Spanning_tree_protocol_at_work_3.svg Source: https://upload.wikimedia.org/wikipedia/commons/7/74/Spanning_tree_
protocol_at_work_3.svg License: CC BY 3.0 Contributors: self-made, based on en:User:Ngriffeth's en:Image:STP3.jpg Original artist:
GhosT
File:Spanning_tree_protocol_at_work_4.svg Source: https://upload.wikimedia.org/wikipedia/commons/7/77/Spanning_tree_
protocol_at_work_4.svg License: CC BY 3.0 Contributors: self-made, based on en:User:Ngriffeth's en:Image:STP4.jpg Original artist:
GhosT
File:Spanning_tree_protocol_at_work_5.svg Source: https://upload.wikimedia.org/wikipedia/commons/b/bb/Spanning_tree_
protocol_at_work_5.svg License: CC BY 3.0 Contributors: self-made, based on en:User:Ngriffeth's en:Image:STP5.jpg Original artist:
GhosT
File:Spanning_tree_protocol_at_work_6.svg Source: https://upload.wikimedia.org/wikipedia/commons/2/21/Spanning_tree_
protocol_at_work_6.svg License: CC BY 3.0 Contributors: self-made, based on en:User:Ngriffeth's en:Image:STP5.jpg Original artist:
GhosT