MSTP Protocol Simulation Experiment Based on ENSP

Spanning tree protocol is one of the most important protocols for two-layer network devices. It can effectively avoid the broadcasting storm under the condition of multi-switch interconnection, but its working process is It is difficult for students to understand its core principles in the teaching process. This paper takes MSTP as an example, which is the most difficult to understand in spanning tree. Based on a simple case, we use eNSP network simulation software to build the experimental framework, give the configuration process and analysis the captured packets. Through this experiment, students can understand the function of the multi-spanning tree protocol more intuitively, and realize the network traffic load balancing through configuration.


Introduction
With the rapid development of the Internet, the number of end users of the network has increased dramatically, which makes the equipment of access layer also increase. In order to ensure the accuracy and Immediacy of data communication, many switches are often used to interconnect to provide data redundancy, but at the same time, a two-layer loop will be formed. STP (Spanning Tree Protocol) can be used very well. The ground avoids the appearance of loops, thus avoiding the occurrence of broadcast storms. RSTP (Rapid Spanning Tree Protocol) and MSTP (Multiple Spanning Tree Protocol) are also based on this protocol. Because the process of spanning tree protocol is abstract, it is difficult for students to understand it in the teaching process of Computer Network. Therefore, this paper designs a simulation experiment of MSTP protocol based on eNSP (Enterprise Network Simulation Platform) simulation platform. Through the analysis of the experiment process and the packets which are captured, it can improve the teaching effect and promote students to understanding of the protocol. [1]

Principle of Multi-spanning Tree Protocol
The traditional STP eliminates the loops in the network by electing the root ports and blocking part of the ports, thus establishing a tree-like topology and solving the problem of "broadcast storm" in the ring Ethernet network. But the traditional STP only solves the problem of single point failure, and the whole network has only one spanning tree. When the network scale is large, it will lead to a longer convergence time. Once the topology changes, it will have a larger impact range. In addition, when a link is blocked, it will not bear any traffic, resulting in a great waste and cannot solve the problem of load sharing. After that, RSTP and MSTP were generated. By contrast, the convergence speed of RSTP was improved, but it was still a single spanning tree. At present, MSTP protocol is widely used, which can realize load balancing and path redundancy through certain methods. [  MSTI is a spanning tree in MST region. In a MST region, multiple spanning trees can be generated by MSTP, and the spanning trees are independent of each other. As can be seen from Figure 2, the MSTP network formed by three switches A, B and C can form three MSTIs, each spanning tree has no loop. In each MSTI, there may be multiple VLANs, but a VLAN can only correspond to one MSTI, otherwise the network connectivity will be affected.

ENSP introduction
ENSP is a free, scalable and graphical enterprise network simulation software platform provided by Huawei. It mainly simulates enterprise network routers, switches, firewalls, WLAN and other devices. Its interfaces are friendly, they can perfectly present the real equipment, support large-scale network, and give users the opportunity to be in the network. In the absence of real devices, simulation exercises can be carried out. At the same time, the interfaces between real network devices and real network devices can be realized through real network cards, which can more intuitively display the protocol interaction process and facilitate users to learn network technology. [5]

4.1Experimental purpose
Through the experiment, it will let the students to understand the STP blocking link method, understand the principle of STP, master the basic configuration process of MSTP and the method of generating examples, and master the method of configuring MSTP to realize traffic sharing.

4.2Scene and requirements
In the administrative building of the college, there are three access layer switches named S1, S2 and S3. All of them are using S3700. S1 and S2 are on the second floor and S3 is on the third floor. Educational and personnel departments have several computers connected to different switches respectively. In order to differentiate work, different departments are in different VLAN. Common spanning tree STP is required to block a link so that the link is idle to ensure that no loops are generated. However, in order to make full use of each link and avoid waste of resources, it is necessary to configure MSTP protocol and generate multiple instances to share traffic on different links. The topological structure is shown in the figure 3.  Figure 3. MSTP configuration topology. The MAC addresses of S1-S3 switches are 4c1f-cc93-097f, 4c1f-cc08-05fc and 4c1f-cc65-71aa, respectively. Host IP address allocation is shown in the  Figure 3, the topology is established, the devices are started, and the basic configuration of the host is made according to the address in Table 1. VLAN 5 and VLAN 6 are established on S1, S2 and S3 switches. All the ports connecting the terminal PC of the switch are configured as access type interfaces and assigned to the corresponding VLAN, while the interfaces between the switches are configured as trunk type. All VLANs are allowed to pass through by using port trunk allow-pass VLAN all command. The following is the command of S1, which can be set to S2 and S3 in the same way.
[S1]vlan batch 5 6 [S1]interface Ethernet0/0/1 [S1-Ethernet0/0/1]port link-type access [S1-Ethernet0/0/1]port default vlan 5 [S1-Ethernet0/0/1]interface GigabitEthernet 0/0/1 [S1-GigabitEthernet0/0/1]port link-type trunk [S1-GigabitEthernet0/0/1]port trunk allow-pass vlan all [S1]interface GigabitEthernet 0/0/2 [S1-GigabitEthernet0/0/2]port link-type trunk [S1-GigabitEthernet0/0/2]port trunk allow-pass vlan all Huawei switches default to MSTP. According to the spanning tree principle, the MAC address of S2 is the smallest, so when three switches form a loop, S2 is the root bridge. By looking at the parameters of each switch, we can see that S2 is the root switch, all ports are designated ports and are in Forwarding state.GE 0/0/2 of S1 is an alternative port and is in a discarded state. MSTID is the instance ID of MSTP, which is currently 0.  Captured packets at the GE 0/0/2 interface of S1 found that there was no data forwarding on the interface. Similarly, we can see how the GE 0/0/1 interface and the GE 0/0/2 interface grab packets. We can see that the GE 0/0/1 interface has no data forwarding, that is, the link between S1 and S3 is idle. S1, S2 and S3 are used for data transmission. At this point, we can effectively utilize resources by configuring multiple instances of MSTP.
There is a VLAN table in the MST domain, which reflects the relationship between VLAN and instances. As we have seen in the previous experiments, by default all VLANs are in instance 0. After entering the MST region view, set the region name to TY and set its revision level to 1. By default, the MSTP revision level for the MST region is 0. Specify VLAN 5 to instance MSTI 5, VLAN 6 to instance MSTI 6. And finally activate MST region configuration and save. In MSTP network, the three elements of the same MST region are region name, revision level, instance and VLAN mapping, which should be consistent. According to the above steps, S2 and S3 are configured.
[S1]stp Region-configuration [S1-mst-region]region-name TY [S1-mst-region]revision-level 1 [S1-mst-region]instance 5 vlan 5 [S1-mst-region]instance 6 vlan 6 [S1-mst-region]active region-configuration When the configuration is complete, you can view the MST region configuration information currently in effect on the switch. As you can see, all the region names have been changed to TY, the revised version number is 1, and a VLAN corresponds to the same instance. In addition to the VLAN 5 and VLAN 6 we set up, the remaining VLAN corresponds to instance 0. <S1>display stp region-configuration Oper configuration Format selector :0 6 However, by looking at the packets, we can find that the data transmission situation is the same as when no instance is set up. Although we have configured multiple instances of MSTP, because each instance is independent in calculating the spanning tree, if we do not change the parameters of the spanning tree, then each spanning tree will get the same election results. Therefore, to generate different spanning trees, we need to change the switch parameters in the instance. Here, we keep instance 6 unchanged, modify the switch parameters of instance 5, and set the priority of S3 to 0, that is, configure it as the root switch.
[S3]stp instance 5 priority 0 Use the command display stp instance 5 brief to view the port status of each switch in instance 5. As you can see, S1 of instance 5 has become the root switch at this time, and the ports are all designated ports and forwarded.
[S1]display stp instance 5  The experimental results show that in instance 5, S3 is the root switch, and the GE 0/0/1 interface of S1 is in Forwarding state, which can be verified by using the package grabbing tool. That is, the links between S1 and S2 in instance 5 are idle.
Above, we have completed the multi-instance configuration of MSTP. After modifying the parameters of instance 5, the spanning tree of different instances has changed. The spanning tree of different instances can be shown as follows: • In instance 5, we set S3 as root switch, and the links between S1 and S2 are idle; • In instance 6, we keep the spanning tree state of the original instance 0 unchanged, while S2 is still root switch, and the links between S1 and S3 are idle.
In this way, the purpose of traffic sharing has been realized, and no loop has been formed, which makes effective use of network resources.

Concluding remarks
In the eNSP simulation environment, we take MSTP as an example to carry out the simulation experiment of spanning tree. At the same time, through graphical analysis and display, students can thoroughly understand the principle of spanning tree and form an intuitive impression. For other principles in the course, eNSP can be used to carry out simulation experiments, so that students can accumulate operational experience of the configuration system, while teachers achieve teaching objectives, but also reduce the investment in teaching process.