Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Configuring MSTP

Multiple Spanning Tree Protocol (MSTP) maps multiple VLANs into a spanning tree instance, with each instance having a spanning tree topology independent of other spanning tree instances.

Understanding MSTP

Ethernet networks are susceptible to broadcast storms if loops are introduced. However, an Ethernet network needs to include loops because they provide redundant paths in case of a link failure. Spanning-tree protocols address both of these issues because they provide link redundancy while simultaneously preventing undesirable loops.

Spanning-tree protocols intelligently avoid loops in a network by creating a tree topology (spanning tree) of the entire bridged network with only one available path between the tree root and a leaf. All other paths are forced into a standby state. The tree root is a switch within the network elected by the STA (spanning-tree algorithm) to use when computing the best path between bridges throughout the network and the root bridge. Frames travel through the network to their destination– a leaf. A tree branch is a network segment, or link, between bridges. Switches that forward frames through an STP spanning-tree are called designated bridges.

Juniper Networks devices provide Layer 2 loop prevention through Spanning Tree Protocol (STP), Rapid Spanning Tree Protocol (RSTP), Multiple Spanning Tree Protocol (MSTP), and VLAN Spanning Tree Protocol (VSTP). This topic explains MSTP.

Note:

If you are using Junos OS for EX Series and QFX Series switches with support for the Enhanced Layer 2 Software (ELS) configuration style, you can force the original IEEE 802.1D Spanning Tree Protocol (STP) version to run in place of RSTP or VSTP by setting force-version.

This topic describes:

Benefits of MSTP

MSTP has the following benefits:

  • Multiple Spanning Tree Protocol works with most VLANs.

  • MSTP supports multiple instances on a single physical interface.

  • On MX Series and ACX Series routers, you can configure RSTP, MSTP, and VSTP instance interfaces as edge ports.

MSTP Maps Multiple VLANs

MSTP is an extension of RSTP that maps multiple independent spanning-tree instances onto one physical topology. Each spanning-tree instance (STI) includes one or more VLANs. Unlike in STP and RSTP configurations, a port might belong to multiple VLANs and be dynamically blocked in one spanning-tree instance, but forwarding in another. This behavior significantly improves network resource utilization by load-balancing across the network and maintaining switch CPU loads at moderate levels. MSTP also leverages the fast reconvergence time of RSTP when a network, switch, or port failure occurs within a spanning-tree instance.

MSTP creates a common and internal spanning tree (CIST) to interconnect and manage all MSTP regions and even individual devices that run RSTP or STP, which are recognized as distinct spanning-tree regions by MSTP. The CIST views each MSTP region as a virtual bridge, regardless of the actual number of devices participating in the MSTP region, and enables multiple spanning-tree instances (MSTIs) to link to other regions. The CIST is a single topology that connects all switches (STP, RSTP, and MSTP devices) through an active topology, ensuring connectivity between LANs and devices within a bridged network. This functionality provided by MSTP enables you to better utilize network resources while remaining backward-compatible with older network devices.

Configuring MSTP Regions

When enabling MSTP, you define one or more MSTP regions. An MSTP region defines a logical domain where multiple spanning-tree instances (MSTIs) can be administered independently of MSTIs in other regions, setting the boundary for bridge protocol data units (BPDUs) sent by one MSTI. An MSTP region is a group of switches that is defined by three parameters:

  • Region name—User-defined alphanumeric name for the region.

  • Revision level—User-defined value that identifies the region.

  • Mapping table—Numerical digest of VLAN-to-instance mappings.

An MSTP region can support up to 64 MSTIs,, and each MSTI can support from 1 to 4094 VLANs. When you define a region, MSTP automatically creates an internal spanning-tree instance (IST instance 0) that provides the root switch for the region and includes all currently configured VLANs that are not specifically assigned to a user-defined MSTI. An MSTI includes all static VLANs that you specifically add to it. The switch places any dynamically created VLANs in the IST instance by default, unless you explicitly map them to another MSTI. Once you assign a VLAN to a user-defined MSTI, the switch removes the VLAN from the IST instance.

Selecting a Spanning Tree Protocol

The default factory configuration is RSTP, a faster version of STP. To determine which spanning-tree protocol is best for your situation, see Table 1 below.

Table 1: Selecting a Spanning Tree Protocol
Protocol Advantages Disadvantages

RSTP

  • Rapid Spanning Tree Protocol is the default switch configuration and is recommended for most network configurations because it converges more quickly than STP after a failure.

  • Voice and video work better with RSTP than they do with STP.

  • RSTP is backward compatible with STP; therefore, switches do not all have to run RSTP.

  • RSTP does not work with 802.1D 1998 bridges.

STP

  • Spanning Tree Protocol works with 802.1D 1998 bridges.

  • RSTP is backward compatible with STP; therefore, switches do not all have to run STP.

  • STP is slower than RSTP.

  • STP is not recommended for multiple VLAN networks because it is not VLAN-aware—as a result, all VLANs within a LAN share the same spanning-tree. This limits the number of forwarding paths for data traffic.

  • If you are using Junos OS for EX Series switches with support for the Enhanced Layer 2 Software (ELS) configuration style, you can force the original IEEE 802.1D Spanning Tree Protocol (STP) version to run in place of RSTP or VSTP by setting force-version. However, the CLI does not include [edit protocols stp].

MSTP

  • Multiple Spanning Tree Protocol works with most VLANs.

  • RSTP and STP are recognized as distinct spanning-tree regions by MSTP.

  • Some protocols require compatibility that is not provided by MSTP. In this case, use VSTP.

  • MSTP uses more CPU than RSTP and does not converge as fast as RSTP.

VSTP

  • VLAN Spanning Tree Protocol works with VLANs that require device compatibility.

  • VSTP and RSTP are the only spanning-tree protocols that can be configured concurrently on a switch.

  • With VSTP there can be only STP instance per VLAN, whereas MSTP lets you combine multiple VLANs in one instance.

  • VSTP supports a limited number of ports compared to RSTP.

  • VSTP uses more CPU than RSTP and does not converge as fast as RSTP.

  • Having a large number of VSTP and RSTP instances can cause continuous changes in the topology. Ensure to check the scale limits before configuring large number of VSTP instances.

Configuring MSTP

You can configure the Multiple Spanning Tree Protocol (MSTP) under the [edit protocols] hierarchy.

You can configure the Multiple Spanning Tree Protocol (MSTP) under the following hierarchy levels:

The routing instance type can be either virtual-switch or layer2-control.

To configure the Multiple Spanning Tree Protocol:

  1. Enable MSTP as the version of spanning-tree protocol to be configured:
  2. Configure the interfaces that participate in the MSTP instance for all interfaces at one time, or for configured interface ranges, or for specific interfaces individually:
    • Enable MSTP on all the interfaces at one time, for switches that support this option (most switches):

      Note:

      You cannot disable MSTP on all the interfaces with one command. See the configuration steps for configuring MSTP on specific interfaces later in this topic for how to disable MSTP on interfaces individually.

      For QFX5100 switches, which do not support the interface all option, you must configure interface ranges for the applicable interfaces on which you want to enable MSTP, and then issue the set protocols mstp interface name command for each name that you have configured as an interface range (described next).

    • Enable MSTP on a range of interfaces, for switches such as QFX5100 switches that do not support the interface all option:

      1. Configure interface ranges using the interface-range statement at the [edit interfaces] hierarchy level for the applicable interfaces on which you want to enable MSTP:

      2. Enable MSTP for each configured interface range interface-range-name at the [edit ... protocols mstp] hierarchy level:

    • Configure a specific interface individually to enable MSTP and various MSTP options on that interface, or to disable MSTP on that interface:

      1. Enable MSTP on the specified interface:

      2. Configure the interface priority:

      3. (Optional) By default, the interface link cost is determined by the link speed. You can configure the interface link cost to control which bridge is the designated bridge and which port is the designated port:

      4. Configure the interface link mode to identify point-to-point links:

        Specify p2p if the link is point to point. Specify shared if the link is a shared media.

      5. (Optional) Configure the interface as an edge port:

        Edge ports do not expect to receive bridge protocol data unit (BPDU) packets. If a BPDU packet is received for an edge port, the port becomes a nonedge port

      6. (Optional) Disable MSTP on a specific interface:

    You can also enable BPDU root protection for all spanning-tree protocol instances on the interface. BPDU root protect ensures the port is the spanning-tree designated port. If the port receives superior BPDU packets, root protect moves this port to a root-prevented spanning-tree state. For configuration details, see Checking the Status of Spanning-Tree Instance Interfaces.

  3. Configure the bridge priority.
  4. Configure hello BPDU timers.
    1. Configure the maximum expected arrival time of hello BPDUs:
    2. Configure the time interval at which the root bridge transmits configuration BPDUs:
  5. (Optional) By default, the bridge port remains in the listening and learning states for 15 seconds before transitioning to the forwarding state. You can specify a delay from 4 through 20 seconds instead:
  6. Configure MSTP-specific options.
    1. Configure the MSTP region configuration name:
    2. Configure the MSTP revision level:
    3. Configure the maximum number of hops that can be forwarded in the MSTP region:

Configuring MSTP Instances on a Physical Interface

You can configure a Multiple Spanning Tree Instance (MSTI) under the following hierarchy levels:

  • [edit logical-systems logical-system-name protocols mstp]

  • [edit logical-systems logical-system-name routing-instances routing-instance-name protocols mstp]

  • [edit protocols mstp]

  • [edit routing-instances routing-instance-name protocols mstp]

The routing instance type can be either virtual-switch or layer2-control.

Before you begin, configure Multiple Spanning-Tree Protocol. For configuration details, see Configuring Multiple Spanning Tree Protocol.

  1. Enable configuration of an MST instance:

    The msti-id value must be from 1 through 64.

  2. Configure the interfaces that participate in the MST instance.
    1. Enable configuration of the interface:
    2. Configure the interface priority:
    3. (Optional) By default, the interface link cost is determined by the link speed. You can configure the interface link cost to control which bridge is the designated bridge and which port is the designated port:
    4. (Optional) Configure the interface as an edge port:

      Edge ports do not expect to receive bridge protocol data unit (BPDU) packets. If a BPDU packet is received for an edge port, the port becomes a non-edge port

  3. Configure the bridge priority:
  4. (Optional) An MSTI can map to a range of VLANs just as a logical port can map to a range of VLANs. The MSTP VLAN specifies the VLAN or VLAN range to which this MSTI is mapped. The vlan-id is configured under the logical interface. Configure the VLAN or VLAN range of the MSTI instance:
  5. Verify the MST interface configuration.

Example: Configuring Network Regions for VLANs with MSTP

Note:

This example uses Junos OS for EX Series and QFX Series switches with support for the Enhanced Layer 2 Software (ELS) configuration style. The example also describes the configuration statement differences that can be substituted in the same configuration on EX Series switches that do not support ELS.

Multiple Spanning Tree Protocol (MSTP) is used to create a loop-free topology in networks using multiple spanning-tree regions in which each region contains multiple spanning-tree instances (MSTIs). MSTIs provide different paths for different VLANs. This functionality facilitates better load sharing across redundant links.

Up to 64 MSTIs can be created for an EX Series switch, and each MSTI can support up to 4094 VLANs.

This example describes how to configure MSTP on four EX Series switches:

Requirements

This example uses the following software and hardware components:

  • Junos OS Release 13.2X50-D10 or later for EX Series or QFX Series switches

  • Four QFX Series switches

Before you configure the switches for MSTP, be sure you have:

Overview and Topology

When the number of VLANs grows in a network, MSTP provides an efficient way of creating a loop-free topology by using MSTIs. Each MSTI in the spanning-tree domain maintains its own tree. Each tree can be mapped to different links, utilizing bandwidth that would be unavailable to a single tree. MSTIs reduce the demand on system resources.

Topology

Figure 1: Network Topology for MSTPNetwork Topology for MSTP

The interfaces shown in Figure 1 will be configured for MSTP.

Table 2: Components of the Topology for Configuring MSTP on EX Series Switches

Property

Settings

Switch 1

The following interfaces on Switch 1 are connected in this way:

  • xe-0/0/12:0 is connected to Switch 2

  • xe-0/0/9:0 is connected to Switch 4

  • xe-0/0/11:0 is connected to Switch 3

Switch 2

The following interfaces on Switch 2 are connected in this way:

  • xe-0/0/9:0 is connected to Switch 1

  • et-0/0/3 is connected to Switch 3

Switch 3

The following interfaces on Switch 3 are connected in this way:

  • xe-0/0/11:0 is connected to Switch 1

  • et-0/0/6 is connected to Switch 2

  • xe-0/0/21:0 is connected to Switch 4

Switch 4

The following interfaces on Switch 4 are connected in this way:

  • xe-0/0/21:0 is connected to Switch 1

  • xe-0/0/12:0 is connected to Switch 3

VLAN names and tag IDs

voice-vlan, tag 10 employee-vlan, tag 20 guest-vlan, tag 30 camera-vlan, tag 40

MSTIs

1 2

MSTI region

region1

The topology in Figure 1 shows a common and internal spanning tree (CIST). The CIST is a single spanning tree connecting all devices in the network. The switch with the lowest bridge priority is elected as the root bridge of the CIST. You can control the election of the root bridge by configuring the bridge priority. Switch 3 is the root bridge of the CIST.

The ports in an MSTP topology have specific roles:

  • The root port is responsible for forwarding data to the root bridge.

  • The alternate port is a standby port for the root port. When a root port goes down, the alternate port becomes the active root port.

  • The designated port forwards data to the downstream network segment or device.

  • The backup port becomes the active designated port and starts forwarding data when the designated port goes down.

In this example, one MSTP region contains Switch 1, Switch 2, Switch 3, and Switch 4. Within the region, four VLANs are created:

  • voice-vlan supports voice traffic and has the VLAN tag identifier of 10.

  • employee-vlan supports data traffic and has the VLAN tag identifier of 20.

  • guest-vlan supports guest VLAN traffic (for supplicants that fail authentication) and has the VLAN tag identifier of 30.

  • camera-vlan supports video traffic and has the VLAN tag identifier of 40.

The VLANs are associated with specific interfaces on each of the four switches. Two MSTIs, 1 and 2, are then associated with the VLAN tag identifiers, and some MSTP parameters, such as cost, are configured on each switch.

Configuring MSTP on Switch 1

Procedure

CLI Quick Configuration

To quickly configure interfaces and MSTP on Switch 1, for ELS switches, copy the following commands and paste them into the switch terminal window:

Note:

For non-ELS switches, instead of the following command used above for ELS switches that sets an interface into trunk mode using the interface-mode statement:

substitute the following command for those lines in the configuration, which uses the non-ELS port-mode statement to set an interface into trunk mode:

Step-by-Step Procedure

To configure interfaces and MSTP on Switch 1:

Note:

Starting with Junos OS Release 15.1 for EX Series and QFX Series switches with support for the Enhanced Layer 2 Software (ELS) configuration style, you can configure spanning tree parameters globally on all spanning tree interfaces. See Configuring MSTP on Switches for additional information.

  1. Configure the VLANs voice-vlan, employee-vlan, guest-vlan, and camera-vlan:

  2. Configure the VLANs on the interfaces, including support for the Ethernet Switching protocol:

  3. Configure the port mode for the interfaces:

    Note:

    For non-ELS switches, instead of the following command used above for ELS switches that sets an interface into trunk mode using the interface-mode statement:

    substitute the following command for those lines in the configuration, which uses the non-ELS port-mode statement to set an interface into trunk mode:

  4. Configure MSTP on the switch, including the two MSTIs:

Results

Check the results of the configuration:

Configuring MSTP on Switch 2

Procedure

CLI Quick Configuration

To quickly configure interfaces and MSTP on Switch 2, copy the following commands and paste them into the switch terminal window:

Note:

For non-ELS switches, instead of the following command used above for ELS switches that sets an interface into trunk mode using the interface-mode statement:

substitute the following command for those lines in the configuration, which uses the non-ELS port-mode statement to set an interface into trunk mode:

Step-by-Step Procedure

To configure interfaces and MSTP on Switch 2:

  1. Configure the VLANs voice-vlan, employee-vlan, guest-vlan, and camera-vlan:

  2. Configure the VLANs on the interfaces, including support for the Ethernet Switching protocol:

  3. Configure the port mode for the interfaces:

    Note:

    For non-ELS switches, instead of the following command used above for ELS switches that sets an interface into trunk mode using the interface-mode statement:

    substitute the following command for those lines in the configuration, which uses the non-ELS port-mode statement to set an interface into trunk mode:

  4. Configure MSTP on the switch, including the two MSTIs:

Results

Check the results of the configuration:

Configuring MSTP on Switch 3

Procedure

CLI Quick Configuration

To quickly configure interfaces and MSTP on Switch 3, copy the following commands and paste them into the switch terminal window:

Note:

For non-ELS switches, instead of the following command used above for ELS switches that sets an interface into trunk mode using the interface-mode statement:

substitute the following command for those lines in the configuration, which uses the non-ELS port-mode statement to set an interface into trunk mode:

Step-by-Step Procedure

To configure interfaces and MSTP on Switch 3:

  1. Configure the VLANs voice-vlan, employee-vlan, guest-vlan, and camera-vlan:

  2. Configure the VLANs on the interfaces, including support for the Ethernet Switching protocol:

  3. Configure the port mode for the interfaces:

    Note:

    For non-ELS switches, instead of the following command used above for ELS switches that sets an interface into trunk mode using the interface-mode statement:

    substitute the following command for those lines in the configuration, which uses the non-ELS port-mode statement to set an interface into trunk mode:

  4. Configure MSTP on the switch, including the two MSTIs:

Results

Check the results of the configuration:

Configuring MSTP on Switch 4

Procedure

CLI Quick Configuration

To quickly configure interfaces and MSTP on Switch 4, copy the following commands and paste them into the switch terminal window:

Note:

For non-ELS switches, instead of the following command used above for ELS switches that sets an interface into trunk mode using the interface-mode statement:

substitute the following command for those lines in the configuration, which uses the non-ELS port-mode statement to set an interface into trunk mode:

Step-by-Step Procedure

To configure interfaces and MSTP on Switch 4:

  1. Configure the VLANs voice-vlan, employee-vlan, guest-vlan, and camera-vlan:

  2. Configure the VLANs on the interfaces, including support for the Ethernet Switching protocol:

  3. Configure the port mode for the interfaces:

    Note:

    For non-ELS switches, instead of the following command used above for ELS switches that sets an interface into trunk mode using the interface-mode statement:

    substitute the following command for those lines in the configuration, which uses the non-ELS port-mode statement to set an interface into trunk mode:

  4. Configure MSTP on the switch, including the two MSTIs:

Results

Check the results of the configuration:

Verification

To confirm that the configuration is working properly, perform these tasks:

Verifying MSTP Configuration on Switch 1

Purpose

Verify the MSTP configuration on Switch 1.

Action

Issue the operational mode commands show spanning-tree interface and show spanning-tree bridge:

Meaning

The operational mode command show spanning-tree interface displays spanning-tree domain information such as the designated port and the port roles.

The operational mode command show spanning-tree bridge displays the spanning-tree domain information at either the bridge level or the interface level. If the optional interface name is omitted, all interfaces in the spanning-tree domain are displayed.

Verifying MSTP Configuration on Switch 2

Purpose

Verify the MSTP configuration on Switch 2.

Action

Issue the operational mode commands show spanning-tree interface and show spanning-tree bridge:

Meaning

The operational mode command show spanning-tree interface displays spanning-tree domain information such as the designated port and the port roles. The spanning-tree interface parameters for instance 2 show that both ports are designated ports, which means Switch 2 is the root bridge for this instance.

The operational mode command show spanning-tree bridge displays the spanning-tree domain information at either the bridge level or interface level. If the optional interface name is omitted, all interfaces in the spanning-tree domain are displayed.

Verifying MSTP Configuration on Switch 3

Purpose

Verify the MSTP configuration on Switch 3.

Action

Issue the operational mode commands show spanning-tree interface and show spanning-tree bridge:

Meaning

The operational mode command show spanning-tree interface displays spanning-tree domain information such as the designated port and the port roles. Switch 3 is the root bridge for instance 0, which is the CIST, as well as for instance 1. In both instances, all ports on Switch 3 are designated ports.

The operational mode command show spanning-tree bridge displays the spanning-tree domain information at either the bridge level or the interface level. If the optional interface name is omitted, all interfaces in the spanning-tree domain are displayed.

Verifying MSTP Configuration on Switch 4

Purpose

Verify the MSTP configuration on Switch 4.

Action

Issue the operational mode commands show spanning-tree interface and show spanning-tree bridge:

Meaning

The operational mode command show spanning-tree interface displays spanning-tree domain information such as the designated port and the port roles.

The operational mode command show spanning-tree bridge displays the spanning-tree domain information at either the bridge level or the interface level. If the optional interface name is omitted, all interfaces in the spanning-tree domain are displayed.

Disabling MSTP

To disable the entire MSTP instance:

  • Include the disable statement. You can include this statement at the following hierarchy levels:

    • [edit logical-systems logical-system-name protocols mstp]

    • [edit logical-systems logical-system-name routing-instances routing-instance-name protocols mstp]

    • [edit protocols mstp]

    • [edit routing-instances routing-instance-name protocols mstp]

Release History Table
Release
Description
15.1
Starting with Junos OS Release 15.1 for EX Series and QFX Series switches with support for the Enhanced Layer 2 Software (ELS) configuration style, you can configure spanning tree parameters globally on all spanning tree interfaces.