Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Spanning Tree Instances and Interfaces

Understanding Spanning-Tree Instance Interfaces

An instance is analogous to one computer process. The 802.1Q standard defines one unique Spanning-Tree instance to be used by all VLANs in the network. STP runs on the Native VLAN so that it can communicate with both 802.1Q and non-802.1Q compatible switches. This single instance of STP is also referred to as 802.1Q Mono Spanning Tree or Common Spanning Tree (CST).

Benefits of Spanning-Tree Instance Interface Configuration

The interface mode allows RSTP, MSTP, and VSTP to converge faster than the original STP on point-to-point links. The protocol does not need to wait for timers on point-to-point links. Configure interfaces that have a point-to-point link to another Layer 2 bridge as p2p. This parameter is ignored if the STP is configured to run the original spanning-tree version.

If the interface (Spanning Tree) mode is configured at both the VSTP global and VLAN levels, the configuration at the VLAN level overrides the global configuration.

How Many Instances Do Spanning Tree Protocols Have?

STP and RSTP are limited to a single instance on any physical interface. Use the interface (Spanning Tree) statement to configure interfaces to participate in the STP or RSTP instance.

MSTP supports multiple instances on a single physical interface. Again, use the interface (Spanning Tree) statement to configure which logical interfaces participate in MSTP.

For VSTP, interfaces can be configured at the global level or at the VLAN level. Interfaces configured at the global VSTP level will be enabled for all the configured VLANs. If an interface is configured at both the global and VLAN levels, the configuration at the VLAN level overrides the global configuration.

Spanning-Tree Instance Interfaces Have Priorities

The reason that instances must have priorities is because a root port for a spanning tree is the interface on the nonroot bridge with the lowest path cost to the root bridge. When multiple interfaces have the same path cost to the root bridge, the interface with the lowest interface priority is selected as the root port.

If the interface priority is not configured and multiple interfaces have the same path cost to the root bridge, the interface with the lowest interface identifier is selected as the root port.

If the interface priority is configured under the MSTP protocol, this becomes the default value for all interfaces. If the interface priority is configured under the MSTI interface, the value overrides the default for that interface.

If the interface priority is configured at both the VSTP global and VLAN levels, the configuration at the VLAN level overrides the global configuration.

What is Spanning-Tree Instance Interface Cost?

The path cost used to calculate the root path cost from any given LAN segment is determined by the total cost of each link in the path. By default, the link cost is determined by the speed of the link. The interface cost can be configured to override the default cost and control which bridge is the designated bridge and which port is the designated port. In MSTP the CIST external path cost is determined by the link speed and the number of hops.

If the interface cost is not configured, the cost is determined by the speed of the interface. For example, a 100-Mbps link has a default path cost of 19, a 1000-Mbps link has a default path cost of 4, and a 10-Gbps link has a default path cost of 2.

If the interface cost is configured under MSTP, this becomes the default value for all interfaces. If the interface cost is configured under the MSTI interface, the value overrides the default for that interface.

If the interface cost is configured at both the VSTP global and VLAN levels, the configuration at the VLAN level overrides the global configuration.

Tip:

The interface cost should be set the same for all interfaces connected to the same LAN segment.

Configuring a Virtual Switch Routing Instance on MX Series Routers

On MX Series routers only, use the virtual-switch routing instance type to isolate a LAN segment with its spanning-tree instance and to separate its VLAN ID space. A bridge domain consists of a set of ports that share the same flooding or broadcast characteristics. Each virtual switch represents a Layer 2 network. You can optionally configure a virtual switch to support Integrated Routing and Bridging (IRB), which facilitates simultaneous Layer 2 bridging and Layer 3 IP routing on the same interface. You can also configure Layer 2 control protocols to provide loop resolution. Protocols supported include the Spanning-Tree Protocol (STP), Rapid Spanning-Tree Protocols (RSTP), Multiple Spanning-Tree Protocol (MSTP), and VLAN Spanning-Tree Protocol (VSTP).

To create a routing instance for a virtual switch, include at least the following statements in the configuration:

For more information about configuring virtual switches, see Configuring a Layer 2 Virtual Switch .

Configuring a Spanning-Tree Instance Interface as an Edge Port for Faster Convergence

RSTP, MSTP, and VSTP instance interfaces configured as edge  ports enable the protocol to converge faster than the original IEEE 802.1D STP version. Edge ports transition directly to the forwarding state, and so the protocol does not need to wait for BPDUs to be received on edge ports.

The Junos OS supports automatic detection of edge ports as described in the RSTP standard. Layer 2 bridges do not expect to receive BPDUs for edge ports. If a BPDU is received for an edge port, the port becomes a non-edge port.

Keep the following guidelines in mind when configuring spanning-tree instance interfaces as edge ports:

  • Do not configure a spanning-tree instance interface as an edge port if it is connected to any Layer 2 bridge. An instance interface connected to Layer 2 bridges but configured as an edge port can cause physical loops.

  • if the spanning-tree protocol is configured to run the original IEEE 802.1D spanning-tree version, the edge-port option (if configured) is ignored.

  • If edge ports are configured at both the VSTP global and VLAN levels, the configuration at the VLAN level overrides the global configuration.