Professional Documents
Culture Documents
What Is STP
What Is STP
Issue 01
Date 2020-11-18
and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd.
All other trademarks and trade names mentioned in this document are the property of their respective
holders.
Notice
The purchased products, services and features are stipulated by the contract made between Huawei and
the customer. All or part of the products, services and features described in this document may not be
within the purchase scope or the usage scope. Unless otherwise specified in the contract, all statements,
information, and recommendations in this document are provided "AS IS" without warranties, guarantees
or representations of any kind, either express or implied.
The information in this document is subject to change without notice. Every effort has been made in the
preparation of this document to ensure accuracy of the contents, but all statements, information, and
recommendations in this document do not constitute a warranty of any kind, express or implied.
Website: https://www.huawei.com
Email: support@huawei.com
Contents
1 Introduction.............................................................................................................................. 1
2 Understanding STP.................................................................................................................. 2
3 Configuring STP....................................................................................................................... 5
3.1 Configuring Basic STP............................................................................................................................................................ 5
3.2 Other STP Configurations..................................................................................................................................................... 6
3.3 Example for Configuring Basic STP Functions............................................................................................................... 6
4 Related Information................................................................................................................9
1 Introduction
To prevent loops from causing broadcast storms and making the MAC address
table unstable, the Spanning Tree Protocol (STP) runs switches when redundant
links are used on the network.
STP is a basic feature of datacom products including switches, routers, and WLAN
products. This chapter describes STP configurations on Huawei CloudEngine series
switches.
2 Understanding STP
STP, defined by IEEE 802.1D, prevents loops on a local area network (LAN).
Switching devices running STP exchange information with one another to discover
loops on the network, and then block certain redundant links to eliminate loops. If
an active link fails, STP activates a running standby link with the highest priority
to ensure network connectivity.
As the scale of LANs continues to grow, STP has become an increasingly important
LAN protocol.
In addition, a switching device has a bridge ID (BID) and a port on the switching
device has a port ID (PID). A PID is composed of a port priority and a port number.
A BID is composed of a bridge priority and a bridge MAC address. On an STP
network, the device with the smallest BID acts as the root bridge.
After the root bridge, root port, and designated ports are selected successfully, a
tree topology is set up on the entire network. When the topology is stable, only
the root port and designated ports forward traffic. The other ports are in Blocking
state; they only receive STP BPDUs and do not forward user traffic.
BPDU Format
A BPDU carries the BID, root path cost, and PID. A BPDU is encapsulated in an
Ethernet frame. Its destination MAC address is a multicast MAC address, 01-80-
C2-00-00-00. The Length or Type field specifies the MAC data length, and is
followed by the LLC header and BPDU header. Figure 2 shows the format of an
Ethernet frame.
Each bridge actively sends configuration BPDUs during initialization. After the
network topology becomes stable, only the root bridge proactively sends
configuration BPDUs. Other bridges send configuration BPDUs only after receiving
configuration BPDUs from upstream devices. A configuration BPDU is at least 35
bytes long and includes the parameters such as the BID, root path cost, and PID. A
bridge processes a received configuration BPDU only if either the sender BID or
PID is different from that on the local bridge receive port. If both fields are the
same as those on the receive port, the bridge discards the configuration BPDU.
Therefore, the bridge does not need to process BPDUs with the same information
as the local port.
STP Implementation
STP implementation is as follows:
1. During network initialization, every device considers itself the root bridge and
sets the root ID to its own BID. Then devices exchange configuration BPDUs
and compare their root IDs to find the device with the smallest BID, which
becomes the root bridge. All the ports on the root bridge are in Forwarding
state.
2. A non-bridge device selects the port that receives the optimal configuration
BPDU as the root port. The root port is in the Forwarding state.
3. The device generates a configuration BPDU for each port based on the
configuration BPDU on the root port and path cost of the root port. Then the
device compares the calculated configuration BPDU with the configuration
BPDU received on the port.
– If the calculated configuration BPDU is superior, the port is selected as
the designated port and periodically sends the calculated configuration
BPDU.
– If the port's own configuration BPDU is superior, the configuration BPDU
on the port is not updated and the port is blocked. Then, the port only
receives BPDUs, and does not forward data or send BPDUs.
3 Configuring STP
NOTE
For details about the configuration and commands in this section, see "Ethernet Switching
Configuration Guide" in the CloudEngine 8800, 7800, 6800, and 5800 Series Switches
V200R005C10 Product Documentation.
----End
1. Configure the STP mode on SwitchA and configure SwitchA as the root bridge.
In addition, set the path cost calculation method to the Huawei proprietary
method.
<SwitchA> system-view
[~SwitchA] stp mode stp
[*SwitchA] stp root primary
[*SwitchA] stp pathcost-standard legacy
[*SwitchA] commit
2. Configure the STP mode on SwitchB and configure SwitchB as the secondary
root bridge. In addition, set the path cost calculation method to the Huawei
proprietary method and disable STP on the port connecting to Server2.
<SwitchB> system-view
[~SwitchB] stp mode stp
[*SwitchB] stp root secondary
[*SwitchB] stp pathcost-standard legacy
[*SwitchB] interface 10ge 1/0/2
[*SwitchB-10GE1/0/2] stp disable
[*SwitchB-10GE1/0/2] commit
3. Configure the STP mode on SwitchC and set the path cost calculation method
to the Huawei proprietary method. In addition, set the path cost of 10GE1/0/1
to 20000, and disable STP on the port connecting to Server1.
<SwitchC> system-view
[~SwitchC] stp mode stp
[*SwitchC] stp pathcost-standard legacy
[*SwitchC] interface 10ge 1/0/1
[*SwitchC-10GE1/0/1] stp cost 20000
[*SwitchC-10GE1/0/1] quit
[*SwitchC] interface 10ge 1/0/2
[*SwitchC-10GE1/0/2] stp disable
[*SwitchC-10GE1/0/2] commit
4. Configure the STP mode on SwitchD and set the path cost calculation method
to the Huawei proprietary method.
<SwitchD> system-view
[~SwitchD] stp mode stp
[*SwitchD] stp pathcost-standard legacy
[*SwitchD] commit
5. Enable STP on all devices on the ring network. The following configuration
uses SwitchA as an example. Perform the same operations on SwitchB,
SwitchC, and SwitchD.
[~SwitchA] stp enable
[*SwitchA] commit
6. Verify the configuration. After the network becomes stable, run the display
stp brief command on SwitchA to check configurations such as the port role
and status. SwitchA is used as an example.
[~SwitchA] display stp brief
MSTID Port Role STP State Protection Cost Edged
0 10GE1/0/1 DESI forwarding none 2 disable
0 10GE1/0/2 DESI forwarding none 2 disable
4 Related Information