Problem solve Get help with specific problems with your technologies, process and projects.

Tune spanning tree for VoIP

Tuning settings to account for the vagaries of spanning tree protocol.

The Spanning Tree Protocol, created by IBM and subsequently specified by the IEEE in 802.1D, is used in most modern, switched networks. Its purpose is the elimination of layer 2 loops that would allow broadcast packets to circle endlessly between switches. If your user-access switches have only a single uplink, you don't have any need for Spanning Tree, but if you have a second link for redundancy, or if you're concerned about the possibility of someone accidentally creating a loop, you'd best enable it.

The problem with the Spanning Tree protocol as it relates to VoIP is that the default timers take forever for the network to converge. While Spanning Tree is converging, its ports are in a blocking state (or "listening" and "learning" in STP parlance) instead of "forwarding". Much LAN traffic would never notice, but VoIP users certainly would notice a brief outage in the event any change in the network.

There are many ways of addressing this problem. One popular one is Cisco's Portfast (and UplinkFast and BackboneFast etc.) However, these mostly allow ports to start forwarding before they would normally be allowed to when the port is first enabled, and they don't help much in the event of an outage that changes the path through the network. So you should also consider adjusting your Spanning Tree timers. These timers are

Hello time: the time in seconds a switch waits between sending BPDU packets
Forward-time: the time in seconds spent in "listening" and "learning" modes
Max-age: also a time in seconds, that is a timeout for listening for BPDUs
Maximum Diameter: the maximum number of switches a frame passes through across a layer 2 domain

By default, the diameter is 7, and the Hellos are sent every 2 seconds. This results in default times of 15 and 20 seconds for forward-time and max-age respectively, which can be determined using the following formulas:

Max-age = (4 x hello) + (2 x diameter) – 2.
Forward-time = ((4 x hello) + (3 x diameter)) / 2.

If you've implemented a smart network with lots of layer 3 switching and don't have VLANs trunked all over the place, there's a good chance your network diameter is 1. If it is, your timers could be tuned to:

Max-age = 8
Forward-time = 6.

And if your network utilization isn't high and your switch processors are mostly idle, you can tune it further by making your hello time 1 second, which results in:

Max-age = 4 (minimum may be 6 on some switches)
Forward-time = 4.

Thomas Alexander Lancaster IV is a consultant and author with over ten years experience in the networking industry, focused on Internet infrastructure.

Dig Deeper on Unified Communications Resources