note 17

 

1, disabled --- 1, when the interface is closed; 2, the interface disables spanning tree protocol

2. Blocking --- the first state entered by the spanning tree protocol after the interface is activated. In this state, the interface can only listen to BPDUs, cannot forward BPDUs and service frames, and cannot learn MAC addresses

At the beginning, all interfaces enter the blocking state, and no configuration BPDu is sent. In this way, all interfaces cannot listen to BPDu, and then enter the next stage after 20S aging time.

3. Listen --- During the STP role election stage, BPDUs can be sent and received in this state, but business data cannot be forwarded, and MAC addresses cannot be learned.

In this state, service data is not allowed to be forwarded, mainly to prevent temporary loops that may occur when roles are not fully selected, causing service traffic to enter the loop. The listening state needs to stay for a forwarding delay time, which is 15S by default, and this time is used for election. Even if the role election ends early, it needs to wait until the time is up before entering the next state. After the role election is completed, not all interfaces enter the next learning state, but the root port and designated ports can continue, and non-designated ports will return to the blocked state.

4. Learning --- This state needs to stay for 15S, only learning the MAC address in the business data frame, but not forwarding.

Its purpose is to reduce unknown unicast flood operations when the MAC address is not recorded.

5. Forwarding --- can accept and send BPDU and business data normally

802.1D convergence time---30S or 5oS

First convergence: 50S

Structural mutation:

  1. Root bridge failure: 50s
  2. Direct link failure: 30s

3. Non-direct connection failure: 50S

STP configuration

[sw1]stp mode ?---Modify the protocol version selected by STP---Huawei equipment selects the MSTP protocol by default

mstp Multiple Spanning Tree Protocol (IMSTP) mode

rstp Rapid Spanning Tree Protocol (RSTP) mode

stp Spanning Tree Protocol (STP) mode

[sw1]stp mode stp

[sw1]stp enable ---Huawei equipment activates STP by default, so this step can be omitted

[sw6]display stp---View STP information

[sw3]display stp brief --- View the role and status information of the STP interface

[sw5]stp priority 28672---The command to modify the priority must be modified in multiples of 4096 Note: The election of the STP root bridge is preemptive mode

[sw6-GigabitEtherne to/0/1]stp port priority ?---The command to modify the interface priority must be modified in multiples of 16

INTEGER<0-240> Port priority, in steps of 16

[sw1]stp root primary---set a switch as the root bridge----in essence, modify the priority in the BID of the device to 0.

[sw2]stp root secondary ---Set a switch as a backup root bridge--in essence, modify the priority in the device's BID to 4096

Defects of 802.1D spanning tree protocol:

  1. slow convergence
  2. low link utilization

PVST---VLAN-based Spanning Tree Protocol---one VLAN, one tree---The problem with PVST is that if there are a large number of VLANs in the switching network, a large number of trees are required, and each tree needs to be maintained by configuring BPDUs A tree structure causes excessive resource usage.

RSTP --- Rapid Spanning Tree --- 802.1W --- There is only one tree in a switching network --- RSTP can be backward compatible with 802.1D, and needs to be implemented according to the rules of 802.1D.

Improvement point 1: Changed the port role

802.1D---root port, designated port, non-designated port

802.1W---root port, designated port, alternate (Alternate) port, backup (Backup)) port

Alternative port --- The main purpose is to be a backup of the root port. Due to learning the configuration sent by other bridges

The port blocked by the BPDU message provides another path from the designated bridge to the root bridge as the backup of the root port. When a root port fails, the optimal replacement port can directly become the root port and directly enter the forwarding state.

Backup Port---The main purpose is to be the backup of the designated port. The port that is blocked due to learning the configuration BPDu packets sent by itself. If the designated port fails, it will replace the designated port immediately and enter the forwarding state directly.

Improvement point 2: Modified the status type of the port

802.1D---disable, block, listen, learn, forward

802.1W --- DISCARDING --- Discarding state --- The interface does not forward traffic nor learn MAC addresses

Learning --- the interface can learn the MAC address, but does not forward business traffic

Forwarding---the interface can learn MAC address and forward business traffic

Improvement point 3: Modify the message content of the configuration BPDU

 

In RSTP, the BPDu used to build and maintain the tree structure is called RST BPDu, and the type of BPDu is represented by ox02, which is equivalent to the configuration BPDU in 802.1D.

P/A mechanism---speed up convergence

RSTP uses the P/A mechanism to ensure that a designated port can quickly enter the forwarding state from the discarding state, thereby accelerating the convergence of the spanning tree. In the P/A mechanism, there is a "synchronous state", which actually blocks all other interfaces to prevent temporary loops.

Improvement point 4: processing of configuration BPDU

1. When the topology structure is stable, the sending method of the configuration BPDU changes

802.1D---Only the root bridge actively sends configuration BPDU every 2S, other non-root bridges only passively forward

802.1W---All non-root bridges can also actively send the configuration BPDU of the root bridge every 2S.

2. Shorter BPDU timeout

802.1D --- maximum aging time --- 20S

802.1W --- An interface does not receive a BPDU within the timeout period (three cycles --- 6S), it is considered that the neighbor negotiation failed

Improvement point 5: fast convergence mechanism

  1. Quick switch between root port and designated port --- use alternative port and backup port

2. Set the edge interface

In 802.1W, we can manually configure the interface of the switch to connect to the terminal as an edge interface. These interfaces will not participate in the election of STP spanning tree roles when they are used. Afterwards, these interfaces will not trigger structural topology changes if they are disconnected.

[sw5-GigabitEthernet0/0/1]stp edged-port enable ---Edge interface configuration command

[sw5-GigabitEtherneto f0/1]stp bpdu-filter enable ---Enable the filter function of BPDU, and use it together with the edge interface.

There is a protection mechanism for the edge interface, that is, when this interface receives BPDu sent by other switching devices, it will be converted into a common interface.

3. P/A mechanism

Improvement point 6: Improvement of topology change mechanism

802.1D: Topology changes need to be reported to the root bridge through the TCN level by level. After that, the root bridge will issue TC level by level to configure the entire switching network, and change the aging time of the MAC address table from 30OS to 15S.

802.1W: The topology change device directly sends the TC flag configuration BPDU, and then passes it to all devices, and all devices will directly clear the MAC address table after receiving it.

MSTP---Multiple Spanning Tree Protocol---802.1S

In MSTP, we introduced the concept of an instance instance - it can be understood as a collection of one or more VLANs

In order to distinguish and calibrate different instances, we designed instance-ld --- 12-bit binary composition --- its value range is 0-4094 --- Huawei equipment will generate instance 0 by default, and all VLANs start with Both belong to instance 0 by default.

In the BID, the first 2 bytes are the priority, and only the first 4 bytes are actually used for this priority. The latter 12 bits are called the extended system ID, and the function of this extended system ID is to carry the instance ID. It is used to distinguish different trees to send BPDUs. ----One instance, one tree.

Region---domain---similar to the area in OSPF. When a switching network is large in scale, it can be divided into multiple MST domains. Of course, if a switching network is small in scale, only one MST domain is divided. also can.

1. Have the same domain name---Region name

2. Must have the same revision level ---- revision level

3. The same mapping relationship between VLANI and instance

MSTP configuration

 

There are 10 VLANs in the switching network, among which VLAN1-5 will take the link of the spanning tree with SW1 as the root, and van 6-10 will take the link of the tree with SW2 as the root. And the two devices back up each other.

1. Create a VLAN

2. Configure the trunk road

3. Change the mode of the spanning tree

[sw1]stp mode mstp ---You don't need to change it, because Huawei devices use MSTP protocol by default

4. Configure the MST domain

[sw1]display stp region-configurat ion --- View STP region configuration information

Reglon name :4c1fcc3210c3 ---The switch will exist in a domain named after the MAC address corresponding to its own SVI interface by default

[sw1]stp region-configuration --- Enter domain view

[sw1-mst-region]

[sw1-mst-region]region-name aa ---Define the domain name

[sw1-mst-region]revision-level 1---modify the revision level

[sw1-mst-region]instance 1 vlan 1 to 5---Configure the correspondence between instances and VLANs

[sw1-mst-region]activeregion-configuration ----Note, this configuration must be done, its role is to activate the domain configuration, if this command is not executed, all configurations will not take effect.

5. Election interference

[sw1]stp instance 1 root primary --- set the device as the root bridge of instance 1

[sw2]stp instance 1 root secondary --- set the device as the backup root bridge of instance 1

Guess you like

Origin blog.csdn.net/m0_56763594/article/details/126150646