Tune spanning tree for VoIP

Tune spanning tree for VoIP

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

    Requires Free Membership to View

    SearchUnifiedCommunications.com members gain immediate and unlimited access breaking industry news, expert advice on UC, technical guides, and more -- all at no cost. Join me on SearchUnifiedCommunications.com today!

    Kate Gerwig, Editorial Director

    By submitting your registration information to SearchUnifiedCommunications.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchUnifiedCommunications.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

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.


This was first published in October 2002

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.