Wednesday, 7 September 2011

Configuring VLAN Load Balancing on Catalyst Switches with STP

This configuration support for :Catalyst 2900/3500XL, Catalyst 2950, Catalyst 3550, Catalyst 4000 supervisor III/IV, and Catalyst 6000.

15f.gif

Show Current STP Status on Catalyst R

Here is the current STP status on Catalyst R. It is the Root for both VLAN 1 and 2, so all its ports are forwarding.
Catalyst_R#show spanning-tree interface FastEthernet 3/1

Vlan             Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- ------------------
VLAN0001         Desg FWD 19        128.129  P2p 
VLAN0002         Desg FWD 19        128.129  P2p 

Catalyst_R#show spanning-tree interface FastEthernet 3/2

Vlan             Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- ------------------
VLAN0001         Desg FWD 19        128.130  P2p 
VLAN0002         Desg FWD 19        128.130  P2p 


Show Current STP Status on Catalyst DOn Catalyst D, as expected, port 5/2 is blocked for both VLANs 1 and 2.
Catalyst_D#show spanning-tree interface FastEthernet 5/1

Vlan             Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- -----------------
VLAN0001         Root FWD 19        128.129  P2p 
VLAN0002         Root FWD 19        128.129  P2p 

Catalyst_D#show spanning-tree interface FastEthernet 5/2

Vlan             Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- -----------------
VLAN0001         Altn BLK 19        128.130  P2p 
VLAN0002         Altn BLK 19        128.130  P2p 
Tune the Port Priority on Catalyst RYou are going to decrease the port priority value for VLAN 1 on port 3/2. This way, the corresponding port 5/2 on Catalyst D receives better BPDUs than the ones that are sent on port 5/1 (that still has a port priority value of 128).
Catalyst_R#config terminal
Catalyst_R(config)#interface FastEthernet 3/2       
Catalyst_R(config-if)#spanning-tree vlan 1 port-priority 64 
Catalyst_R(config-if)#end
Catalyst_R#

You can check that the port priority value has changed for VLAN 1:

Catalyst_R#show spanning-tree interface FastEthernet 3/1

Vlan             Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- ----------------
VLAN0001         Desg FWD 19        128.129  P2p 
VLAN0002         Desg FWD 19        128.129  P2p 

Catalyst_R#show spanning-tree interface FastEthernet 3/2

Vlan             Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- -----------------
VLAN0001         Desg FWD 19         64.130  P2p 
VLAN0002         Desg FWD 19        128.130  P2p 


Check Result on Catalyst D

You can see on Catalyst D that, for VLAN 1, port 5/1 is now blocking and port 5/2 is forwarding, as was expected.
Catalyst_D#show spanning-tree interface FastEthernet 5/1

Vlan             Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- -----------------
VLAN0001         Altn BLK 19        128.129  P2p 
VLAN0002         Root FWD 19        128.129  P2p 

Catalyst_D#show spanning-tree interface FastEthernet 5/2

Vlan             Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- ----------------
VLAN0001         Root FWD 19        128.130  P2p 
VLAN0002         Altn BLK 19        128.130  P2p 

Details on the port-priority and vlan port-priority Commands

There are two ways to define VLAN port priority:
  • The "global" port priority value (128 by default) which can be modified per interface by the port-priority command
  • The "per VLAN" port priority value which can be modified per interface and per VLAN by the VLAN port-priority command
An example clarifies this. Consider adding a third VLAN in this example. By default, this VLAN belongs to the group that has the global port priority value (default 128).
Catalyst_R#show spanning-tree interface FastEthernet 3/2

Vlan             Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- -----------------
VLAN0001         Desg FWD 19         64.130  P2p 
VLAN0002         Desg FWD 19        128.130  P2p 
VLAN0003         Desg FWD 19        128.130  P2p 
Change the global priority for the port, using the spanning-tree port-priority interface configuration command:
Catalyst_R(config)#interface FastEthernet 3/2
Catalyst_R(config-if)#spanning-tree port-priority 160
Catalyst_R#
Catalyst_R#show spanning-tree interface FastEthernet 3/2
Vlan             Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- ---------------
VLAN0001         Desg FWD 19         64.130  P2p 
VLAN0002         Desg FWD 19        160.130  P2p 
VLAN0003         Desg FWD 19        160.130  P2p 
Notice that all the VLANs belonging to the "global" group changed their priority to 160. Now assign VLAN 3 its own priority 48 with the spanning-tree vlan port-priority interface command:
Catalyst_R(config)#interface FastEthernet 3/2     
Catalyst_R(config-if)#spanning-tree vlan 3 port-priority 48
Catalyst_R#
Catalyst_R#show spanning-tree interface FastEthernet 3/2

Vlan             Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- -----------------
VLAN0001         Desg FWD 19         64.130  P2p 
VLAN0002         Desg FWD 19        160.130  P2p 
VLAN0003         Desg FWD 19         48.130  P2p 
Notice that only VLAN 3 has changed its priority to 48. To put VLAN 3 back in the default group, use the no spanning-tree vlan port-priority interface command:
Catalyst_R(config)#interface FastEthernet 3/2           
Catalyst_R(config-if)#no spanning-tree vlan 3 port-priority 
Catalyst_R#
Catalyst_R#show spanning-tree interface FastEthernet 3/2

Vlan             Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- ------------------
VLAN0001         Desg FWD 19         64.130  P2p 
VLAN0002         Desg FWD 19        160.130  P2p 
VLAN0003         Desg FWD 19        160.130  P2p 

Conclusion

The VLAN load balancing configuration just completed optimizes the use of redundant trunks between two Catalysts.
Keeping the default STP values leads all redundant links between the two Catalysts to end up in blocking mode. Tuning the STP priority allows several links to be used at the same time, for different VLANs. This increases the overall bandwidth available between the two devices. In case of failure of a link, the STP re-dispatches the VLANs to the remaining trunks as it reconverges.
The only drawback left with this design is that it can only load-balance traffic on a VLAN basis. If in the previous example, you had a 130 Mb/s traffic flowing through VLAN 1 and only 10 Mb/s traffic on VLAN 2, you still drop packets on VLAN 1, even though you have, in theory, 200 Mb/s between Catalyst R and Catalyst D. The EtherChanneling feature addresses this, by providing load balancing between several links on a packet basis. If your hardware supports it, use FastEtherchannel (or GigabitEtherChannel) rather than the configuration described in this document

0 comments: