Detailed Explanation of the MSTP Mechanism Principle (Selected Illustrations and Text)

2025.08.27

This issue shares with you the working principle of MSTP.

1. MSTP Concepts

MSTP port type

MSTP adds two new types of ports based on RSTP: master port and domain edge port.

MSTP port type

describe

Root   Port


Root port: The port closest to the root switch, which is in the forwarding state after convergence.

Designated   Port

Designated port. The BPDUs sent by this port are superior to the BPDUs received. After convergence, the port enters the forwarding state.

Alternate   Port

Alternative port, the BPDU sent by this port is worse than the BPDU received from the peer switch, and is in the discarding state after convergence. It is the backup of the root port. If the root port fails, this port will immediately become the root port.

Backup   Port

Backup port: The BPDU sent by this port is worse than the BPDU sent from other ports of this switch. After convergence, it is in the discarding state. It is the backup of the designated port. When the designated port fails, this port immediately becomes the designated port.

Disabled

Port failure

Master Port

A region edge port is a port located at the edge of an MST region and connected to other MST regions or SSTs.


Domain edge port

If a designated port is located at the edge of the entire domain and is no longer connected to any switching device, it is called an edge port.

illustrate:

  • Except for edge ports, all other port roles participate in the MSTP calculation process.
  • The same port can play different roles in different spanning tree instances.

2. MSTP port status

The port states defined in MSTP are the same as those defined in RSTP:

STP port status

MSTP port status

describe

Blocking

Discarding

Do not learn MAC addresses

Do not forward user traffic

Listening

Learning

Learning

Learning MAC addresses

Do not forward user traffic

Forwarding

Forwarding

Learning MAC addresses

Forwarding user traffic

MSTP port status and port role correspondence table:

picture

2. MSTP message format

Like STP and RSTP, MSTP packets also have two types: "Configuration BPDU" and "TCN BPDU". Their functions are basically the same, except for the differences in the relevant fields.

MSTP configuration BPDUs

The MSTP configuration BPDU is called an MST BPDU. Whether it's an intra-region or inter-region MST BPDU, the first 36 bytes are identical to the RST BPDU. Starting from the 37th byte, there are MSTP-specific fields. The final MSTI configuration information field consists of several concatenated MSTI configuration information groups.

The format of an MST BPDU is as follows:

The following table describes the main information in an MST BPDU:

2. MSTP TCP BPDUs

The MSTP TCN BPDU is as follows:

Field Description:

  • Protocol Identifier: The protocol number is 0
  • Protocol Version Identifier: The protocol version number is 3, indicating MSTP
  • BPDU Type: The type field is always set to 0x80, indicating a TCN BPDU.

3. MSTP Working Principle

The working mechanism of MSTP is as follows:

(1) It has the fast convergence mechanism of RSTP and converges as fast as RSTP;

(2) Instance-based spanning tree calculation is performed and VLANs can be mapped to instances, thereby achieving VLAN-based data distribution. The specific implementation is as follows:

  • A switch can support up to 65 instances (numbered 0-64). An MSTP instance is equivalent to an RSTP spanning tree.
  • A VLAN can only be mapped to one instance. One or several VLANs can be mapped to the same instance to achieve VLAN-based load balancing.
  • Different instances are distinguished by instance numbers. By default, all VLANs are mapped to instance 0, and instance 0 is mandatory.

1. RSTP shortcomings

Taking the switch as the unit, there is only one "tree", which can only achieve redundancy. All data can only go one way, and data distribution cannot be achieved, and the link bandwidth cannot be fully utilized:

2. MSTP working principle

Bind user VLANs to instances and implement user data diversion through multiple instances of MSTP, fully utilizing link bandwidth to meet user service diversion requirements.

The spanning tree topo pruned for instance 10 in VLAN 10 is as follows:

The spanning tree topo pruned for instance 20 in VLAN 20 is as follows: