This will be a good time to introduce you to another very significant change that Cisco made to STP. Before that, note that this section discusses VLANs. For now remember that VLANs provide different broadcast domains at layer 2 and hence keep traffic from one subnet different from another. We will cover VLANs in more detail in Chapter 7.
When IEEE 802.1d was drafted, VLANs did not exist. Hence one Spanning Tree instance worked across the entire switch. Eventually VLANs were introduced and they created different networks on the same switch. This gave rise to need to have different topology for load balancing and flexible Spanning Trees. The need for Per VLAN STP can be further understood from the network shown in Figure 6-13.
Figure 6-13 Per-VLAN STP
SwitchD has two ways to paths to reach SwitchA. In any implementation of STP (Per-VLAN or a single STP), one of the interfaces will be blocked. Let us assume that fa0/17 is blocked in this network. This works well in an environment where the whole network is one single big network. Now consider a situation where the network is divided into two smaller networks using VLANs. If both the VLANs spanned all the four switches, would it not be useful to have fa0/17 blocked for one VLAN and fa0/20 blocked for the other VLAN? This way traffic in both VLANs can be load balanced across both paths!
To achieve this, Cisco added the Per-VLAN Spanning Tree Plus (PVST+) feature on its switches. With this feature, Cisco switches ran one STP instance for every VLAN.
When IEEE introduced 802.1w it still did not accommodate multiple Spanning Tree instances on a switch. Cisco introduced the Per-VLAN Rapid Spanning Tree (PVRST) to support Rapid Spanning Tree instances on each VLAN on the switch. PVST+ and PVRST both provide the same functionality across both 802.1D and 802.1w standards.
Remember that PVST+ and PVRST both add the VLAN number to the bridge ID of every switch. That is the reason you earlier saw the priority as 8197 in VLAN 5 even though you had configured the priority as 8192.
To enable RSTP for each VLAN in our switched network, we use the following command:
This is all that is needed if we need only instance of the spanning tree protocol. Later on in this section, we will show what is needed to enable the load sharing capabilities.
Using the “show spanning-tree vlan <vlan#>” command, we can verify which type of spanning tree is running.
Two items are of interest in this output. First is the Spanning Tree Protocol – RSTP and the second is the “sys-id-ext 10”. This shows that the Bridge priority was configured as 49152 and VLAN id 10 was added to it.
How can load balancing be achieved in the network shown in Figure 6-13 if VLAN 1 and VLAN 5 are being used on the LAN? We can achieve it by configuring Switch A with a better priority for VLAN 1 and configuring SwitchB with a better priority for VLAN 5. This can be done using the following commands:
Let’s see the “show spanning-tree” output for both VLANs on SwitchD to verify loadbalancing.
We can see that the root bridge for VLAN1 is SwitchA whereas the root bridge for VLAN5 is SwitchB. Fa0/20 is the Root port for VLAN 1 and Fa0/17 is the root port for VLAN 5.