# Spanning Tree

## 1. Function Overview

The spanning tree is a function that maintains redundancies in the network routes while preventing loops.
Normally, the L2 switch floods the adjacent network switch with the broadcast packets.
If the network is constructed as a loop, the network switches will flood each other, causing the loop to occur.
This results in a major degradation of bandwidth and CPU resources in the network switches.
The spanning tree determines the roles of each port and establishes a network construction where the broadcast packets do not keep traveling around, for networks that contain physical loops as well.
When there are problems linking, the problem is detected and the tree is reconstructed in order to restore the system.
This product supports STP, RSTP, and MSTP.

- Spanning tree function overview

## 2. Definition of Terms Used

STP：Spanning Tree Protocol (802.1d)

The spanning tree protocol (STP) exchanges BPDU (bridge protocol data unit) messages, in order to avoid loops.
This product supports IEEE802.1d and RFC4188.

RSTP：Rapid Spanning Tree Protocol (802.1w)

The rapid spanning tree protocol (RSTP) is an extension of STP. It can recover the spanning tree more quickly than STP, when the network architecture has changed or when there is a problem linking.
This product supports IEEE802.1w and RFC4318.

MSTP：Multiple Spanning Tree Protocol (802.1s)

Multiple spanning tree protocol (MSTP) is a further extension of STP and RSTP. It groups the VLAN into instances, and constructs a spanning tree for each group.
This can be used to distribute load within the network routes.
This product supports IEEE802.1s.

## 3. Function Details

This product supports the following functions in order to flexibly handle the construction of routes based on MSTP.

- Setting priority

  - Set bridge priority

  - Set port priority

- Set path cost

- Set timeout

  - Set forward delay time

  - Set maximum aging time

- Specify edge port (Port Fast settings)

- BPDU guard

- BPDU filtering

- Route guard

## 4. Related Commands

Related commands are indicated below.
For details on the commands, refer to the Command Reference.

Operations | Operating commands
--- | ---
Set spanning tree for the system | spanning-tree shutdown
Set forward delay time | spanning-tree forward-time
Set maximum aging time | spanning-tree max-age
Set bridge priority | spanning-tree priority
Set spanning tree for an interface | spanning-tree
Set interface link type | spanning-tree link-type
Set interface BPDU filtering | spanning-tree bpdu-filter
Set interface BPDU guard | spanning-tree bpdu-guard
Set interface path cost | spanning-tree path-cost
Set interface priority | spanning-tree priority
Set edge port for interface | spanning-tree edgeport
Show spanning tree status | show spanning-tree
Show spanning tree BPDU statistics | show spanning-tree statistics
Clear protocol compatibility mode | clear spanning-tree detected protocols
Move to MST mode | spanning-tree mst configuration
Generate MST instance | instance
Set VLAN for MST instance | instance vlan
Set priority of MST instance | instance priority
Set MST region name | region
Set revision number of MST region | revision
Set MST instance for interface | spanning-tree instance
Set interface priority for MST instance | spanning-tree instance priority
Set interface path cost for MST instance | spanning-tree instance path-cost
Show MST region information | show spanning-tree mst config
Show MSTP information | show spanning-tree mst
Show MST instance information | show spanning-tree mst instance

## 5. Examples of Command Execution

### 5.1. MSTP setting example

Use this product to realize the architecture shown in the diagram below.

- MSTP architecture diagram

- In this example, MST instances are used to construct the spanning tree.

- A different route is set for each MST instance (VLAN), in order to distribute network load.

- The LAN port that is connected to the PC is set as the edge port.

■ Setting Procedure

1. [Switch #A] Define VLAN #2 and VLAN #3.

       Yamaha(config)#vlan database
       Yamaha(config-vlan)#vlan 2 (1)
       Yamaha(config-vlan)#vlan 3 (2)
       Yamaha(config-vlan)#exit

   1 | Define VLAN #2
   2 | Define VLAN #3

2. [Switch #A] Set the CIST priority.

       Yamaha(config)#spanning-tree priority 8192 (1)

   1 | Set CIST priority to 8192

3. [Switch #A] Set the MST.

       Yamaha(config)#spanning-tree mst configuration
       Yamaha(config-mst)#region Sample (1)
       Yamaha(config-mst)#revision 1 (2)
       Yamaha(config-mst)#instance 2 vlan 2 (3)
       Yamaha(config-mst)#instance 3 vlan 3 (4)
       Yamaha(config-mst)#exit

   1 | Set the MST region name to “Sample”
   2 | Set the MST revision number to 1
   3 | Define MST instance #2 and associate it with VLAN #2
   4 | Define MST instance #3 and associate it with VLAN #3

4. [Switch #A] Set LAN ports #1–#2 as trunk ports, and associate them with VLAN #2–#3.
   Also, set the MST instances #2–#3.

       Yamaha(config)#interface port1.1
       Yamaha(config-if)#switchport mode trunk (1)
       Yamaha(config-if)#switchport trunk allowed vlan add 2,3 (2)
       Yamaha(config-if)#spanning-tree instance 2 (3)
       Yamaha(config-if)#spanning-tree instance 3 (4)
       Yamaha(config-if)#exit
       (Also perform the above settings for LAN port #2.)

   1 | Set the ports as trunk port
   2 | Associate the ports with VLAN #2 and #3
   3 | Set MST instance #2
   4 | Set MST instance #3

5. [Switch #A] Set LAN port #3 as the access port, and associate it with VLAN #2.
   Also, set the MST instance #2, and make it an edge port.

       Yamaha(config)#interface port1.3
       Yamaha(config-if)#switchport mode access (1)
       Yamaha(config-if)#switchport access vlan 2 (2)
       Yamaha(config-if)#spanning-tree instance 2 (3)
       Yamaha(config-if)#spanning-tree edgeport (4)
       Yamaha(config-if)#exit

   1 | Set the port as access port
   2 | Associate it with VLAN #2
   3 | Set MST instance #2
   4 | Set it as edge port

6. [Switch #A] Set LAN port #4 as the access port, and associate it with VLAN #3.
   Also, set the MST instance #3, and make it an edge port.

       Yamaha(config)#interface port1.4
       Yamaha(config-if)#switchport mode access (1)
       Yamaha(config-if)#switchport access vlan 3 (2)
       Yamaha(config-if)#spanning-tree instance 3 (3)
       Yamaha(config-if)#spanning-tree edgeport (4)
       Yamaha(config-if)#exit

   1 | Set the port as access port
   2 | Associate it with VLAN #3
   3 | Set MST instance #3
   4 | Set it as edge port

7. [Switch #B] Define VLAN #2 and VLAN #3.

       Yamaha(config)#vlan database
       Yamaha(config-vlan)#vlan 2 (1)
       Yamaha(config-vlan)#vlan 3 (2)
       Yamaha(config-vlan)#exit

   1 | Define VLAN #2
   2 | Define VLAN #3

8. [Switch #B] Set the CIST priority.

       Yamaha(config)#spanning-tree priority 16384 (1)

   1 | Set CIST priority to 16384

9. [Switch #B] Set the MST.

       Yamaha(config)#spanning-tree mst configuration
       Yamaha(config-mst)#region Sample (1)
       Yamaha(config-mst)#revision 1 (2)
       Yamaha(config-mst)#instance 2 vlan 2 (3)
       Yamaha(config-mst)#instance 2 priority 8192 (4)
       Yamaha(config-mst)#instance 3 vlan 3 (5)
       Yamaha(config-mst)#instance 3 priority 16384 (6)
       Yamaha(config-mst)#exit

   1 | Set the MST region name to “Sample”
   2 | Set the MST revision number to 1
   3 | Define MST instance #2 and associate it with VLAN #2
   4 | Set the priority of MST instance #2 to 8192
   5 | Define MST instance #3 and associate it with VLAN #3
   6 | Set the priority of MST instance #3 to 16384

10. [Switch #B] Set LAN ports #1–#2 as trunk ports, and associate them with VLAN #2–#3.
    Also, set the MST instances #2–#3.

        Yamaha(config)#interface port1.1
        Yamaha(config-if)#switchport mode trunk (1)
        Yamaha(config-if)#switchport trunk allowed vlan add 2,3 (2)
        Yamaha(config-if)#spanning-tree instance 2 (3)
        Yamaha(config-if)#spanning-tree instance 3 (4)
        Yamaha(config-if)#exit
        (Also perform the above settings for LAN port #2.)

    1 | Set the ports as trunk port
    2 | Associate the ports with VLAN #2 and #3
    3 | Set MST instance #2
    4 | Set MST instance #3

11. [Switch #B] Set LAN port #3 as the access port, and associate it with VLAN #2.
    Also, set the MST instance #2, and make it an edge port.

        Yamaha(config)#interface port1.3
        Yamaha(config-if)#switchport mode access (1)
        Yamaha(config-if)#switchport access vlan 2 (2)
        Yamaha(config-if)#spanning-tree instance 2 (3)
        Yamaha(config-if)#spanning-tree edgeport (4)
        Yamaha(config-if)#exit
        (5)

    1 | Set the port as access port
    2 | Associate it with VLAN #2
    3 | Set MST instance #2
    4 | Set it as edge port
    5 | Configure the settings above for LAN port #4 as well.

12. [Switch #C] Define VLAN #2 and VLAN #3.

        Yamaha(config)#vlan database
        Yamaha(config-vlan)#vlan 2 (1)
        Yamaha(config-vlan)#vlan 3 (2)
        Yamaha(config-vlan)#exit

    1 | Define VLAN #2
    2 | Define VLAN #3

13. [Switch #C] Set the MST.

        Yamaha(config)#spanning-tree mst configuration
        Yamaha(config-mst)#region Sample (1)
        Yamaha(config-mst)#revision 1 (2)
        Yamaha(config-mst)#instance 2 vlan 2 (3)
        Yamaha(config-mst)#instance 2 priority 16384 (4)
        Yamaha(config-mst)#instance 3 vlan 3 (5)
        Yamaha(config-mst)#instance 3 priority 8192 (6)
        Yamaha(config-mst)#exit

    1 | Set the MST region name to “Sample”
    2 | Set the MST revision number to 1
    3 | Define MST instance #2 and associate it with VLAN #2
    4 | Set the priority of MST instance #2 to 16384
    5 | Define MST instance #3 and associate it with VLAN #3
    6 | Set the priority of MST instance #3 to 8192

14. [Switch #C] Set LAN ports #1–#2 as trunk ports, and associate them with VLAN #2–#3.
    Also, set the MST instances #2–#3.

        Yamaha(config)#interface port1.1
        Yamaha(config-if)#switchport mode trunk (1)
        Yamaha(config-if)#switchport trunk allowed vlan add 2,3 (2)
        Yamaha(config-if)#spanning-tree instance 2 (3)
        Yamaha(config-if)#spanning-tree instance 3 (4)
        Yamaha(config-if)#exit
        (Also perform the above settings for LAN port #2.)

    1 | Set the ports as trunk port
    2 | Associate the ports with VLAN #2 and #3
    3 | Set MST instance #2
    4 | Set MST instance #3

15. [Switch #C] Set LAN port #3 as the access port, and associate it with VLAN #3.
    Also, set the MST instance #3, and make it an edge port.

        Yamaha(config)#interface port1.3
        Yamaha(config-if)#switchport mode access (1)
        Yamaha(config-if)#switchport access vlan 3 (2)
        Yamaha(config-if)#spanning-tree instance 3 (3)
        Yamaha(config-if)#spanning-tree edgeport (4)
        Yamaha(config-if)#exit
        (5)

    1 | Set the port as access port
    2 | Associate it with VLAN #3
    3 | Set MST instance #3
    4 | Set it as edge port
    5 | Configure the settings above for LAN port #4 as well.

16. Connect the LAN cable.

17. [Switch #A] Check the CIST architecture.

        Yamaha>show spanning-tree |include Root Id
        % Default: CIST Root Id 200100a0deaeb920 (1)
        % Default: CIST Reg Root Id 200100a0deaeb920

        Yamaha>show spanning-tree |include Role
        %   port1.1: Port Number 905 - Ifindex 5001 - Port Id 0x8389 - Role Designated - State Forwarding
        %   port1.2: Port Number 906 - Ifindex 5002 - Port Id 0x838a - Role Designated - State Forwarding
        %   port1.3: Port Number 907 - Ifindex 5003 - Port Id 0x838b - Role Designated - State Forwarding
        %   port1.4: Port Number 908 - Ifindex 5004 - Port Id 0x838c - Role Designated - State Forwarding
        %   port1.5: Port Number 909 - Ifindex 5005 - Port Id 0x838d - Role Disabled - State Discarding
        %   port1.6: Port Number 910 - Ifindex 5006 - Port Id 0x838e - Role Disabled - State Discarding
        %   port1.7: Port Number 911 - Ifindex 5007 - Port Id 0x838f - Role Disabled - State Discarding
        %   port1.8: Port Number 912 - Ifindex 5008 - Port Id 0x8390 - Role Disabled - State Discarding
        %   port1.9: Port Number 913 - Ifindex 5009 - Port Id 0x8391 - Role Disabled - State Discarding
        %   port1.10: Port Number 914 - Ifindex 5010 - Port Id 0x8392 - Role Disabled - State Discarding

    1 | Switch #A with the higher priority becomes the root bridge of the CIST.

18. [Switch #B] Check the CIST architecture.

        Yamaha>show spanning-tree |include Root Id
        % Default: CIST Root Id 200100a0deaeb920 (1)
        % Default: CIST Reg Root Id 200100a0deaeb920

        Yamaha>show spanning-tree |include Role
        %   port1.1: Port Number 905 - Ifindex 5001 - Port Id 0x8389 - Role Rootport - State Forwarding
        %   port1.2: Port Number 906 - Ifindex 5002 - Port Id 0x838a - Role Designated - State Forwarding
        %   port1.3: Port Number 907 - Ifindex 5003 - Port Id 0x838b - Role Designated - State Forwarding
        %   port1.4: Port Number 908 - Ifindex 5004 - Port Id 0x838c - Role Designated - State Forwarding
        %   port1.5: Port Number 909 - Ifindex 5005 - Port Id 0x838d - Role Disabled - State Discarding
        %   port1.6: Port Number 910 - Ifindex 5006 - Port Id 0x838e - Role Disabled - State Discarding
        %   port1.7: Port Number 911 - Ifindex 5007 - Port Id 0x838f - Role Disabled - State Discarding
        %   port1.8: Port Number 912 - Ifindex 5008 - Port Id 0x8390 - Role Disabled - State Discarding
        %   port1.9: Port Number 913 - Ifindex 5009 - Port Id 0x8391 - Role Disabled - State Discarding
        %   port1.10: Port Number 914 - Ifindex 5010 - Port Id 0x8392 - Role Disabled - State Discarding

    1 | Switch #A with the higher priority becomes the root bridge of the CIST.

19. [Switch #C] Check the CIST architecture.

        Yamaha>show spanning-tree |include Root Id
        % Default: CIST Root Id 200100a0deaeb920 (1)
        % Default: CIST Reg Root Id 200100a0deaeb920

        Yamaha>show spanning-tree |include Role
        %   port1.1: Port Number 905 - Ifindex 5001 - Port Id 0x8389 - Role Alternate - State Discarding (2)
        %   port1.2: Port Number 906 - Ifindex 5002 - Port Id 0x838a - Role Rootport - State Forwarding
        %   port1.3: Port Number 907 - Ifindex 5003 - Port Id 0x838b - Role Designated - State Forwarding
        %   port1.4: Port Number 908 - Ifindex 5004 - Port Id 0x838c - Role Designated - State Forwarding
        %   port1.5: Port Number 909 - Ifindex 5005 - Port Id 0x838d - Role Disabled - State Discarding
        %   port1.6: Port Number 910 - Ifindex 5006 - Port Id 0x838e - Role Disabled - State Discarding
        %   port1.7: Port Number 911 - Ifindex 5007 - Port Id 0x838f - Role Disabled - State Discarding
        %   port1.8: Port Number 912 - Ifindex 5008 - Port Id 0x8390 - Role Disabled - State Discarding
        %   port1.9: Port Number 913 - Ifindex 5009 - Port Id 0x8391 - Role Disabled - State Discarding
        %   port1.10: Port Number 914 - Ifindex 5010 - Port Id 0x8392 - Role Disabled - State Discarding

    1 | Switch #A with the higher priority becomes the root bridge of the CIST.
    2 | The LAN #1 port of Switch #C with the lower priority becomes the alternate port of the CIST.

20. [Switch #A] Check the architecture of MST instance #2.

        Yamaha>show spanning-tree mst instance 2 |include Root Id
        % Default: MSTI Root Id 200200a0deaeb879 (1)

        Yamaha>show spanning-tree mst instance 2 |include Role
        %   port1.1: Port Number 905 - Ifindex 5001 - Port Id 0x8389 - Role Rootport - State Forwarding
        %   port1.2: Port Number 906 - Ifindex 5002 - Port Id 0x838a - Role Alternate - State Discarding (2)
        %   port1.3: Port Number 907 - Ifindex 5003 - Port Id 0x838b - Role Designated - State Forwarding

    1 | Switch #B with the higher priority becomes the root bridge of MST instance #2.
    2 | The LAN #2 port of Switch #A with the lower priority becomes the alternate port of MST instance #2.

21. [Switch #B] Check the architecture of MST instance #2.

        Yamaha>show spanning-tree mst instance 2 |include Root Id
        % Default: MSTI Root Id 200200a0deaeb879 (1)

        Yamaha>show spanning-tree mst instance 2 |include Role
        %   port1.1: Port Number 905 - Ifindex 5001 - Port Id 0x8389 - Role Designated - State Forwarding
        %   port1.2: Port Number 906 - Ifindex 5002 - Port Id 0x838a - Role Designated - State Forwarding
        %   port1.3: Port Number 907 - Ifindex 5003 - Port Id 0x838b - Role Designated - State Forwarding
        %   port1.4: Port Number 908 - Ifindex 5004 - Port Id 0x838c - Role Designated - State Forwarding

    1 | Switch #B with the higher priority becomes the root bridge of MST instance #2.

22. [Switch #C] Check the architecture of MST instance #2.

        Yamaha>show spanning-tree mst instance 2 |include Root Id
        % Default: MSTI Root Id 200200a0deaeb879 (1)

        Yamaha>show spanning-tree mst instance 2 |include Role
        %   port1.1: Port Number 905 - Ifindex 5001 - Port Id 0x8389 - Role Rootport - State Forwarding
        %   port1.2: Port Number 906 - Ifindex 5002 - Port Id 0x838a - Role Designated - State Forwarding

    1 | Switch #B with the higher priority becomes the root bridge of MST instance #2.

23. [Switch #A] Check the architecture of MST instance #3.

        Yamaha>show spanning-tree mst instance 3 |include Root Id
        % Default: MSTI Root Id 200300a0deaeb83d (1)

        Yamaha>show spanning-tree mst instance 3 |include Role
        %   port1.1: Port Number 905 - Ifindex 5001 - Port Id 0x8389 - Role Alternate - State Discarding (2)
        %   port1.2: Port Number 906 - Ifindex 5002 - Port Id 0x838a - Role Rootport - State Forwarding
        %   port1.4: Port Number 908 - Ifindex 5004 - Port Id 0x838c - Role Designated - State Forwarding

    1 | Switch #C with the higher priority becomes the root bridge of MST instance #3.
    2 | The LAN #1 port of Switch #A with the lower priority becomes the alternate port of MST instance #3.

24. [Switch #B] Check the architecture of MST instance #3.

        Yamaha>show spanning-tree mst instance 3 |include Root Id
        % Default: MSTI Root Id 200300a0deaeb83d (1)

        Yamaha>show spanning-tree mst instance 3 |include Role
        %   port1.1: Port Number 905 - Ifindex 5001 - Port Id 0x8389 - Role Designated - State Forwarding
        %   port1.2: Port Number 906 - Ifindex 5002 - Port Id 0x838a - Role Rootport - State Forwarding

    1 | Switch #C with the higher priority becomes the root bridge of MST instance #3.

25. [Switch #C] Check the architecture of MST instance #3.

        Yamaha>show spanning-tree mst instance 3 |include Root Id
        % Default: MSTI Root Id 200300a0deaeb83d (1)

        Yamaha>show spanning-tree mst instance 3 |include Role
        %   port1.1: Port Number 905 - Ifindex 5001 - Port Id 0x8389 - Role Designated - State Forwarding
        %   port1.2: Port Number 906 - Ifindex 5002 - Port Id 0x838a - Role Designated - State Forwarding
        %   port1.3: Port Number 907 - Ifindex 5003 - Port Id 0x838b - Role Designated - State Forwarding
        %   port1.4: Port Number 908 - Ifindex 5004 - Port Id 0x838c - Role Designated - State Forwarding

    1 | Switch #C with the higher priority becomes the root bridge of MST instance #3.

## 6. Points of Caution

- STP and RSTP on this product are supported by backward-compatibility provided by MSTP.

- The maximum number of VLANs that can be associated with an MST instance is 256 across the entire system.

## 7. Related Documentation

- Layer 2 Function: VLAN

- STP

  - IEEE802.1d

  - RFC4188

- RSTP

  - IEEE802.1w

  - RFC4318

- MSTP

  - IEEE802.1s

Search result
No more search results.
There are no topics that match your search query.