The Multiple Spanning Tree Protocol (MSTP) was originally defined as the IEEE 802.1s standard protocol. Now the standard IEEE 802.1Q-2005 includes MSTP. The basic role of this protocol is to prevent L2 loops. I do not want to explain MSTP in details, as this can be easily found on the Internet. I just want to show you:
- how to configure this protocol using Huawei CLI
- how to load balance traffic over redundant links.
Let’s assume that we have the following physical topology:
By default MSTP runs only one spanning-tree topology over a LAN network for every VLAN. Even if we configure 1000 different VLANs throughout this topology, only three links will be utilized. This is because STP blocks two links, preventing our topology from L2 loops. In our case SW1 was elected as the Root Bridge. As a result we have the following logical topology which will be used by every VLAN to forward traffic (assuming default MSTP configuration):
Links SW2—SW3 and SW2—SW4 will be blocked by the SW3 and SW4 switches respectively. Traffic from every device connected to any VLAN configured, will be travelling only these three links. This is a default MSTP behaviour.
To overcome this negative issue, MSTP protocol should be properly planned and configured. By default this protocol runs only one STP instance and maps all VLANs to this instance. To utilize all physical links equally, additional instances should be added.
Let’s assume that we have two VLANs: 100 and 200. By default both VLANs will use the same logical STP topology as in the picture above. This is because both VLANs belong to the same MSTP Instance, which was determined by the one Root Bridge placement (SW1 in our case).
To force VLAN 100 to use one logical topology and VLAN 200 to use a different logical topology, we need to:
- configure switches to have two different MSTP Instances
- define different Root Bridge placement for every MSTP Instance
- map VLAN 100 to the first MSTP Instance and VLAN 200 to the second MSTP Instance.
Please see table and the picture below:
Let’s start configuring our devices. As a first step all switches have to be configured with VLAN information (SW2-4 configuration omitted):
<labnarioSW1>system-view [labnarioSW1]vlan batch 100 200
Now we can configure MSTP protocol (all switches have to be configured):
[labnarioSW1]stp region-configuration [labnarioSW1-mst-region] region-name labnario [labnarioSW1-mst-region] instance 1 vlan 100 [labnarioSW1-mst-region] instance 2 vlan 200 [labnarioSW1-mst-region] active region-configuration Info: This operation may take a few seconds. Please wait for a moment....done. [labnarioSW1-mst-region]
To check MSTP configuration:
[labnarioSW1-mst-region]check region-configuration Admin configuration Format selector :0 Region name :labnario Revision level :0 Instance VLANs Mapped 0 1 to 99, 101 to 199, 201 to 4094 1 100 2 200 [labnarioSW1-mst-region]
As you see above, by default all VLANs are mapped to the MSTP Instance 0. This is the reason that all VLANs use the same logical topology to forward traffic between devices.
Now SW1 should be configured as the Root Bridge for MSTP Instance 1 and SW2 as the Root Bridge for MSTP Instance 2. In case of Root Bridge failure, backup devices should be also defined as follows:
[labnarioSW1]stp instance 1 root primary [labnarioSW1]stp instance 2 root secondary [labnarioSW2]stp instance 1 root secondary [labnarioSW2]stp instance 2 root primary
Let’s check our MSTP configuration is working as we have planned:
[labnarioSW1]display stp instance 1 -------[MSTI 1 Global Info]------- MSTI Bridge ID :0.4c1f-cc10-af35 MSTI RegRoot/IRPC :0.4c1f-cc10-af35 / 0 MSTI RootPortId :0.0 MSTI Root Type :Primary root Master Bridge :32768.4c1f-cc10-af35 Cost to Master :0 TC received :33 TC count per hello :0 Time since last TC :0 days 1h:46m:14s Number of TC :34 Last TC occurred :Ethernet0/0/3 ----[Port1(Ethernet0/0/1)][FORWARDING]---- Port Role :Designated Port Port Priority :128 Port Cost(Dot1T ) :Config=auto / Active=1 Designated Bridge/Port :0.4c1f-cc10-af35 / 128.1 Port Times :RemHops 20 TC or TCN send :16 TC or TCN received :10 ----[Port2(Ethernet0/0/2)][FORWARDING]---- Port Role :Designated Port Port Priority :128 Port Cost(Dot1T ) :Config=auto / Active=1 Designated Bridge/Port :0.4c1f-cc10-af35 / 128.2 Port Times :RemHops 20 TC or TCN send :22 TC or TCN received :6 ----[Port3(Ethernet0/0/3)][FORWARDING]---- Port Role :Designated Port Port Priority :128 Port Cost(Dot1T ) :Config=auto / Active=1 Designated Bridge/Port :0.4c1f-cc10-af35 / 128.3 Port Times :RemHops 20 TC or TCN send :3 TC or TCN received :3 [labnarioSW1]
As you can see, SW1 MSTP bridge ID is:
0.4c1f-cc10-af35
Zero followed by the MAC address means, that this switch is the Root Bridge Primary for the MSTP Instance 1. By default bridge priority equals to 32768. Let’s check MSTP Instance 2:
[labnarioSW1]display stp instance 2 -------[MSTI 2 Global Info]------- MSTI Bridge ID :4096.4c1f-cc10-af35 MSTI RegRoot/IRPC :0.4c1f-cc60-2fd3 / 1 MSTI RootPortId :128.1 MSTI Root Type :Secondary root Master Bridge :32768.4c1f-cc10-af35 Cost to Master :0 TC received :30 TC count per hello :0 Time since last TC :0 days 1h:56m:51s Number of TC :34 Last TC occurred :Ethernet0/0/1 ----[Port1(Ethernet0/0/1)][FORWARDING]---- Port Role :Root Port Port Priority :128 Port Cost(Dot1T ) :Config=auto / Active=1 Designated Bridge/Port :0.4c1f-cc60-2fd3 / 128.1 Port Times :RemHops 20 TC or TCN send :11 TC or TCN received :12 ----[Port2(Ethernet0/0/2)][FORWARDING]---- Port Role :Designated Port Port Priority :128 Port Cost(Dot1T ) :Config=auto / Active=1 Designated Bridge/Port :4096.4c1f-cc10-af35 / 128.2 Port Times :RemHops 19 TC or TCN send :15 TC or TCN received :7 ----[Port3(Ethernet0/0/3)][FORWARDING]---- Port Role :Designated Port Port Priority :128 Port Cost(Dot1T ) :Config=auto / Active=1 Designated Bridge/Port :4096.4c1f-cc10-af35 / 128.3 Port Times :RemHops 19 TC or TCN send :5 TC or TCN received :0 [labnarioSW1]
Bridge ID is:
4096.4c1f-cc10-af35
Bridge priority equals to 4096, this is because this switch is configured as the Root Bridge Secondary for the MSTP Instance 2.
Look at the field:
MSTI RegRoot/IRPC :0.4c1f-cc60-2fd3
As you see, RegRoot ID is different than Bridge ID. This is because SW2 was configured as the STP Root Bridge Primary for the MSTP Instance 2.
Let’s check STP port roles and states:
[labnarioSW1]display stp brief MSTID Port Role STP State Protection 0 Ethernet0/0/1 DESI FORWARDING NONE 0 Ethernet0/0/2 DESI FORWARDING NONE 0 Ethernet0/0/3 DESI FORWARDING NONE 1 Ethernet0/0/1 DESI FORWARDING NONE 1 Ethernet0/0/2 DESI FORWARDING NONE 1 Ethernet0/0/3 DESI FORWARDING NONE 2 Ethernet0/0/1 ROOT FORWARDING NONE 2 Ethernet0/0/2 DESI FORWARDING NONE 2 Ethernet0/0/3 DESI FORWARDING NONE [labnarioSW1]
All ports in MSTP Instance 1 have a Designated role. This means that SW1 is the Root Bridge for this Instance.
To check MSTP topology per VLAN, just type:
[labnarioSW1]display stp vlan 100 ProcessId InstanceId Port Role State ---------------------------------------------------------------------- 0 1 Ethernet0/0/1 DESI FORWARDING 0 1 Ethernet0/0/2 DESI FORWARDING 0 1 Ethernet0/0/3 DESI FORWARDING [labnarioSW1]display stp vlan 200 ProcessId InstanceId Port Role State ---------------------------------------------------------------------- 0 2 Ethernet0/0/1 ROOT FORWARDING 0 2 Ethernet0/0/2 DESI FORWARDING 0 2 Ethernet0/0/3 DESI FORWARDING [labnarioSW1]
The same verification commands on SW2:
[labnarioSW2]dis stp instance 1 -------[MSTI 1 Global Info]------- MSTI Bridge ID :4096.4c1f-cc60-2fd3 MSTI RegRoot/IRPC :0.4c1f-cc10-af35 / 1 MSTI RootPortId :128.1 MSTI Root Type :Secondary root Master Bridge :32768.4c1f-cc10-af35 Cost to Master :1 TC received :47 TC count per hello :0 Time since last TC :0 days 2h:12m:1s Number of TC :40 Last TC occurred :Ethernet0/0/1 ----[Port1(Ethernet0/0/1)][FORWARDING]---- Port Role :Root Port Port Priority :128 Port Cost(Dot1T ) :Config=auto / Active=1 Designated Bridge/Port :0.4c1f-cc10-af35 / 128.1 Port Times :RemHops 20 TC or TCN send :10 TC or TCN received :16 ----[Port2(Ethernet0/0/2)][FORWARDING]---- Port Role :Designated Port Port Priority :128 Port Cost(Dot1T ) :Config=auto / Active=1 Designated Bridge/Port :4096.4c1f-cc60-2fd3 / 128.2 Port Times :RemHops 19 TC or TCN send :32 TC or TCN received :14 ----[Port3(Ethernet0/0/3)][FORWARDING]---- Port Role :Designated Port Port Priority :128 Port Cost(Dot1T ) :Config=auto / Active=1 Designated Bridge/Port :4096.4c1f-cc60-2fd3 / 128.3 Port Times :RemHops 19 TC or TCN send :9 TC or TCN received :0 [labnarioSW2]
RegRoot field points to SW1’s MAC address. This means that SW1 is the Root Bridge for MSTP Instance 1. Bridge ID followed by the 4096 means that SW2 is the Root Bridge Secondary for MSTP Instance 1.
Port roles and states:
[labnarioSW2]display stp brief MSTID Port Role STP State Protection 0 Ethernet0/0/1 ROOT FORWARDING NONE 0 Ethernet0/0/2 ALTE DISCARDING NONE 0 Ethernet0/0/3 DESI FORWARDING NONE 1 Ethernet0/0/1 ROOT FORWARDING NONE 1 Ethernet0/0/2 DESI FORWARDING NONE 1 Ethernet0/0/3 DESI FORWARDING NONE 2 Ethernet0/0/1 DESI FORWARDING NONE 2 Ethernet0/0/2 DESI FORWARDING NONE 2 Ethernet0/0/3 DESI FORWARDING NONE [labnarioSW2]
All ports in MSTP Instance 2 have Designated role and Forwarding state. This switch is the Root Bridge for MSTP Instance 2.
STP port roles and states per VLAN:
[labnarioSW2]dis stp vlan 100 ProcessId InstanceId Port Role State ---------------------------------------------------------------------- 0 1 Ethernet0/0/1 ROOT FORWARDING 0 1 Ethernet0/0/2 DESI FORWARDING 0 1 Ethernet0/0/3 DESI FORWARDING [labnarioSW2]dis stp vlan 200 ProcessId InstanceId Port Role State ---------------------------------------------------------------------- 0 2 Ethernet0/0/1 DESI FORWARDING 0 2 Ethernet0/0/2 DESI FORWARDING 0 2 Ethernet0/0/3 DESI FORWARDING [labnarioSW2]
Which links are blocked by the MSTP? Lets check STP topologies on SW3:
[labnarioSW3]dis stp brief MSTID Port Role STP State Protection 0 Ethernet0/0/1 ROOT FORWARDING NONE 0 Ethernet0/0/3 ALTE DISCARDING NONE 1 Ethernet0/0/1 ROOT FORWARDING NONE 1 Ethernet0/0/3 ALTE DISCARDING NONE 2 Ethernet0/0/1 ALTE DISCARDING NONE 2 Ethernet0/0/3 ROOT FORWARDING NONE [labnarioSW3]
Interface Eth0/0/3 is blocked by the STP Instance 1 and Eth0/0/1 blocked by the STP Instance 2.
Which ports are blocked on the SW4?
[labnarioSW4]dis stp brief MSTID Port Role STP State Protection 0 Ethernet0/0/1 DESI FORWARDING NONE 0 Ethernet0/0/3 ROOT FORWARDING NONE 1 Ethernet0/0/1 ALTE DISCARDING NONE 1 Ethernet0/0/3 ROOT FORWARDING NONE 2 Ethernet0/0/1 ROOT FORWARDING NONE 2 Ethernet0/0/3 ALTE DISCARDING NONE [labnarioSW4]
In the MSTP Instance 1 Eth0/0/1 is blocked, and Eth0/0/3 in MSTP Instance 2.
MSTP debugging commands:
<labnarioSW4>debugging stp ? all Specify all debug switch event Specify event debug switch global-error Specify global error debug switch global-event Specify global event debug switch ha-info Backup information instance Spanning tree instance interface Specify interface msti Specify debugging packet's MSTIs packet Specify packet debug switch process The MSTP process