Table Of Contents
Configuring Spanning Tree
Understanding How Spanning Tree Protocols Work
Understanding How a Topology is Created
Understanding How a Switch Becomes the Root Switch
Understanding How Bridge Protocol Data Units Work
Calculating and Assigning Port Costs
Calculating the Port Cost Using the Short Method
Calculating the Port Cost Using the Long Method
Calculating the Port Cost for Aggregate Links
Spanning Tree Port States
Blocking State
Listening State
Learning State
Forwarding State
Disabled State
Understanding PVST+ and MISTP Modes
PVST+ Mode
MISTP Mode
MISTP-PVST+ Mode
Bridge Identifiers
MAC Address Allocation
MAC Address Reduction
Using PVST+
Default PVST+ Configuration
Setting the PVST+ Bridge ID Priority
Configuring the PVST+ Port Cost
Configuring the PVST+ Port Priority
Configuring the PVST+ Default Port Cost Mode
Configuring the PVST+ Port Cost for a VLAN
Configuring the PVST+ Port Priority for a VLAN
Disabling the PVST+ Mode on a VLAN
Using MISTP-PVST+ or MISTP
Default MISTP and MISTP-PVST+ Configuration
Setting MISTP-PVST+ Mode or MISTP Mode
Configuring an MISTP Instance
Configuring the MISTP Bridge ID Priority
Configuring the MISTP Port Cost
Configuring the MISTP Port Priority
Configuring the MISTP Port Instance Cost
Configuring the MISTP Port Instance Priority
Enabling an MISTP Instance
Mapping VLANs to an MISTP Instance
Determining MISTP Instances—VLAN Mapping Conflicts
Unmapping VLANs from an MISTP Instance
Disabling MISTP-PVST+ or MISTP
Configuring a Root Switch
Configuring a Primary Root Switch
Configuring a Secondary Root Switch
Configuring a Root Switch to Improve Convergence
Using Root Guard—Preventing Switches from Becoming Root
Configuring Spanning Tree Timers
Configuring the Hello Time
Configuring the Forward Delay Time
Configuring the Maximum Aging Time
Understanding How BPDU Skewing Works
Configuring BPDU Skewing
Configuring Spanning Tree
This chapter describes the IEEE 802.1D bridge Spanning Tree Protocol (STP) and how to use and configure Cisco's proprietary spanning tree protocols, Per VLAN Spanning Tree + (PVST+) and Multi-Instance Spanning Tree Protocol (MISTP), on the Catalyst 6000 family switches.
Note
For information on configuring the spanning tree PortFast, UplinkFast, and BackboneFast features, see "Configuring Spanning Tree PortFast, UplinkFast, BackboneFast, and Loop Guard."
This chapter consists of these sections:
•
Understanding How Spanning Tree Protocols Work
•
Understanding PVST+ and MISTP Modes
•
Bridge Identifiers
•
Using PVST+
•
Using MISTP-PVST+ or MISTP
•
Configuring a Root Switch
•
Configuring Spanning Tree Timers
•
Understanding How BPDU Skewing Works
•
Configuring BPDU Skewing
Note
For complete syntax and usage information for the commands used in this chapter, refer to the Catalyst 6000 Family Command Reference publication.
Understanding How Spanning Tree Protocols Work
This section describes the specific functions that are common to all spanning tree protocols. Cisco's proprietary spanning tree protocols, PVST+ and MISTP, are based on IEEE 802.1D STP. (See the "Understanding PVST+ and MISTP Modes" section for information about PVST+ and MISTP.) The 802.1D STP is a Layer 2 management protocol that provides path redundancy in a network while preventing undesirable loops. All spanning tree protocols use an algorithm that calculates the best loop-free path through the network.
The Spanning Tree Protocol (STP) uses a distributed algorithm that selects one bridge of a redundantly connected network as the root of a spanning tree connected active topology. STP assigns roles to each port depending on what the port's function is in the active topology. Port roles are as follows:
•
Root—A unique forwarding port elected for the spanning tree topology
•
Designated—A forwarding port elected for every switched LAN segment
•
Alternate—A blocked port providing an alternate path to the root port in the spanning tree
•
Backup—A blocked port in a loopback configuration
Switches that have ports with these assigned roles are called root or designated switches. For more information, see the "Understanding How a Switch Becomes the Root Switch" section.
In Ethernet networks, only one active path may exist between any two stations. Multiple active paths between stations can cause loops in the network. When loops occur, some switches recognize stations on both sides of the switch. This situation causes the forwarding algorithm to malfunction allowing duplicate frames to be forwarded.
Spanning tree algorithms provide path redundancy by defining a tree that spans all of the switches in an extended network and then forces certain redundant data paths into a standby (blocked) state. At regular intervals, the switches in the network send and receive spanning tree packets that they use to identify the path. If one network segment becomes unreachable, or if spanning tree costs change, the spanning tree algorithm reconfigures the spanning tree topology and reestablishes the link by activating the standby path.
Spanning tree operation is transparent to end stations, which do not detect whether they are connected to a single LAN segment or a switched LAN of multiple segments.
These sections describe the STP:
•
Understanding How a Topology is Created
•
Understanding How a Switch Becomes the Root Switch
•
Understanding How Bridge Protocol Data Units Work
•
Calculating and Assigning Port Costs
•
Spanning Tree Port States
Understanding How a Topology is Created
All switches in an extended LAN participating in a spanning tree gather information about other switches in the network through an exchange of data messages known as bridge protocol data units (BPDUs). This exchange of messages results in the following actions:
•
A unique root switch is elected for the spanning tree network topology
•
A designated switch is elected for every switched LAN segment
•
Any loops in the switched network are eliminated by placing redundant switch ports in a backup state; all paths that are not needed to reach the root switch from anywhere in the switched network are placed in STP-blocked mode.
The topology of an active switched network is determined by the following:
•
The unique switch identifier Media Access Control ([MAC] address of the switch) associated with each switch
•
The path cost to the root associated with each switch port
•
The port identifier (MAC address of the port) associated with each switch port
In a switched network, the root switch is the logical center of the spanning tree topology. A spanning tree protocol uses BPDUs to elect the root switch and root port for the switched network, as well as the root port and designated port for each switched segment.
Understanding How a Switch Becomes the Root Switch
If all switches are enabled with default settings, the switch with the lowest MAC address in the network becomes the root switch. In Figure 8-1, Switch A is the root switch because it has the lowest MAC address. However, due to traffic patterns, number of forwarding ports, or line types, Switch A might not be the ideal root switch. A switch can be forced to become the root switch by increasing the priority (that is, lowering the numerical priority number) on the preferred switch. This action causes the spanning tree to recalculate the topology and make the selected switch the root switch.
Figure 8-1 Configuring a Loop-Free Topology
You can change the priority of a port to make it the root port. When the spanning tree topology is based on default parameters, the path between source and destination stations in a switched network might not be ideal. Connecting higher-speed links to a port that has a higher number than the current root port can cause a root-port change. The goal is to make the fastest link the root port.
For example, assume that a port on Switch B is a fiber-optic link. Also, another port on Switch B (an unshielded twisted-pair [UTP] link) is the root port. Network traffic might be more efficient over the high-speed fiber-optic link. By changing the Port Priority parameter for the fiber-optic port to a higher priority (lower numerical value) than the UTP port, the fiber-optic port becomes the root port. You could also accomplish this scenario by changing the Port Cost parameter for the fiber-optic port to a lower value than that of the UTP port.
Understanding How Bridge Protocol Data Units Work
BPDUs contain configuration information about the transmitting switch and its ports, including switch and port MAC addresses, switch priority, port priority, and port cost. Each configuration BPDU contains this information:
•
The unique identifier of the switch that the transmitting switch believes to be the root switch
•
The cost of the path to the root from the transmitting port
•
The identifier of the transmitting port
The switch sends configuration BPDUs to communicate and compute the spanning tree topology. A MAC frame conveying a BPDU sends the switch group address to the destination address field. All switches connected to the LAN on which the frame is transmitted receive the BPDU. BPDUs are not directly forwarded by the switch, but the receiving switch uses the information in the frame to calculate a BPDU, and if the topology changes, initiates a BPDU transmission.
A BPDU exchange results in the following:
•
One switch is elected as the root switch.
•
The shortest distance to the root switch is calculated for each switch.
•
A designated switch is selected. This is the switch that is closest to the root switch through which frames will be forwarded to the root.
•
A port for each switch is selected. This is the port that provides the best path from the switch to the root switch.
•
Ports included in the STP are selected.
Calculating and Assigning Port Costs
By calculating and assigning the port cost of the switch ports, you can ensure that the shortest (lowest cost) distance to the root switch is used to transmit data. You can calculate and assign lower path cost values (port costs) to higher bandwidth ports by using either the short method (which is the default) or the long method. Two methods are available for calculating the default port cost: the short method and the long method. The short method uses a 16-bit format that yields values from 1 to 65535. The long method uses a 32-bit format that yields values in the range of 1 to 200,000,000. For steps for setting the default cost mode, see the "Configuring the PVST+ Default Port Cost Mode" section
Note
You should configure all switches in your network to use the same method for calculating port cost. The short method is used to calculate the port cost unless you specify that the long method be used. You can specify the calculation method using the CLI.
Calculating the Port Cost Using the Short Method
The IEEE 802.1D specification assigns 16-bit (short) default port cost values to each port based on bandwidth. You can also manually assign port costs between 1 and 65535. The 16-bit values are only used for ports that have not been specifically configured for port cost. Table 8-1 shows the default port cost values that are assigned by the switch for each type of port when you use the short method to calculate the port cost.
Table 8-1 Default Port Cost Values Using the Short Method
Port Speed
|
Default Cost Value
|
Default Range
|
10 Mbps
|
100
|
1 to 65535
|
100 Mbps
|
19
|
1 to 65535
|
1 Gbps
|
4
|
1 to 65535
|
Calculating the Port Cost Using the Long Method
802.1t assigns 32-bit (long) default port cost values to each port using a formula that is based on the bandwidth of the port. You can also manually assign port costs between 1 and 200,000,000. The formula for obtaining default 32-bit port costs is to divide the bandwidth of the port by 200,000,000. Table 8-1 shows the default port cost values that are assigned by the switch and the recommended cost values and ranges for each type of port when you use the long method to calculate port cost.
Table 8-2 Default Port Cost Values Using the Long Method
Port Speed
|
Recommended Value
|
Recommended Range
|
Available Range
|
£ 100 kbps
|
200000000
|
20000000 to 200000000
|
1 to 200000000
|
1 Mbps
|
20000000
|
2000000 to 200000000
|
1 to 200000000
|
10 Mbps
|
2000000
|
200000 to 20000000
|
1 to 200000000
|
100 Mbps
|
200000
|
20000 to 2000000
|
1 to 200000000
|
1 Gbps
|
20000
|
2000 to 200000
|
1 to 200000000
|
10 Gbps
|
2000
|
200 to 20000
|
1 to 200000000
|
Calculating the Port Cost for Aggregate Links
•
As individual links are added or removed from an aggregate link (port bundle), the bandwidth of the aggregate link increases or decreases. These changes in bandwidth lead to recalculation of the default port cost for the aggregated port. Changes to the default port cost or changes resulting from links that autonegotiate their bandwidth could lead to recalculation of the spanning tree topology which may not be desirable, especially if the added or removed link is of little consequence to the bandwidth of the aggregate link (for example, if a 10-Mbps link were removed from a 10-Gbps aggregate link). Because of the limitations presented by automatically recalculating the topology, 802.1t states that changes in bandwidth will not result in changes to the cost of the port concerned. The aggregated port will therefore use the same port cost parameters as a stand alone port.
Spanning Tree Port States
Topology changes can take place in a switched network due to a link coming up or a link going down (failing). When a switch port transitions directly from nonparticipation in the topology to the forwarding state, it can create temporary data loops. Ports must wait for new topology information to propagate through the switches in the LAN before they can start forwarding frames. Also, they must allow the frame lifetime to expire for frames that have been forwarded using the old topology.

Note
With IOS Release 12.1.(1)E or later releases on the Multilayer Switch Feature Card (MSFC), the Address Resolution Protocol (ARP) on the STP Topology Change Notification feature ensures that excessive flooding does not occur when the MSFC receives a topology change notification (TCN) from the supervisor engine. The feature causes the MSFC to send ARP requests for all the ARP entries belonging to the VLAN interface where the TCN is received. When the ARP replies come back, the Policy Feature Card (PFC) learns the MAC entries, which were lost as a result of the topology change. Learning the entries immediately following a topology change prevents excessive flooding later. There is no configuration required on the MSFC. This feature works with supervisor engine software release 5.4(2) or later releases.
At any given time, each port on a switch using a spanning tree protocol is in one of these states:
•
Blocking
•
Listening
•
Learning
•
Forwarding
•
Disabled
A port moves through these states as follows:
•
From initialization to blocking
•
From blocking to listening or to disabled
•
From listening to learning or to disabled
•
From learning to forwarding or to disabled
•
From forwarding to disabled
Figure 8-2 illustrates how a port moves through the states.
Figure 8-2 STP Port States
You can modify each port state by using management software, for example, VLAN Trunking Protocol (VTP). When you enable spanning tree, every switch in the network goes through the blocking state and the transitory states of listening and learning at power up. If properly configured, each port stabilizes into the forwarding or blocking state.
When the spanning tree algorithm places a port in the forwarding state, the following occurs:
•
The port is put into the listening state while it waits for protocol information that suggests it should go to the blocking state.
•
The port waits for the expiration of a protocol timer that moves the port to the learning state.
•
In the learning state, the port continues to block frame forwarding as it learns station location information for the forwarding database.
•
The expiration of a protocol timer moves the port to the forwarding state, where both learning and forwarding are enabled.
Blocking State
A port in the blocking state does not participate in frame forwarding (see Figure 8-3). After initialization, a BPDU is sent to each port in the switch. A switch initially assumes it is the root until it exchanges BPDUs with other switches. This exchange establishes which switch in the network is really the root. If only one switch resides in the network, no exchange occurs, the forward delay timer expires, and the ports move to the listening state. A switch always enters the blocking state following switch initialization.
Figure 8-3 Port 2 in Blocking State
A port in the blocking state performs as follows:
•
Discards frames received from the attached segment.
•
Discards frames switched from another port for forwarding.
•
Does not incorporate station location into its address database. (There is no learning on a blocking port, so there is no address database update.)
•
Receives BPDUs and directs them to the system module.
•
Does not transmit BPDUs received from the system module.
•
Receives and responds to network management messages.
Listening State
The listening state is the first transitional state a port enters after the blocking state. The port enters this state when the spanning tree determines that the port should participate in frame forwarding. Learning is disabled in the listening state. Figure 8-4 shows a port in the listening state.
Figure 8-4 Port 2 in Listening State
A port in the listening state performs as follows:
•
Discards frames received from the attached segment.
•
Discards frames switched from another port for forwarding.
•
Does not incorporate station location into its address database. (There is no learning at this point, so there is no address database update.)
•
Receives BPDUs and directs them to the system module.
•
Processes BPDUs received from the system module.
•
Receives and responds to network management messages.
Learning State
A port in the learning state prepares to participate in frame forwarding. The port enters the learning state from the listening state. Figure 8-5 shows a port in the learning state.
A port in the learning state performs as follows:
•
Discards frames received from the attached segment.
•
Discards frames switched from another port for forwarding.
•
Incorporates station location into its address database.
•
Receives BPDUs and directs them to the system module.
•
Receives, processes, and transmits BPDUs received from the system module.
•
Receives and responds to network management messages.
Figure 8-5 Port 2 in Learning State
Forwarding State
A port in the forwarding state forwards frames, as shown in Figure 8-6. The port enters the forwarding state from the learning state.
Figure 8-6 Port 2 in Forwarding State
A port in the forwarding state performs as follows:
•
Forwards frames received from the attached segment.
•
Forwards frames switched from another port for forwarding.
•
Incorporates station location information into its address database.
•
Receives BPDUs and directs them to the system module.
•
Processes BPDUs received from the system module.
•
Receives and responds to network management messages.
Caution 
Use spanning tree PortFast mode only on ports directly connected to individual workstations to allow these ports to come up and go directly to the forwarding state, instead of having to go through the entire spanning tree initialization process. To prevent illegal topologies, enable spanning tree on ports connected to switches or other devices that forward messages. For more information about PortFast, see
"Configuring Spanning Tree PortFast, UplinkFast, BackboneFast, and Loop Guard."
Disabled State
A port in the disabled state does not participate in frame forwarding or STP, as shown in Figure 8-7. A port in the disabled state is virtually nonoperational.
Figure 8-7 Port 2 in Disabled State
A disabled port performs as follows:
•
Discards frames received from the attached segment.
•
Discards frames switched from another port for forwarding.
•
Does not incorporate station location into its address database. (There is no learning, so there is no address database update.)
•
Receives BPDUs but does not direct them to the system module.
•
Does not receive BPDUs for transmission from the system module.
•
Receives and responds to network management messages.
Understanding PVST+ and MISTP Modes
Catalyst 6000 family switches provide two proprietary spanning tree modes based on the IEEE 802.1D standard and one mode that is a combination of the two modes:
•
Per VLAN Spanning Tree (PVST+)
•
Multi-Instance Spanning Tree Protocol (MISTP)
•
MISTP-PVST+ (combination mode)
An overview of each mode is provided in this section. Each mode is described in detail in these sections:
•
Using PVST+
•
Using MISTP-PVST+ or MISTP
Caution 
If your network currently uses PVST+ and you plan to use MISTP on any switch, you must first enable MISTP-PVST+ on the switch and configure an MISTP instance to avoid causing loops in the network.
PVST+ Mode
PVST+ is the default spanning tree protocol used on all Ethernet, Fast Ethernet, and Gigabit Ethernet port-based VLANs on Catalyst 6000 family switches. PVST+ runs on each VLAN on the switch, ensuring that each VLAN has a loop-free path through the network.
PVST+ provides Layer 2 load balancing for the VLAN on which it runs; you can create different logical topologies using the VLANs on your network to ensure that all the links are used and no link is oversubscribed.
Each PVST+ instance on a VLAN has a single root switch. This root switch propagates the spanning tree information associated with that VLAN to all other switches in the network. This process ensures that the network topology is maintained because each switch has the same knowledge about the network.
MISTP Mode
MISTP is an optional spanning tree protocol that runs on Catalyst 6000 family switches. MISTP allows you to group multiple VLANs under a single instance of spanning tree (an MISTP instance). MISTP combines the Layer 2 load-balancing benefits of PVST+ with the lower CPU load of IEEE 802.1Q.
An MISTP instance is a virtual logical topology defined by a set of bridge and port parameters. When you map VLANs to an MISTP instance, this virtual logical topology becomes a physical topology. Each MISTP instance has its own root switch and a different set of forwarding links, that is, different bridge and port parameters.
Each MISTP instance root switch propagates the information associated with it to all other switches in the network. This process maintains the network topology because it ensures that each switch has the same information about the network.
MISTP builds MISTP instances by exchanging MISTP BPDUs with peer entities in the network. MISTP uses one BPDU for each MISTP instance, rather than one for each VLAN, as in PVST+. Because there are fewer BPDUs in an MISTP network, MISTP networks converge faster with less overhead. MISTP discards PVST+ BPDUs.
An MISTP instance can have any number of VLANs mapped to it, but a VLAN can be mapped only to a single MISTP instance. You can easily move a VLAN (or VLANs) in an MISTP topology to another MISTP instance if it has converged. (However, if ports are added at the same time the VLAN is moved, convergence time is required.)
MISTP-PVST+ Mode
MISTP-PVST+ is a transition spanning tree mode that allows you to use the MISTP functionality on Catalyst 6000 family switches while continuing to communicate with Catalyst 5000 and 6000 switches in your network that use PVST+. A switch using PVST+ mode that is connected to a switch using MISTP mode cannot see the BPDUs of the other switch, a condition that can cause loops in the network. MISTP-PVST+ allows interoperability between PVST+ and pure MISTP because it sees the BPDUs of both modes. To convert your network to MISTP, use MISTP-PVST+ to transition the network from PVST+ to MISTP.
Because MISTP-PVST+ conforms to the limits of PVST+, you cannot configure more VLAN ports on your MISTP-PVST+ switches than on your PVST+ switches.
Bridge Identifiers
These sections explain how MAC addresses are used in PVST+ and MISTP as unique bridge identifiers:
•
MAC Address Allocation
•
MAC Address Reduction
MAC Address Allocation
Catalyst 6000 family switches have a pool of 1024 MAC addresses that can be used as bridge identifiers for VLANs running under PVST+ or for MISTP instances. You can use the show module command to view the MAC address range.
MAC addresses are allocated sequentially, with the first MAC address in the range assigned to VLAN 1, the second MAC address in the range assigned to VLAN 2, and so on. The last MAC address in the range is assigned to the supervisor engine in-band (sc0) management interface.
For example, if the MAC address range is 00-e0-1e-9b-2e-00 to 00-e0-1e-9b-31-ff, the VLAN 1 bridge ID is 00-e0-1e-9b-2e-00, the VLAN 2 bridge ID is 00-e0-1e-9b-2e-01, the VLAN 3 bridge ID is 00-e0-1e-9b-2e-02, and so forth. The in-band (sc0) interface MAC address is 00-e0-1e-9b-31-ff.
MAC Address Reduction
For Catalyst family switches that support 4096 VLANs, MAC address reduction allows up to 4096 VLANs running under PVST+ or 16 MISTP instances to have unique identifiers without increasing the number of MAC addresses required on the switch. MAC address reduction reduces the number of MAC addresses required by the STP from one per VLAN or MISTP instance to one per switch. However, because VLANs running under PVST+ and MISTP instances running under MISTP-PVST+ or MISTP are considered logical bridges, each bridge must have its own unique identifier in the network.
When you enable MAC address reduction, the bridge identifier stored in the spanning tree BPDU contains an additional field called the system ID extension. Combined with the bridge priority, the system ID extension functions as the unique identifier for a VLAN or an MISTP instance. The system ID extension is always the number of the VLAN or the MISTP instance; for example, the system ID extension for VLAN 100 is 100, and the system ID extension for MISTP instance 2 is 2.
Figure 8-8 shows the bridge identifier when you do not enable MAC address reduction. The bridge identifier consists of the bridge priority and the MAC address.
Figure 8-8 Bridge Identifier without MAC Address Reduction
Figure 8-9 shows the bridge identifier when you enable MAC address reduction. The bridge identifier consists of the bridge priority, the system ID extension, and the MAC address. The bridge priority and the system ID extension combined are known as the bridge ID priority. The bridge ID priority is the unique identifier for the VLAN or the MISTP instance.
Figure 8-9 Bridge Identifier with MAC Address Reduction Enabled
When you enter a show spantree command, you can see the bridge ID priority for a VLAN in PVST+ or for an MISTP instance in MISTP or MISTP-PVST+ mode.
This example shows the bridge ID priority for VLAN 1 when you enable MAC address reduction in PVST+ mode. The unique identifier for this VLAN is 32769.
Console> (enable) show spantree 1
Bridge ID MAC ADDR 00-d0-00-4c-18-00
Bridge ID Priority 32769 (bridge priority: 32768, sys ID ext: 1)
Bridge Max Age 20 sec Hello Time 2 sec Forward Delay 15 sec
If you have a Catalyst switch in your network with MAC address reduction enabled, you should also enable MAC address reduction on all other Layer-2 connected switches to avoid undesirable root election and spanning tree topology issues.
When MAC address reduction is enabled, the root bridge priority becomes a multiple of 4096 plus the VLAN ID. With MAC address reduction enabled, a switch bridge ID (used by the spanning-tree algorithm to determine the identity of the root bridge, the lowest being preferred) can only be specified as a multiple of 4096. Only the following values are possible: 0, 4096, 8192, 12288, 16384, 20480, 24576, 28672, 32768, 36864, 40960, 45056, 49152, 53248, 57344, and 61440.
Therefore, if another bridge in the same spanning-tree domain does not run the MAC address reduction feature, it could claim and win root bridge ownership because of the finer granularity in the selection of its bridge ID.
Note
The MAC address reduction feature is enabled by default on Cisco switches that have 64 MAC addresses (Cisco 7606, CISCO7603, WS-C6503, and WS-C6513).
Using PVST+
PVST+ is the default spanning tree mode for Catalyst 6000 family switches. These sections describe how to configure PVST+ on Ethernet VLANs:
•
Default PVST+ Configuration
•
Setting the PVST+ Bridge ID Priority
•
Configuring the PVST+ Port Cost
•
Configuring the PVST+ Port Priority
•
Configuring the PVST+ Default Port Cost Mode
•
Configuring the PVST+ Port Cost for a VLAN
•
Configuring the PVST+ Port Priority for a VLAN
•
Disabling the PVST+ Mode on a VLAN
Default PVST+ Configuration
Table 8-3 shows the default PVST+ configuration.
Table 8-3 PVST+ Default Configuration
Feature
|
Default Value
|
VLAN 1
|
All ports assigned to VLAN 1
|
Enable state
|
PVST+ enabled for all VLANs
|
MAC address reduction
|
Disabled
|
Bridge priority
|
32768
|
Bridge ID priority
|
32769 (bridge priority plus system ID extension of VLAN 1)
|
Port priority
|
32
|
Port cost
|
• Gigabit Ethernet: 4
• Fast Ethernet: 191
• FDDI/CDDI: 10
• Ethernet: 1002
|
Default spantree port cost mode
|
Short (802.1D)
|
Port VLAN priority
|
Same as port priority but configurable on a per-VLAN basis in PVST+
|
Port VLAN cost
|
Same as port cost but configurable on a per-VLAN basis in PVST+
|
Maximum aging time
|
20 seconds
|
Hello time
|
2 seconds
|
Forward delay time
|
15 seconds
|
Setting the PVST+ Bridge ID Priority
The bridge ID priority is the priority of a VLAN when the switch is in PVST+ mode.
When the switch is in PVST+ mode without MAC address reduction enabled, you can enter a bridge priority value between 0-65535. The bridge priority value you enter also becomes the VLAN bridge ID priority for that VLAN.
When the switch is in PVST+ mode with MAC address reduction enabled, you can enter one of 16 bridge priority values: 0, 4096, 8192, 12288, 16384, 20480, 24576, 28672, 32768, 36864, 40960, 45056, 49152, 53248, 57344, or 61440.
The bridge priority is combined with the system ID extension (that is, the ID of the VLAN) to create the bridge ID priority for the VLAN.
To set the spanning tree bridge priority for a VLAN, perform this task in privileged mode:
| |
Task
|
Command
|
Step 1
|
Set the PVST+ bridge ID priority for a VLAN.
|
set spantree priority bridge_ID_priority [vlan]
|
Step 2
|
Verify the bridge ID priority.
|
show spantree [vlan] [active]
|
This example shows how to set the PVST+ bridge ID priority when MAC address reduction is not enabled (default):
Console> (enable) set spantree priority 30000 1
Spantree 1 bridge priority set to 30000.
Console> (enable) show spantree 1
Designated Root 00-60-70-4c-70-00
Designated Root Priority 16384
Root Max Age 14 sec Hello Time 2 sec Forward Delay 10 sec
Bridge ID MAC ADDR 00-d0-00-4c-18-00
Bridge Max Age 20 sec Hello Time 2 sec Forward Delay 15 sec
Port Vlan Port-State Cost Prio Portfast Channel_id
------------------------ ---- ------------- --------- ---- -------- ----------
1/1 1 not-connected 4 32 disabled 0
1/2 1 not-connected 4 32 disabled 0
2/1 1 not-connected 100 32 disabled 0
2/2 1 not-connected 100 32 disabled 0
This example shows how to set the PVST+ bridge ID priority when MAC reduction is enabled:
Console> (enable) set spantree priority 32768 1
Spantree 1 bridge ID priority set to 32769
(bridge priority: 32768 + sys ID extension: 1)
Console> (enable) show spantree 1/1 1
Designated Root 00-60-70-4c-70-00
Designated Root Priority 16384
Root Max Age 14 sec Hello Time 2 sec Forward Delay 10 sec
Bridge ID MAC ADDR 00-d0-00-4c-18-00
Bridge ID Priority 32769 (bridge priority: 32768, sys ID ext: 1)
Bridge Max Age 20 sec Hello Time 2 sec Forward Delay 15 sec
Port Vlan Port-State Cost Prio Portfast Channel_id
------------------------ ---- ------------- --------- ---- -------- ----------
1/1 1 not-connected 4 32 disabled 0
1/2 1 not-connected 4 32 disabled 0
2/1 1 not-connected 100 32 disabled 0
2/2 1 not-connected 100 32 disabled 0
Configuring the PVST+ Port Cost
You can configure the port cost of switch ports. The ports with lower port costs are more likely to be chosen to forward frames. Assign lower numbers to ports that are attached to faster media (such as full duplex) and higher numbers to ports that are attached to slower media. The possible cost is from 1 to 65535 when using the short method for calculating port cost and from 1 to 200000000 when using the long method. The default cost differs for different media. For information about calculating port cost, see the "Calculating and Assigning Port Costs" section.
To configure the PVST+ port cost for a port, perform this task in privileged mode:
| |
Task
|
Command
|
Step 1
|
Configure the PVST+ port cost for a switch port.
|
set spantree portcost {mod/port} cost
|
Step 2
|
Verify the port cost setting.
|
show spantree mod/port
|
Note
When you enter the set channel cost command, it does not appear in the configuration file. The command causes a "set spantree portcost" entry to be created for each port in the channel. See the "Setting the EtherChannel Port Path Cost" section in "Configuring EtherChannel," for information on using the set channel cost command.
This example shows how to configure the PVST+ port cost on a port and verify the configuration:
Console> (enable) set spantree portcost 2/3 12
Spantree port 2/3 path cost set to 12.
Console> (enable) show spantree 2/3
Port Vlan Port-State Cost Prio Portfast Channel_id
------------------------ ---- ------------- --------- ---- -------- ----------
1/1 1 not-connected 4 32 disabled 0
1/2 1 not-connected 4 32 disabled 0
2/1 1 not-connected 100 32 disabled 0
2/2 1 not-connected 100 32 disabled 0
2/3 1 forwarding 12 32 disabled 0
2/4 1 not-connected 100 32 disabled
Configuring the PVST+ Port Priority
You can configure the port priority of switch ports in PVST+ mode. The port with the lowest priority value forwards frames for all VLANs. The possible port priority value is 0-63. The default is 32. If all ports have the same priority value, the port with the lowest port number forwards frames.
To configure the PVST+ port priority for a port, perform this task in privileged mode:
| |
Task
|
Command
|
Step 1
|
Configure the PVST+ port priority for a switch port.
|
set spantree portpri mod/port priority
|
Step 2
|
Verify the port priority setting.
|
show spantree mod/port
|
This example shows how to configure the PVST+ port priority for a port:
Console> (enable) set spantree portpri 2/3 16
Bridge port 2/3 port priority set to 16.
Console> (enable) show spantree 2/3
Port Vlan Port-State Cost Prio Portfast Channel_id
------------------------ ---- ------------- --------- ---- -------- ----------
1/1 1 not-connected 4 32 disabled 0
1/2 1 not-connected 4 32 disabled 0
2/1 1 not-connected 100 32 disabled 0
2/2 1 not-connected 100 32 disabled 0
2/3 1 forwarding 19 16 disabled 0
2/4 1 not-connected 100 32 disabled 0
Configuring the PVST+ Default Port Cost Mode
If any switch in your network is using a port speed of 10 Gb or over and the network is using PVST+ spanning tree mode, all switches in the network must have the same path cost defaults. You can enter the set spantree defaultcostmode command to force all VLANs associated with all the ports to have the same port cost default set.
Two default port cost modes are available—short and long.
•
The short mode has these parameters:
–
Portcost
–
Portvlancost (trunk ports only)
–
When uplinkfast is enabled, the actual cost is incremented by 3000
•
The long mode has these parameters:
–
Portcost
–
Portvlancost (trunk ports only)
–
When uplinkfast is enabled, the actual cost is incremented by 10,000,000
–
EtherChannel computes the cost of a bundle using the formula, AVERAGE_COST/NUM_PORT
The default port cost mode is set to short in PVST+ mode. For port speeds of 10 Gb and greater, the default port cost mode must be set to long.
To configure the PVST+ default port cost mode, perform this task in privileged mode:
| |
Task
|
Command
|
| |
Configure the PVST+ default port cost mode.
|
set spantree defaultcostmode {short | long}
|
This example shows how to configure the PVST+ default port cost mode:
Console> (enable) set spantree defaultcostmode long
Portcost and portvlancost set to use long format default values.
Configuring the PVST+ Port Cost for a VLAN
You can configure the port cost of switch ports. The ports with lower port costs are more likely to be chosen to forward frames. Assign lower numbers to ports that are attached to faster media (such as full duplex) and higher numbers to ports that are attached to slower media. The possible cost is from 1 to 65535 when using the short method for calculating port cost and from 1 to 200000000 when using the long method. The default cost differs for different media. For information about calculating port cost, see the "Calculating and Assigning Port Costs" section.
To configure the PVST+ port VLAN cost for a port, perform this task in privileged mode:
| |
Task
|
Command
|
| |
Configure the PVST+ port cost for a VLAN on a port.
|
set spantree portvlancost {mod/port} [cost cost] [vlan_list]
|
Note
When you use the set channel cost command, it does not appear in the configuration file. The command causes a "set spantree portcost" entry to be created for each port in the channel. See the "Setting the EtherChannel Port Path Cost" section in "Configuring EtherChannel," for information on using the set channel cost command.
This example shows how to configure the PVST+ port VLAN cost on port 2/3 for VLANs 1 through 5:
Console> (enable) set spantree portvlancost 2/3 cost 20000 1-5
Port 2/3 VLANs 6-11,13-1005,1025-4094 have path cost 12.
Port 2/3 VLANs 1-5,12 have path cost 20000.
This parameter applies to trunking ports only.
Configuring the PVST+ Port Priority for a VLAN
When the switch is in PVST+ mode, you can set the port priority for a trunking port in a VLAN. The port with the lowest priority value for a specific VLAN forwards frames for that VLAN. The possible port priority range is 0-63. The default is 32. If all ports have the same priority value for a particular VLAN, the port with the lowest port number forwards frames for that VLAN.
The port VLAN priority value must be lower than the port priority value.
To configure the port VLAN priority for a port, perform this task in privileged mode:
| |
Task
|
Command
|
Step 1
|
Configure the PVST+ port priority for a VLAN on a port.
|
set spantree portvlanpri mod/port priority [vlans]
|
Step 2
|
Verify the port VLAN priority.
|
show config all
|
This example shows how to configure the port priority for VLAN 6 on port 2/3:
Console> (enable) set spantree portvlanpri 2/3 16 6
Port 2/3 vlans 6 using portpri 16.
Port 2/3 vlans 1-5,7-800,802-1004,1006-4094 using portpri 32.
Port 2/3 vlans 801,1005 using portpri 4.
This parameter applies to trunking ports only.
Console> (enable) show config all
set spantree portcost 2/12,2/15 19
set spantree portcost 2/1-2,2/4-11,2/13-14,2/16-48 100
set spantree portcost 2/3 12
set spantree portpri 2/1-48 32
set spantree portvlanpri 2/1 0
set spantree portvlanpri 2/2 0
set spantree portvlanpri 2/48 0
set spantree portvlancost 2/1 cost 99
set spantree portvlancost 2/2 cost 99
set spantree portvlancost 2/3 cost 20000 1-5,12
Disabling the PVST+ Mode on a VLAN
When the switch is in PVST+ mode, you can disable spanning-tree on individual VLANs or all VLANs. When you disable spanning tree on a VLAN, the switch does not participate in spanning-tree and any BPDUs received in that VLAN are flooded on all ports.
Caution 
We do not recommend disabling spanning tree, even in a topology that is free of physical loops. Spanning tree serves as a safeguard against misconfigurations and cabling errors. Do not disable spanning tree in a VLAN without ensuring that there are no physical loops present in the VLAN.
Caution 
Do not disable spanning tree on a VLAN unless all switches or routers in the VLAN have spanning tree disabled. You cannot disable spanning tree on some switches or routers in a VLAN and leave spanning tree enabled on other switches or routers in the VLAN. If spanning tree remains enabled on the switches and routers, they will have incomplete information about the physical topology of the network which may cause unexpected results.
To disable PVST+, perform this task in privileged mode:
| |
Task
|
Command
|
| |
Disable PVST+ mode on a VLAN.
|
set spantree disable vlans [all]
|
This example shows how to disable PVST+ on a VLAN:
Console> (enable) set spantree disable 4
Using MISTP-PVST+ or MISTP
The default spanning tree mode on the Catalyst 6000 family switches is PVST+. If you want to use MISTP mode in your network, we recommend you carefully follow the procedures described in the following sections in order to avoid losing connectivity in your network.
When you change the spanning tree mode, the current mode stops, the information collected at runtime is used to build the port database for the new mode, and the new spanning tree mode restarts the computation of the active topology. Information about the port states is lost; however, all of the configuration parameters are preserved for the previous mode. If you return to the previous mode, the configuration is still there.
Note
We recommend that if you use MISTP mode, you should configure all of your Catalyst 6000 family switches to run MISTP.
To use MISTP mode, you first enable an MISTP instance, then map at least one VLAN to the instance. You must have at least one forwarding port in the VLAN in order for the MISTP instance to be active.
Note
Map VLANs to MISTP instances on Catalyst 6000 family switches that are either in VTP server mode or transparent mode only. You cannot map VLANs to MISTP instances on switches that are in VTP client mode.
If you are changing a switch from PVST+ mode to MISTP mode and you have other switches in the network that are using PVST+, you must first enable MISTP-PVST+ mode on each switch on which you intend to use MISTP so that PVST+ BPDUs can flow through the switches while you configure them.
When all switches in the network are configured in MISTP-PVST+, you can then enable MISTP on all of the switches.
These sections describe how to use MISTP-PVST+ or MISTP:
•
Default MISTP and MISTP-PVST+ Configuration
•
Setting MISTP-PVST+ Mode or MISTP Mode
•
Configuring an MISTP Instance
•
Mapping VLANs to an MISTP Instance
•
Disabling MISTP-PVST+ or MISTP
Default MISTP and MISTP-PVST+ Configuration
Table 8-4 shows the default MISTP and MISTP-PVST+ configuration.
Table 8-4 MISTP and MISTP-PVST+ Default Configuration
Feature
|
Default Value
|
Enable state
|
Disabled until a VLAN is mapped to an MISTP instance
|
MAC address reduction
|
Disabled
|
Bridge priority
|
32768
|
Bridge ID priority
|
32769 (bridge priority plus the system ID extension of MISTP instance 1)
|
Port priority
|
32 (global)
|
Port cost
|
• Gigabit Ethernet: 4
• Fast Ethernet: 191
• FDDI/CDDI: 10
• Ethernet: 1002
|
Default port cost mode
|
Short (802.1D)
|
Port VLAN priority
|
Same as port priority but configurable on a per-VLAN basis in PVST+
|
Port VLAN cost
|
Same as port cost but configurable on a per-VLAN basis in PVST+
|
Maximum aging time
|
20 seconds
|
Hello time
|
2 seconds
|
Forward delay time
|
15 seconds
|
Setting MISTP-PVST+ Mode or MISTP Mode
If you enable MISTP in a PVST+ network, you must be careful to avoid bringing down the network. This section explains how to enable MISTP or MISTP-PVST+ on your network.
Caution 
If you have more than 6000 VLAN ports configured on your switch, changing from MISTP to either PVST+ or MISTP-PVST+ mode could bring down your network. Reduce the number of configured VLAN ports on your switch to no more than 6