5.4 STP in the Campus Network
5.4.6 Modifying STP timers
The timers in Spanning Tree are necessary to prevent bridge loops from occurring within the network. Timers are put in place to give the network enough time to get all the correct information about the topology and to determine if there are redundant links.

However, using the default timers means that it could take up to 50 seconds after a link has failed for its redundant, or backup, link to take over. The length of time that it takes Spanning Tree to converge when a link has failed can be too much for some protocols and applications, resulting in lost connections, sessions, or data.

To set these timing parameters on a set command-based switch, enter the following commands in privileged mode (all times are in seconds):

  • Set the bridge forward delay for a VLAN-Enter the set spantree fwddelay delay-time [vlan] command. This indicates the interval during which a port moves from the listening to the learning state, and then from the learning to the forwarding state. The range is 4 to 30 seconds; the default is 15 seconds.
  • Set the bridge hello time for a VLAN-Enter the set spantree hello interval command. The hello time parameter is the interval between the transmission of BPDUs from the root switch. This command has a default value of 2 seconds and a minimum value of 1 second. Reducing hello time from 2 seconds to 1 second doubles the number of BPDUs that must be lost before triggering an unwanted transition, but this reduction in time also doubles the processing load on the switch CPUs.
  • Set the bridge maximum aging time for a VLAN Enter the set spantree maxage agingtime [vlan] command. The maximum age parameter expresses the lifetime of a BPDU. A BPDU is considered valid on a port for maxage seconds. If a new BPDU is not received in maxage seconds, then the old BPDU is discarded. This parameter is important for a fault that cannot be detected at the physical level - for example, for indirect faults. This parameter has a default value of 20 seconds and a minimum value of 6 seconds.

Examples of these commands are shown in Figure .

Note: These are random timer settings being used for demonstration only! Do not attempt to change the timers on a production network unless you know exactly what you are doing.

To set these timing parameters on a Cisco IOS command-based switch, enter the following commands in global configuration mode (all times are in seconds):

Set the bridge forward delay for a VLAN - Enter the spanning-tree [vlan stp-list] forward-time seconds command.

Set the bridge hello time for a VLAN - Enter the spanning-tree [vlan stp-list] hello-time seconds
command.

Set the bridge maximum aging time for a VLAN - Enter the spanning-tree [vlan stp-list] max-age seconds command.

Examples of these commands are shown in Figure . Again, please note that these are random timer settings being used for demonstration only! Do not attempt to change the timers on a production network unless you know exactly what you are doing.