Wednesday, May 14, 2008

Spanning-Tree (Sharing Traffic between Links)

Spanning-Tree help us to keep our networks loop free, and it does that without "almost" any kind of intervation. That´s so cool! You can just get your switch out of the box, install it, Spanning-Tree (at least on Cisco Switches) is enabled by default, so don´t worry about loops, you have other things in mind to be worried about (like IP Address, VLAN, VTP, etc).

By default Spanning-Tree will calculate the Best Path (that means the one with the lowest cost) to the Root, and if you have a second connection, with a higher cost to the root STP will block it! If it finds a tie between two paths, it´ll use other metrics (like first port, bridge id, etc).

Ok, but in your case, you have TWO Core Switches, with all the same features, working togheter. In that case (and many others) you can split your switch in two different VLANs (X and Y for example), and make your Core Switch 1 the ROOT Bridge for VLAN X, and Core Switch 2 the ROOT Bridge for VLAN Y. Check the diagram below (it´s simple):

STP7

That way you can use both links, instead of having ALL the traffic in only one, and having the other link blocked by Spanning-Tree.

How can you do that?! Just use the command spanning-tree vlan <vlan number> priority <priority value> at the root, just keep in mind that the lower the Bridge Priority, the best chances it has to become the ROOT Bridge for that VLAN.

The default priority value is 32768. If you configure your network for, let say, to 24576, it´ll become the ROOT Bridge. And you can do that for each VLAN (or group of VLANs).

In this example, Core Switch 1 would have this command line:

spanning-tree vlan 50 priority 24576

And Core Switch 2 with this one:

spanning-tree vlan 60 priority 24576

With that you can make a better use of your connections! (again, that will depend on your topology, planning is ALWAYS a MUST before doing any intervation in your network!).

We can also use Routed Access to do that (share traffic between links), in a smarter way, but that is a discusion for later! :)

No comments: