2022-08-14 Advanced Network Engineer (Twenty-Six) MSTP-Network Level, Port Role, Port Status, Topology Calculation

Introduction to MSTP

RSTP is improved on STP and achieves rapid network topology convergence. However, when RSTP/STP is run in a VLAN-divided network,all VLANs in the LAN share a spanning tree. The blocked link will not carry any traffic, and data cannot be transferred between VLANs. Traffic load balancing results in low link bandwidth utilization and device resource utilization.

In order to make up for the shortcomings of RSTP/STP, the 802.1S standard released by IEEE in 2002 defined MSTP (Multiple Spanning Tree Protocol, Multiple Spanning Tree Protocol)< a i=2>. MSTP is compatible with STP and RSTP. By establishing multiple loop-free trees, it can solve broadcast storms and achieve redundant backup.

MSTP can mapone or moreVLANs to an Instance (instance), and thenbased on Instance calculates the spanning tree, and VLANs mapped to the same Instance share the same spanning tree.

Related commands

Configure spanning tree working mode as mstp

[SW1]stp mode mstp

MSTP network layer

MSTP divides a switching network into multiple domains, and multiple spanning trees are formed in each domain. The spanning trees are independent of each other.

MST Region(MST域)

A LAN can have multiple MST domains, and each MST domain is physically connected directly or indirectly. Users can use MSTP configuration commands to divide multiple switching devices into the same MST region.

An MSTP network contains one or more MST regions, and each MST region contains one or more multiple spanning tree instances.

Related commands

Enter the MST domain view

[SW1]stp region-configuration

Configure the domain name of the MST domain (by default, the MST domain name is equal to the bridge MAC address of the switching device). Devices in the same MST domain must be configured with the same domain name.

[SW1-mst-region]region-name ?
  STRING<1-32>  A maximum of 32 characters can be entered

MSTI (Multiple Spanning Tree Instance, multiple spanning tree instances)

Multiple spanning trees can be generated in an MST domain, and each spanning tree is called an MSTI. MSTI uses Instance ID identification, and the value of Huawei equipment is 0~4094. Instance0 exists by default, and by default, all VLANs on Huawei switches are mapped to Instance0.

VLAN mapping table

Describes the mapping relationship between VLAN and MSTI. Each VLAN can only correspond to one MSTI, that is, data of the same VLAN can only be transmitted in one MSTI, and one MSTI may correspond to multiple VLANs.

Related commands

Configure the mapping relationship between multiple spanning tree instances and VLANs (by default, all VLANs are mapped to CIST, that is, instance 0)

[SW1-mst-region]instance 1 vlan 1 to 10

Activate the configuration of the MST region

[SW1-mst-region]active region-configuration 

Configure the revision level of the MST region (the MSTP revision level of each manufacturer's equipment generally defaults to 0. If a certain manufacturer's equipment is not 0, in order to maintain calculations in the MST region, when deploying MSTP, you need to modify the MSTP revision level of each device to consistent)

[SW1-mst-region]revision-level ?
  INTEGER<0-65535>  Revision level

CST (Common Spanning Tree, public spanning tree)

isconnectedto allMST domains in the switching network A spanning tree.

IST (Internal Spanning Tree, internal spanning tree)

is a spanning tree automatically calculated in each MST domain. All devices in the MST domain are connected. IST is aspecial MSTI, and the MSTI'sInstance ID is 0.

 

CIST (Common and Internal Spanning Tree, public and internal spanning tree)

Generated through spanning tree protocol calculation,a single spanning tree that connects all switching devices in a switching network.

SST (Single Spanning Tree, single spanning tree)

In the MST domain, the switching device running the spanning tree protocol belongs to only one spanning tree instance, including the case where there is only one switching device.

CIST Root

It is the root bridge of CIST.

Regional Root

IST domain root

Except for the MST region where the main root is located, the switching device in the IST spanning treeis closest to the main root.

MSTI domain root

Root bridge for multiple spanning tree instances.

Master Bridge

It is the switching device closest to the general root in the domain. If the general root is in the MST domain, the general root is the main bridge of the domain. Therefore, the main bridge includes the total root and the IST regional root.

MSTP port role

All port roles defined in MSTP include: root port, designated port, Alternate port, Backup port, Master port, domain edge port and edge port.

Among them, the definitions of root port, designated port, Alternate port, Backup port, and edge port are the same as RSTP. Master port and domain edge port are new port roles in MSTP.

Domain edge port

The domain edge port refers to the port located at the edge of the MST domain and connected to other MST domains.

Master port

Master port is the domain edge port connecting MST region and the main root.

The role of Master port onCIST isRoot Port, the role of on other instances is Master port.

MSTP port status

The port status defined by MSTP is the same as that defined in the RSTP protocol

Forwarding state: The port forwards user traffic, learns MAC addresses, and receives/sends BPDU messages.

Learning state: Transitional state, the port receives/sends BPDU messages, does not forward user traffic but learns MAC addresses.

Discarding state: The port only receives BPDU packets and does not forward user traffic or learn MAC addresses.

MSTP port status

The role of ports in the topology

Forwarding

Including root port, designated port, Master port, domain edge port

Learning

Including root port, designated port, Master port, domain edge port

Discarding

Including root port, designated port, Master port, domain edge port, Alternate port, Backup port

MSTP message

MSTP uses MST BPDU (Multiple Spanning Tree Bridge Protocol Data Unit) as the basis for spanning tree calculation.

Protocol Version Identifier: 1 Byte, protocol version identifier, STP is 0, RSTP is 2, and MSTP is 3.

CIST Flags: 1 Byte, CIST flag field.

CIST Root Identifier: 8 Byte, the total root switching device ID of CIST.

CIST External Path Cost: 4 Byte. The CIST external path cost refers to the cumulative path cost from the MST region to which this switching device belongs to the MST region to which the CIST root switching device belongs. CIST external path cost is calculated based on the link bandwidth.

CIST Regional Root Identifier: 8 Byte, the regional root switching device ID of CIST, that is, the ID of the IST Master. If the general root is in this domain, the regional root switching device ID is the general root switching device ID.

CIST Port Identifier: 2 Byte, the designated port ID of this port in IST.

Message Age: 2 Byte, the lifetime of the BPDU message.

Max Age: 2 Byte, the maximum lifetime of BPDU packets. If it times out, the link to the root switching device is considered to be faulty.

Hello Time: 2 Byte, Hello timer, the default is 2 seconds.

Forward Delay: 2 Byte, Forward Delay timer, the default is 15 seconds.

Version 1 Length: 1 Byte, the length of Version1 BPDU, the value is fixed at 0.

Version 3 Length: 2 Byte, the length of Version3 BPDU.

MST Configuration Identifier: 51 Byte, MST configuration identifier, indicating the label information of the MST domain, including 4 fields.

CIST Internal Root Path Cost: 4 Byte, CIST internal path cost refers to the cumulative path cost from this port to the IST Master switching device. The CIST internal path cost is calculated based on the link bandwidth.

CIST Bridge Identifier: 8 Byte, the designated switching device ID of CIST.

CIST Remaining Hops: 1 Byte, the number of remaining hops of the BPDU message in the CIST.

MSTI Configuration Messages: 16 Byte, MSTI configuration information. The configuration information of each MSTI occupies 16 Bytes. If there are n MSTIs, it occupies n×16 Bytes.

Packet capture and observation

1 Protocol version identifier: 3 (mstp)

2 CIST total root ID: 0.4c:1f:cc:e8:0c:74

3 Cumulative path cost from the local MST domain to the root domain: 20000

4 Local MST region root device ID: 4096.4c:1f:cc:1a:55:04

5 Version3 BPDU length: 80 bytes

6-7 MST domain information

8 The cumulative path cost from this port to the IST Master switching device: 20000

9 The nearest upstream bridge ID from this bridge to the domain root: 32768.4c:1f:cc:87:03:68

10 Number of remaining hops for the packet: 20

11 MSTI 1 configuration information

MSTP topology calculation

CIST and MSTI are calculated based onpriority vector, and these priority vector information are included in MST BPDU. Each switching device exchanges MST BPDUs with each other to generate CIST and MSTI.

The priority vectors involved in CIST calculation are (the priorities decrease from left to right): root switching device ID, external path cost, domain root ID, internal path cost, designated switching device ID, designated port ID, receiving port ID.

The priority vectors involved in MSTI calculation are (the priorities decrease from left to right): domain root ID, internal path cost, designated switching device ID, designated port ID, and receiving port ID.

If the configuration message contained in the BPDU received by the port is better than the configuration message saved on the port, then the configuration message originally saved on the port The messageis replaced by the newly received configuration message. The port also updates the global configuration message saved by the switching device. On the contrary, the newly received BPDU is discarded.

priority vector

Root swap device ID

The root switching device ID is used to select the root switching device in the CIST.

Root switching device ID = Priority(16 bit) + MAC(48 bit).

Among them, Priority is the priority of MSTI 0.

External Root Path Cost (ERPC)

The path cost from the regional root of CIST to the total root.

The external path costs saved on all switching devices in the MST region are the same.

If the CIST root switching device is in the domain, the external path costs saved on all switching devices in the domain are 0.

Domain root ID

The domain root ID is used to select the domain root in MSTI.

Domain root ID = Priority(16 bit) + MAC(48 bit).

Among them, Priority is the priority of MSTI0.

Internal Root Path Cost (IRPC)

The path cost from this bridge to the domain root.

The internal path cost saved by the domain edge port is greater than the internal path cost saved by the non-domain edge port.

Specify the exchange device ID

The designated switching device is the nearest upstream bridge from this bridge to the domain root.

If this bridge is the general root or regional root, the designated switching device is itself.

Specify port ID

Specify the port on the switching device that is connected to the root port on this device.

Port ID = Priority(4 bit) + port number(12 bit).

The port priority must be an integer multiple of 16.

Receive port ID

The port that received the BPDU message.

Port ID = Priority(4 bit) + port number(12 bit).

The port priority must be an integer multiple of 16.
 

CIST calculation

1 After comparing the MST BPDU messages, select a switching device with the highest priority in the entire network as the CIST tree root, that is, the total root.

2 Within each MST domain, MSTP generates IST through calculation.

3 At the same time, MSTP treats each MST domain as a single switching device and generates CST between MST domains through calculation.

MSTI calculation

In the MST region, MSTP generates different spanning tree instances for different VLANs based on the mapping relationship between VLANs and spanning tree instances.

Each MSTI independently calculates its own spanning tree without interfering with each other. The calculation method is basically the same as STP. It can have different roots and different topologies. It sends BPDUs within its own spanning tree. The topology is determined by command configuration.

The spanning tree parameters, roles, and status of each port on different MSTIs can be different.

The root bridge of the spanning tree is automatically determined through calculation. The user can also manually configure the device to be the root bridge or backup root bridge of the specified spanning tree. However, in the same spanning tree, a device cannot serve as both the root bridge and the backup root bridge. There is only one root bridge, and there can be multiple backup root bridges. When the root bridge fails, the backup root bridge with the best priority will become the root bridge.

Related commands

Configure the root bridge and backup root bridge (primary priority is 0, secondary priority is 4096)

[SW1]stp instance 1 root ?
  primary    Primary root switch
  secondary  Secondary root switch

Configure the priority of switching devices in a specified spanning tree instance

[SW1]stp instance 1 priority ?
  INTEGER<0-61440>  Bridge priority, in steps of 4096

Configure the calculation method of path cost value (by default, the calculation method of path cost value is IEEE 802.1T standard)

[SW1]stp pathcost-standard ?
  dot1d-1998  IEEE 802.1D-1998
  dot1t       IEEE 802.1T
  legacy      Legacy

dot1d-1998: The calculation method of the specified path cost value is the IEEE 802.1D-1998 standard method, and the value range is 1~65535.
dot1t: The calculation method of the specified path cost value is the IEEE 802.1T standard method, and the value range is 1~200,000,000.
legacy: The calculation method of the specified path cost value is the Huawei calculation method, and the value range is 1~200,000.

Configure the port path cost of the current port on the specified spanning tree (by default, the path cost of the port on each spanning tree is the path cost corresponding to the port rate)

[SW1-GigabitEthernet0/0/1]stp instance 1 cost ?
  INTEGER<1-200000000>  Port path cost

Configure the priority of the current port in spanning tree calculation (by default, the priority value of the switching device port is 128, in steps of 16)

[SW1-GigabitEthernet0/0/1]stp instance 1 port priority ?
  INTEGER<0-240>  Port priority, in steps of 16

MSTP network data forwarding

Within the MST domain, it is forwarded along its corresponding MSTI. Between MST areas, forwarding along CST.

For example, vlan2 is mapped to MSTI 2. Throughout the CIST, data will be forwarded along the spanning tree of MSTI 2 in each MST domain. At the boundary of the MST domain, packets are forwarded based on CST.

Guess you like

Origin blog.csdn.net/x629242/article/details/126332588