Procurve Spanning Tree Priority



The Spanning-Tree port priority is used when switches are interconnected by more than one interface. The forwarding determination is made by using the lowest priority. If all port priorities are the same, the lowest interface number is selected. When a trunk group is created, the port priority is automatically adjusted. By default, Cisco’s Per-VLAN Spanning-Tree plus (PVST+) adds this system ID extension (sys-id-ext) to the bridge priority. The 48 bit (6-byte) MAC address of a switch is used in conjunction with the bridge priority value and the system ID extension as criteria for the root bridge election.

Learning has never been so easy!

Setting up Spanning Tree on HP switches is really easy, after you've done it a couple of times, but getting it configured can seem like a daunting task for beginners, esp. in a production network. Here are some simple steps on how to get it up and running in no time. Note that enabling STP might cause small network outages, so don't do this in a production network if you haven't tried it before!

3 Steps total

Step 1: Start up STP

Select your root bridge (the central most switch in your network). Enter CLI and type 'configure' to enter config mode. Then enter 'spanning-tree' to enable it. That's all you need to do on a switch to get STP up and running.

Step 2: Set root bridge priority

When the switches in your network selects their root bridge, they look at two things, the switch's MAC-address, and a thing called STP priority. From the factory all switches have the same priority (step 8 of the 16 configurable steps) so the switch with the lowest MAC automatically get's selected as root. THIS IS NOT A GOOD THING, as this will basically make your whole network look for the shortest path to a random switch in the network. What we want is for them to find the shortest path to the core switch, so we will alter the priority.

This is easy to do as well. In the same config mode that you just enabled STP in, type 'spanning-tree priority 0'. This sets the root bridge permanently so that it won't ever change without you wanting it. If you have 2 core switches, set the other one to priority 1 so that if the main core fails the whole network will switch to the other one.

Run 'write memory' to save your changes and log out.

Step 3: Repeat Step 1 on all your other switches

Run 'spanning-tree' in the config mode on all your other switches. That's all! Remember to run 'write memory' to save your changes!

This is only a short intro into STP, but it's sufficient for beginners to get started, and after you have this down you can then easily start to add the more exotic features.

Here's the full CLI for those who want it;

Configuring the Root Bridge:
Procurve 4204vl-1# configure
Procurve 4204vl-1(config)# spanning-tree
Procurve 4204vl-1(config)# spanning-tree priority 0
Procurve 4204vl-1(config)# write memory

Configuring the other switches:
Procurve 4204vl-2# configure
Procurve 4204vl-2(config)# spanning-tree
Procurve 4204vl-2(config)# write memory

Published: Jul 15, 2013 · Last Updated: Mar 13, 2015

References

  • Grumpy Techie - How to set up STP on HP Switches

5 Comments

  • Jalapeno
    ToledoTown Jul 15, 2013 at 12:53pm

    Thanks for the post, good STP insight. Here is some more:
    http://www.networkworld.com/community/blog/9-common-spanning-tree-mistakes

  • Ghost Chili
    Nick42 Aug 13, 2013 at 11:38pm

    with all the docs on tweaking STP on Cisco, this is a pretty cool find.

  • Ghost Chili
    Priscilla@HP Oct 3, 2013 at 11:23pm

    Thank you for providing another helpful document to which I can direct HP Networking customers.

  • Pimiento
    mahmad786 Aug 9, 2016 at 07:11am

    (hp5800)# spanning-tree priority 0
    When I tried to set priority 0. It breaks link with every thing.
    Any idea Y

  • Cayenne
    Stuggi Aug 9, 2016 at 07:19am

    That's normal for a short while, it breaks every link since every switch in the network has to find the shortest path to the root bridge. If it's longer than a minute, then you have some other issue. Remember that BDPU messages doesn't take VLANs into account, so if you have links that form a loop on Layer 1, STP will shut those down even though they might be in separate VLANs and not forming a loop on L2.

When you enable MSTP on the switch, a spanning tree instance is enabled automatically. The switch supports up to 16 configurable MST instances for each VLAN group that you want to operate as an active topology within the region to which the switch belongs. When creating an instance, you must include a minimum of one VID. You can add more VIDs later if desired.

IMPORTANT:When the HP 2920 Switch is configured in a stack, the amount of configurable MSTIs is limited to four. If stacking is enabled and a fifth MSTI is created, an error will occur.

However, when the HP 2920 Switch is configured as a standalone, a maximum of 16 MSTIs is supported.

Syntax:

[no] spanning-tree instance <1..4> vlan <vid> [<vid..vid>]

Configuring MSTP on the switch automatically configures the IST instance and places all statically and dynamically configured VLANs on the switch into the IST instance. This command creates a new MST instance (MSTI) and moves the VLANs you specify from the IST to the MSTI.

You must map at least one VLAN to an MSTI when you create it. You cannot map a VLAN ID to more than one instance. You can create up to 16 MSTIs in a region.

Procurve

The no form of the command removes one or more VLANs from the specified MSTI. If no VLANs are specified, the no form of the command deletes the specified MSTI.

When you remove a VLAN from an MSTI, the VLAN returns to the IST instance, where it can remain or be re-assigned to another MSTI configured in the region.

NOTE: You can enter the spanning-tree instance vlan command before a static or dynamic VLAN is configured on the switch to preconfigure VLAN ID-to-MSTI mappings. No error message is displayed. Later, each newly configured VLAN that has already been associated with an MSTI is automatically assigned to the MSTI.

This new default behavior differs from automatically including configured (static and dynamic) VLANs in the IST instance and requiring the manual assigning of individual static VLANs to an MSTI.

NOTE: The valid VLAN IDs that you can map to a specified MSTI are from 1 to 4094. The VLAN ID-to-MSTI mapping does not require a VLAN to be already configured on the switch. The MSTP VLAN enhancement allows you to preconfigure MSTP topologies before the VLAN IDs associated with each instance exist on a switch.

Syntax:

spanning-tree instance <1..4> priority <priority-multiplier>

Sets the switch (bridge) priority for the designated instance. This priority is compared with the priorities of other switches in the same instance to determine the root switch. The lower the priority value, the higher the priority. If there is only one switch in the instance, then that switch is the root switch for the instance. The IST regional root bridge provides the path to instances in other regions that share one or more of the same VLANs.

The priority range for an MSTP switch is 0 - 61440. However, this command specifies the priority as a multiplier (0 - 15) of 4096. When a priority multiplier value is set from 0 - 15, the actual priority assigned to the switch for the specified MST instance is: (priority-multiplier) x 4096

For example, if you configure 5 as the priority-multiplier for MST Instance 1 on a given MSTP switch, the Switch Priority setting is 20,480 for that instance in that switch.

NOTE: If multiple switches in the same MST instance have the same priority setting, the switch with the lowest MAC address becomes the root switch for that instance.

Syntax:

spanning-tree instance <ist | 1..4> <port-list> path-cost [auto | <1..200000000>]

Assigns an individual port cost for the IST or for the specified MST instance.

For a given port, the path cost setting can be different for different MST instances to which the port may belong. The switch uses the path cost to determine which ports are the forwarding ports in the instance; that is, which links to use for the active topology of the instance and which ports to block.

Tree

The settings are either auto or in a range from 1 to 200,000,000. With the auto setting, the switch calculates the path cost from the link speed:

10 Mbps

2000000

100 Mbps

200000

1 Gbps

20000

Default

Auto

Setting the priority for a port in a specified MST instance

Syntax:

spanning-tree instance <1..4 port-list> priority <priority-multiplier>

Sets the priority for the specified ports in the specified MST instance.

Procurve Spanning Tree Port Priority

For a given port, the priority setting can be different for different MST instances to which the port may belong. The priority range for a port in a given MST instance is 0 - 255. However, this command specifies the priority as a multiplier (0 - 15) of 16. When you specify a priority multiplier of 0 - 15, the actual priority assigned to the switch is: (priority-multiplier) x 16

Setting priority for a port in a specified MST instance

If you configure 2 as the priority multiplier on a given port in an MST instance, then the actual Priority setting is 32x. After you specify the port priority multiplier in an instance, the switch displays the actual port priority and not the multiplier in the show spanning-tree instance <1..4> or show spanning-tree <port-list> instance <1..4> displays.

You can view the actual multiplier setting for ports in the specified instance by executing show running and looking for an entry in the following format:

spanning-tree instance < 1..4 port-list> priority <priority-multiplier>

For example, configuring port A2 with a priority multiplier of 3 in instance 1, results in this line in the show running output:

Setting the priority for specified ports for the IST

Syntax:

spanning-tree <port-list> priority <priority-multiplier>

Sets the priority for the specified ports for the IST (Instance 0) of the region in which the switch resides.

Procurve

The priority component of the port's Port Identifier is set. The Port Identifier is a unique identifier that helps distinguish this switch's ports from all others. It consists of the priority value with the port number extension—PRIORITY:PORT_NUMBER. A port with a lower value of Port Identifier is more likely to be included in the active topology.

This priority is compared with the priorities of other ports in the IST to determine which port is the root port for the IST instance. The lower the priority value, the higher the priority. The IST root port (or trunk) in a region provides the path to connected regions for the traffic in VLANs assigned to the region's IST instance.

The priority range for a port in a given MST instance is 0 - 240. However, this command specifies the priority as a multiplier (0 - 15) of 16. When you specify a priority multiplier of 0 - 15, the actual priority assigned to the switch is: (priority-multiplier) x 16

Setting priority for specified ports for an IST

Configuring 5 as the priority multiplier on a given port in the IST instance for a region creates an actual priority setting of 80. After specifying the port priority multiplier for the IST instance, the switch displays the actual port priority, not the multiplier, in the show spanning-tree instance ist or show spanning-tree <port-list> instance ist displays. You can view the actual multiplier setting for ports in the IST instance by executing show running and looking for an entry in this format:

spanning-tree <port-list> priority <priority-multiplier>

Tree

So configuring port A2 with a priority multiplier of 2 in the IST instance, results in this line in the show running output:

Hp Procurve Configure Spanning Tree Priority

This command enables or disables spanning tree operation for any spanning tree protocol enabled on the switch. Before using to enable spanning tree, ensure that the right version is active on the switch.

Syntax:

Procurve Spanning Tree Priority Algorithm

Enables or disables spanning tree. Enabling spanning tree with MSTP configured, implements MSTP for all physical ports on the switch according to the VLAN groupings for the IST instance and any other configured instances.

Disabling MSTP removes protection against redundant loops that can significantly slow or halt a network.

This command simply turns spanning tree on or off. It does not change the existing spanning tree configuration.

NOTE: The convergence time for implementing MSTP changes can be disruptive to your network. To minimize such disruption, consider using the spanning-tree pending command (see Enabling an entire MST region at once or exchanging one region configuration for another).

Enabling an entire MST region at once or exchanging one region configuration for another

This operation exchanges the currently active MSTP configuration with the currently pending MSTP configuration, making it possible to implement a new MSTP configuration with minimal network disruption or to exchange MSTP configurations for testing or troubleshooting purposes.

When configuring or reconfiguring MSTP, the switch recalculates the corresponding network paths. This can have a ripple effect throughout your network as adjacent MSTP switches recalculate network paths to support the configuration changes invoked in a single switch. Although MSTP employs rapid spanning tree operation, the convergence time for implementing MSTP changes can be disruptive to your network. However, by using the spanning-tree pending feature, you can set up an MSTP on the switch and then invoke all instances of the new configuration at the same time, instead of one at a time.

Syntax:

Hp Procurve Spanning-tree Priority 0

[no] spanning-tree pending [ apply | <config-name> | <config-revision> | instance | reset ]

Exchanges the currently active MSTP configuration with the current pending MSTP configuration. Options are as follows:

apply

Exchanges the currently active MSTP configuration with the pending MSTP configuration.

<config-name>

Specifies the pending MST region name. Must be the same for all MSTP switches in the region. (Default: The switch's MAC address.)

<config-revision>

Specifies the pending MST region configuration revision number. Must be the same for all MSTP switches in the region. (Default: 0).


Creates the pending instance and assigns one or more VLANs to the instance.

reset

Copies the switch's currently active MSTP configuration to the pending configuration. This is useful when you want to experiment with the current MSTP configuration while maintaining an unchanged version.

To create a pending MSTP configuration and exchange it with the active MSTP configuration:

Procurve Spanning Tree Trk1 Priority 4

  1. Configure the VLANs to include in any instances in the new region. When you execute the pending command, all VLANs configured on the switch will be assigned to a single pending IST instance unless assigned to other, pending MST instances. The pending command creates the region's IST instance automatically.

  2. Configure MSTP as the spanning tree protocol, then execute write mem and reboot. The pending option is available only with MSTP enabled.

  3. Configure the pending region <config-name> to assign to the switch.

  4. Configure the pending <config-revision> number for the region name.

  5. If you want an MST instance other than the IST instance, configure the instance number and assign the appropriate VLANs (VIDs) using the pending instance <1..4> vlan [ vid | <vid-range> ]

  6. Repeat step 5 for each additional MST instance necessary.

  7. To review your pending configuration, use the show spanning-tree pending command.

  8. To exchange the currently active MSTP configuration with the pending MSTP configuration, use the spanning-tree pending apply command.