Network novices must learn, Huawei switch network STP spanning tree protocol

[Warm reminder] Need information or need to enter the group to communicate to the bottom

Introduction The
spanning tree protocol, like other protocols, is constantly updated with the continuous development of the network. IEEE802.1D-1998 STP (Spanning Tree Protocol) was first widely used, and then IEEE 802.1w RSTP (Rapid Spanning Tree Protocol) and IEEE 802.1s MSTP (Rapid Spanning Tree Protocol) were produced based on it. Multiple Spanning Tree Protocol, multiple spanning tree protocol)

Comparison of the characteristics of three spanning tree protocols:

PLEASE:

  1. A loop-free tree is formed to resolve broadcast storms and achieve redundant backup.

  2. The convergence rate is slower.

  3. There is no need to distinguish between users or business traffic, all VLANs share a spanning tree.

RSTP:

  1. A loop-free tree is formed to resolve broadcast storms and achieve redundant backup.

  2. Convergence is fast.

  3. There is no need to distinguish between users or business traffic, all VLANs share a spanning tree.

MSTP:

  1. Form multiple trees without loops to solve broadcast storms and achieve redundant backup.

  2. Convergence is fast.

  3. Multiple spanning trees implement load balancing among VLANs, and traffic of different VLANs is forwarded according to different paths.

STP working principle

Insert picture description here

1. Election of a root bridge.

Insert picture description here

First, according to the priority and MAC address, each switch selects a switch with the smallest bridge ID as the root of the entire network. The bridge ID consists of a 16-bit bridge priority (Bridge Priority) and a 48-bit MAC address. In the STP network, the bridge priority is configurable, the value range is 0~65535, and the default value is 32768. The device with the highest priority (the smaller the value, the more preferred) will be elected as the root bridge. If the priorities are the same, the MAC addresses will be compared, and the smaller the MAC address, the higher the priority.

2. Election of Root Port

Insert picture description here

When a non-root switch elects a root port, it is based on the port's root path cost, peer BID (Bridge ID), peer PID (Port ID), and local PID. Each port running an STP switch has a port ID, which is composed of port priority and port number. The port priority value ranges from 0 to 240, and the step size is 16, that is, the value must be an integer multiple of 16. By default, the port priority is 128. Port ID (Port ID) can be used to determine the port role.

Each non-root bridge must elect a root port. The root port is the port closest to the root bridge. The closest measurement standard is determined by the path cost, that is, the port with the smallest path cost is the root port.

The root port refers to the local port through the path with the least total cost from a non-switch to the root switch. This minimum total cost is called the root path cost of the switch (Root Path Cost). By default, the cost of a port is related to the bandwidth of the port. The higher the bandwidth, the lower the cost.

If there are two or more ports with the same cumulative path cost calculated, then compare the port with the smallest switch BID of the upstream switch connected to the port as the root port.

If the switch BIDs of the upstream switches connected to the ports are the same, compare the Port Identifiers of the upstream ports connected to the ports, the smaller the priority.

BPDU message processing process
BPDU message classification

Configure BPDU messages: Divided into 3 types according to the Flags bit

· The first type of configuration BPDU message: The configuration BPDU message with the TCA and TC bits of Flags set to 0

· The second type of configuration BPDU message: The configuration BPDU message with both the TCA and TC bits of Flags set to 1.

· The third type of configuration BPDU message: the configuration BPDU message with the TCA position of Flags being 0 and the TC position being 1.

TCN BPDU message: BPDU message with BPDU Type 0x80, called TCN BPDU message

BPDU message processing flow

Insert picture description here

BPDU message format

The first type of configuration BPDU message: the configuration BPDU message with the TCA and TC bits of Flags set to 0

This message is used to negotiate and maintain the STP state. The specific message format is as follows:

Insert picture description here

The second type of configuration BPDU message: the configuration BPDU message in which the TCA and TC bits of Flags are both set to 1.

This message is used to notify downstream devices to stop sending TCN BPDU messages. The specific message format is as follows:

Insert picture description here

The second type of configuration BPDU message: the configuration BPDU message with the TCA position of Flags being 0 and the TC position being 1.

This message is used to notify downstream devices to delete MAC address entries. The specific message format is as follows:

Insert picture description here

TCN BPDU message: A BPDU message with a BPDU Type of 0x80, called a TCN BPDU message, is used to notify upstream devices of network topology changes. The specific message format is as follows:

Insert picture description here

Configuration example

Insert picture description here

Configuration ideas

Use the following ideas to configure STP:

  1. The configuration mode is STP mode.

  2. Configure SwitchA as the root bridge and SwitchB as the backup root bridge.

  3. Use the default path cost uniformly. The default path cost calculation standard of Huawei switches uses the standard dot1t. The default path cost of a GE interface is 20000, and the default path cost of an Ethernet interface is 200000.

Note: In the eNSP simulator, the path cost of STP is 1 by default.

  1. Disable the STP protocol on GE0/0/3 of SwitchC and SwitchD.

  2. SwitchA, SwitchB, SwitchC, and SwitchD enable the STP protocol.

In order to better help you learn and understand network engineers, and other related content, I deliberately organize all the materials systematically, and share them here for free. Necessary materials for network workers, including:
Huawei Certification Mind Map (Superfine); Huawei Certification Essential Knowledge Documents (pdf); Collection of Essential Net Worker Knowledge Documents; Essential Toolkit for Net Workers; Essential Net Workers Prepare experiment package;
necessary video interview package for net workers. …… I won’t list all the information a bit, just write here first, if you have any questions, please leave a message, private message exchange and discussion~
add click here to get the information

Guess you like

Origin blog.csdn.net/ZYJY2020/article/details/113518338