Monday, December 3, 2007

Optimizing Layer2 Switching Environments (Part 2): Spanning-Tree Management

Spanning-Tree Protocols

In Part1 we saw how a simple tweaking of the spanning-tree timers could improve the perceived uptime for a large switched environment. In this Part2 we will be considering the selection of an alternate spanning-tree protocol for our network.

Cisco support the following spanning-Tree protocols:
  • pvst+: Per-VLAN spanning-tree which is based on IEEE 802.1d with some Cisco proprietary extensions 
  • rapid pvst+: the same as the pvst+ but use IEEE 802.1w for convergence. In plain English, immediately removes all dynamically learned mac-addresses from the vlan had the STP change. In addition it quickly transition root ports or designated ports to forwarding state. 
  • MSTP: multiple spanning-tree protocol (also known as multiple instances spanning-tree protocol due to the pre-802.1s standard implementation from Cisco, but that is not the correct term). This ones runs over rapid pvst+. But, instead of having a single VLAN per STP instance, MSTP allows you to map multiple VLANs to a single STP instance.

    The default spanning-tree protocol for Cisco switches is pvst+.

    My recommendation, if you have more than one switch and you are connecting them in any redundant configuration, move into rapid pvst+. If you are administering a campus or an enterprise switched network with multiple VLANs, consider moving into MSTP.

    You will have the same benefits that with rapid pvst+ but you won't need to have a single STP tree entry per VLAN. Just think, if you have 20 VLANs going to the same building and floor, why would you need 20 STPs instances if you only have one or two ways to arrive there? All those instances will have exactly the same information. So, lets group them together. That is what MSTP does.

    Since all these modes are backward compatible up to certain level, you can plan the migration from one protocol to the other with no rush. Now, make sure you know what you are doing or you could end up messing all your STPs.

    So, how to configure the spanning-tree protocol? You might have notice the entry "spanning-tree mode pvst" already in your configuration. Well, this is because pvst is the default running configuration. In order to change this default, the command syntax is:

    spanning-tree mode {pvst | mst | rapid-pvst}

    Now, if you decide to go with rapid-pvst take into consideration that the "rapid" is only for point-to-point links. In other words, is only for your uplink ports. This means that you have to specify the "link-type" of your uplink interfaces (those connected to other switches).

    interface FastEthernet 0/24
      description Uplink to Switch Core-A1
      spanning-tree link-type point-to-point

    What this "link-type" does is that, if you have a point-to-point toanother switch, and the local port becomes the designated port, the switch negotiates with its peer switch and rapidly setup the port in forwarding state.

    Since you may be in the planning of a transition from pvst or even the original vtp (802.1d) to rapid-pvst you should remember to reset the process:

    # clear spanning-tree detected-protocols

    This will allows the protocol migration process for the whole chassis on those ports running 802.1d. Remember, all this newer spanning-tree protocols are backward compatibles up to certain level. So, with this, you are making sure that the rapid-pvst correctly interact with your legacy devices.

    No comments:

    Post a Comment