--------- Forwarded message ---------- From: "Tim" To: "'Ralph'" Date: Tue, 13 Sep 2005 20:51:09 -0400 Subject: RE: RE: Load Balancing Across Trunks Hey Ralph, If you really want to completely understand this, I strongly recommend you read the classic Cisco Press book on this topic, LAN Switching by Kennedy and Clark. But, I'll try to summarize the concept for you here. STP reason for existence and the reason it was created is to create a L2 LOOP FREE path between every device in the L2 domain. Step 1 in this process is to elect a root bridge. Once a root bridge is elected, every other switch in the L2 domain has to find the lowest cost path to the root bridge. So, going back to the previous example with the 3 switches, once sw3 is elected the root bridge, sw2 which has multiple paths to sw3, the root bridge, has to figure out which physical link it will use to reach the root bridge, sw3. If I remember correctly, (a big if indeed), sw2 will first compare the costs of each path to the root bridge. If these costs are equal, then it compares port priority. If these are equal, the tiebreaker is interface number. Based on this assessment, sw2 will put 1 of its ports into a forwarding state and all the other ports into blocking state. After sw2 is done deciding which port will forward and which will be blocked, sw1 will do the same thing. Recall that sw1 also has multiple paths (multiple physical links connecting it to sw2). And, in our example topology, the only way for traffic to reach the root bridge from sw1 is via sw2. BTW, sw1 and sw2 know which way to go to get to the root bridge because of bpdu's that flow downstream from the root bridge. ( If you want to know the details of this process you definitely have to read the Lan Switching book cause I don't remember). So, now that sw1 knows that it has to get to the root bridge via sw2, it has to decide which port it will put into the forwarding state and which port(s) into the blocking state. So, just like sw2 did, sw1 will compare cost, priority and then, if needed, interface number. As an aside, since in the lab, there are only 2 switches, you don't have to worry to much about this. However, you better know how to manipulate which port goes into forwarding and which are blocked and when to configure which parameter on which switch. I use this memory aid: D U D C P I Where D = downstream; U = Upstream; C = cost; P = priority; and I = interface # So, if you have 4 physical 100mbps links between 2 switches and you want port x to forward, you can force this to happen by either manipulating cost on the downstream switch (make it lower on port x) or increasing the port priority on the upstream switch. Make sure you know this inside out, backwards and forwards, and in your sleep. HTH, Tim --- Tim, Port-priority is set on an upstream switch to influence a downstream switch so you could use it, however it is at the bottom of the list and will only get chosen should everything else be equal, which is unlikely in the real world, and unlikely in any network with more than 2 switches. However.... Your topology ROOT-----------SW1===============SW2 The factors that will make SW2 choose 1 path over another is as follows Path cost ( end to end cost) = same Bridge-ID of upstream switch ( down each link) = same Port-ID (lowest port number and priority) = So if SW2's cost to the ROOT is the same down both links, and the bridge-ID is the same also, you could set the port-priority on one of SW1's ports, to affect which path SW2 forwards and which one it blocks. But you could not set the port priority on SW2 as it would not make any difference. Does this make sense? HTH. --- Wow - Lee - this is a superb post! Thank you so much! This really demonstrates exactly what is meant by UPSTREAM! We do not have to be on the ROOT DEVICE itself in order to use priority - but we do need to be UPSTREAM as you have demonstrated here. Also - I found this quote from InternetnetworkExpert - just a restatement of everything you have taught us Lee.....but still always nice to see it put another way! "To influence which port is elected the root port, the two user configurable values to change are port cost and port priority. Changing port cost will effect both the local bridge and all downstream bridges. Changing the port priority will only affect the directly connected downstream bridge. Keep in mind that port priority is only taken into account if there is a tie in both cost and bridge-ID (a tie in bridge-ID implies that a bridg has multiple connections to the sme upstream bridge.) In summation - if there is a root device out of your control - you can still use port-priority to control load-balancing - you just need to use it in the right place (UPSTREAM DEVICE). The only time I would need something like ROOT GUARD would be if I truly need to take over as ROOT. For example, I have a backbone root device connected to BOTH of the switches in my control. Now I have both of my trunks in the BLOCKING state on one of my switches. Here I must wrestle the ROOT role away from the backbone I believe. --- Subject: Re: Re: switch configuration Yes Chris, It is not a per Vlan setting. But it does change the default behavior of the switch - making the port with the lower port # the root port, in a back2back connection. Using this in combination with making SW1 the root for VLANS 22,23; and SW2 the root for 32,33 works perfectly as desired. If you have the the time, try labbing it up. Ralph. -----Original Message----- From: Chris Lewis To: Ralph , rajib56666@yahoo.com Date: Sun, 27 Nov 2005 14:20:14 -0800 (PST) Subject: Re: switch configuration Hi Ralph, Please check this with reference to the show spanning tree vlan X command on the non-root switch, where X is the vlan you want to investigate. You are correct that setting the bandwidth on an interface affects cost and hence which port on the non-root bridge is used for forwarding, but that is set for all vlans, it is not a per vlan setting to my knowledge. Chris Ralph wrote: SW1--------------------SW2 ports 13 and 14 are trunking on both switches. The basic idea is to modify the bandwidth of port 13 of SW2. Since path cost is derived from the bandwidth. This will make port 14 on SW2 the root port for VLANs 22,23. Here is a sample: SW1 is made the root for VLANS 22, 23 SW2 is made the root for VLANS 32, 33 SW1#sh interfaces trunk Fa0/13 1,22-23,32-33 Fa0/14 1,22-23 SW1# SW2#sh interfaces trunk Fa0/13 1,22-23,32-33 Fa0/14 32-33 SW2# There is no load-balancing yet. All Vlans use Port 13 on both switches. To load -balance: Instead of using port cost on SW2 port 13, you can modify the bandwidth from the default of 100000 to 10000. Since path cost is derived from bandwidth. hostname SW2 interface FastEthernet0/13 switchport trunk encapsulation dot1q switchport mode trunk bandwidth 10000 ! SW1#sh interfaces trunk Fa0/13 1,22-23,32-33 Fa0/14 1,22-23 SW1# SW2#sh interfaces trunk Fa0/13 32-33 Fa0/14 1,22-23,32-33 SW2# Now Load-balancing and failover is accomplished using spanning tree. HTH Ralph. -----Original Message----- From: Rajib Khan To: "ccielab@groupstudy.com" Date: Thu, 24 Nov 2005 07:32:44 -0800 (PST) Subject: switch configuration Hi Group Could any one please help me with the followings SW1 ------------ SW2 There are 2 trunk port between sw1 and sw2, I want to send vlan 22,23 via one link and 32,33 other link but if one link fails then other link should forward all vlans. Is there any way can you achieve this with out using port priority and port cost Thanks in advance Raj ----