Pages

Monday, December 20, 2010

Manipulate Spanning tree protocol

In order to control and understand spanning tree protocol behavior, we need to understand how each parameter influence the root bridge selection. The important parameter in BPDU  that is used for the root bridge election is a Bridge ID.


Switches send out the BPDU message to all of the switches in the layer 2 network in order to elect the root in spanning tree. BPDU message contains 8 bytes long Bridge ID which is a combination of the bridge priority and MAC address. The lower bridge ID is more preferred to become the root bridge. Once the root bridge is elected, the rest of the switches calculate cost to reach root bridge and assign the spanning tree state accordingly.


Interface bandwidth and the port priority have come in to play at this point. Interface bandwidth determines cost of each interface. The least cost to the root is preferred. In case the cost is tied, port priority will be used. The example below illustrate the concept of the spanning tree protocol.




Configuration task


Configure SW1 to be a root bridge

  • Initially, 3 switches bridge priority are the same. It depends on the MAC address of each switch. The switch which has the lowest Bridge ID will be a root bridge. Since we want to make sure that the SW1 is a root bridge. Therefore, we set the bridge priority for VLAN 1 of SW1 to be 100 as opposed to default value.
  • SW1(config)#spanning-tree vlan 1 priority 100



Configure interface e1/0 of SW3 to a spanning tree blocking port and e1/1 as a forwarding port
  • Initailly, SW3 e1/0 and SW2 e1/0 are the forwarding port since they have the least cost to root. Each of the interface has cost 19 since they have 100 Mbps bandwidth (as default). We will need to adjust the SW3 e1/0 cost to force the LAN traffic going through e1/1. In this example, we configured it to have cost 300. As a result, SW3 will then choose the path to root through e1/1 because it has less cost (19 + 19) than going via e1/0 (300).
  • SW3(config)# interface e1/0
  • SW3(config-if)#spanning-tree cost 300



Related Link.
http://www.cisco.com/en/US/tech/tk389/tk621/technologies_configuration_example09186a008009467c.shtml



1 comment:

  1. Thank you for sharing. Your blog has given me that thing which I never expect to get from all over the websites. Nice post guys!


    Melbourne SEO Services

    ReplyDelete