Modifying STP Timers on a CLIBased Switch

Use the following commands to modify STP timers on a CLI-based switch:

Switch(enable) set spantree hello interval [vlan] Switch(enable) set spantree fwddelay delay [vlan] Switch(enable) set spantree maxage agingtime [vlan]

The Hello Timer triggers periodic hello messages to be sent to other bridges and sets the interval that a bridge expects to hear a hello from its neighboring bridges. BPDUs are sent every 2 seconds by default. The Hello Timer can be modified per VLAN with the set spantree hello command with a range of 1 to 10 seconds.

The Forward Delay Timer determines the amount of time a port stays in the Listening state before moving into the Learning state and how long it stays in the Learning state before moving to the Forwarding state. The Forward Delay Timer can be modified per VLAN with the set spantree fwddelay command. The default value is 15 seconds and can be set to a value of 4 to 30 seconds. This timer should only be modified under careful consideration because the value is dependent upon the diameter of the network and the propagation of BPDUs across all switches. A value too low will allow loops to form and cripple a network.

The MaxAge Timer specifies the lifetime of a stored BPDU that has been received from a neighboring switch with a Designated Port. Suppose BPDUs are being received on a non-Designated switch port every 2 seconds, as expected. Then an indirect failure, or one that doesn't involve a physical link going down, occurs that prevents BPDUs from being sent. The receiving switch will wait until the Max Age Timer expires to listen for further BPDUs. If none are received, the non-Designated port will move into the Listening state and Configuration BPDUs will be generated by the receiving switch. This port then becomes the Designated Port to restore connectivity on the segment.

To modify the Max Age Timer on a per-VLAN basis, use the set spantree maxage command. The timer value defaults to 20 seconds, but can be set from 6 to 40 seconds.

NOTE Modifying STP timers can be tricky given the conservative nature of the default values and the calculations needed to derive proper STP operation. Timer values are basically dependent on the Hello Time and the diameter of the switched network, in terms of switch hops. Catalyst CLI-based switches offer a single command that can be used to change the timer values in a more controlled fashion. Although described earlier, the set spantree root macro command is a better tool to use than setting the timers with the individual commands:

Switch (enable) set spantree root [secondary] [vlan-list] [dia diameter] [hello hello-time]

Here, STP timers will be adjusted exactly according to the formulas specified in the 802.1D standard by giving only the Hello Time and the diameter of the network. Again, this command can be used on a per-VLAN basis to modify the timers for a particular VLAN's Spanning Tree. The network diameter can be a value from one to seven switch hops. Because this command is used to make a switch become the Root Bridge, all the modified timer values resulting from this command will be propagated to other switches through the Configuration BPDU.

0 0

Post a comment