Showing posts with label spanning-tree. Show all posts
Showing posts with label spanning-tree. Show all posts

Thursday, October 9, 2008

Spanning Tree Timers


With the same topology as depicted in the Spanning Tree post there is a requirement to influence how long switch 2 takes to failover to its redundant paths to switch 1.


There are a few timers that can be tweaked. The spanning-tree forward-time and max-age timers allow them to be altered on a per VLAN basis.

Max-age is the time a switch waits if no configuration BPDUs are received from the root before entering the listening and then learning states. The default here is 20 seconds. Forward-time is 15 seconds by default for the listening and learning states.

The time it takes a redundant port to become active is equal to max-age plus the listening and learning forward-times i.e 20 + 15 + 15 = 50 seconds.


The minimum max-age is 6 seconds, and the minimum forward-time is 4 seconds. Hence the fastest spanning-tree convergence time that can be achieved by tweaking the timers is 14 seconds.


If faster convergence is required then tweaking the vlan spanning-tree timers is not going to help. In this instance for switch 2 where the are redundant paths to an upstream switch the spanning-tree uplink-fast feature can abe considered. This is not configurable on a per vlan basis but applies to all vlans on the switch.


With uplink-fast enabled if switch 2 detects a problem on the root port it can transition the redundant blocked interface to the forwarding state without waiting for the listening and learning timers. Typically this takes only 3-5 seconds.

Wednesday, October 8, 2008

Spanning Tree


In this post i cover a couple of the basic spanning tree concepts. Root switch selection and how root ports are elected.

In the above scenario the requirement is to make Switch 1 the root switch for vlans 4 and 44. Additionally there is a requirement for the default path for all traffic to be port fa0/12. In the event that this fails then fa0/11 should be used.

To select the root switch for vlans 4 and 44 this is simply achieved by applying the following command on Switch 1.

spanning-tree vlan 4,44 root primary

show span vlan 4

VLAN0004
Spanning tree enabled protocol ieee
Root ID Priority 24580
Address 0013.80de.b880
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 24580 (priority 24576 sys-id-ext 4)
Address 0013.80de.b880
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/11 Desg FWD 19 128.11 P2p
Fa0/12 Desg FWD 19 128.12 P2p


The output states that 'This bridge is the root' and ports 11 and 12 are both designated ports.

I repeat this command on Switch 2

SW2#s span vlan 4

VLAN0004
Spanning tree enabled protocol ieee
Root ID Priority 24580
Address 0013.80de.b880
Cost 19
Port 11 (FastEthernet0/11)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32772 (priority 32768 sys-id-ext 4)
Address 0013.c34f.5000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/11 Root FWD 19 128.11 P2p
Fa0/12 Altn BLK 19 128.12 P2p


Here the Root ID specifies the MAC address of Switch 1. Since the cost and priority of all links to SW1 are equal SW2 has elected the lowest port id as the root port - in this case fa0/11.

To meet the requirements Fa0/12 needs to be the root port. Cost and priority can be used to influence the root port selection. However the question states the configuration must be done on SW1. An important consideration is that port cost is NOT transmitted to neighboring switches. Each switch calculates its own upstream cost metric, hence modifying the port cost on SW1 will NOT change SW2 cost calculations. This only leaves priority as the parameter to change.

The default port priority is 128 (see above output). As with cost the lower the priority the more desirable the path. Hence on SW1 i change the priority of fa0/12 to 16 as follows.

SW1(config-if)#spanning-tree vlan 4,44 port-priority 16

show span vlan 4

Interface Role Sts Cost Prio.Nbr Type
-- --- --------- -- ------ --------------------------------
Fa0/11 Desg FWD 19 128.11 P2p
Fa0/12 Desg FWD 19 16.12 P2p

I then check on SW2 to ensure that fa0/12 has now become the root port.

SW2#s span vlan 4
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/11 Altn BLK 19 128.11 P2p
Fa0/12 Root FWD 19 128.12 P2p

One note of caution. The spanning-tree port priority can be set for all vlans on a port with the command 'spanning-tree port-priority x'. Be sure to read the question requirements to understand whether the priority needs to be changed for explicit vlans or for all!