« Is cricket-95 still needed? | Main | Implementing a ranked cloud list »

The Travelling BPDU Problem

In the aftermath of a spanning tree failure I found myself revisiting the IEEE ethernet standards documents. Specifically 802.1d and 802.1q. As I write this both are available as part of the Get IEEE 802 program, ymmv.

While reading the standards, and some related websites about tuning spanning tree parameters, I realised that there were a number of references to network diameter; however there was no precise definition of this term.

Superficially it seems a pretty self explanatory term — surely it's just the number of switch hops between the entry and exit of the spanning tree domain. A more precise definition is: The network diameter is the maximal trail through the layer 2 domain, including the entry and exit switches.

I am using graph theory terms in this article, I got these from Wikipedia. If any terms are unclear you should be able to get a definition there.

So what is the maximal trail, and how do you calculate it?

Take a look at this example from cisco. Cisco frequently change URLs, hopefully this one won't break too soon...

Essentially this is a variation of the travelling salesman problem. The travelling salesman problem requires that you find a route that passes through every node exactly once. Our requirement isn't quite that strong; we just need to find the longest route through the network that touches each switch in the path only once. Unfortunately the TSP is an NP hard problem, and while there are a number of elegant solutions to reducing the amount of brute force needed to crack it, there is no clean simple algorithm that can solve it. The easiest method is to just get out the paper and use the problem cracking abilities of the human brain.

Examples:

leaves.png

What is the maximal trail from C to F in this network? There are a couple of contenders: C-A-D-B-F and C-A-E-B-F, so the network diameter here is 5.

loops.png

What is the maximal trail from C to F in this network? C-D-B-A-E-F. Although this network contains the same number of switches, it has a larger network diameter (6).

My conclusion from this is: don't build loops in switched networks. Feel free to decide otherwise, but my opinion is that the reduction in the number of ports required for the infrastructure isn't worth taking the network a step closer to the assumed maximum network diameter of 7 used for calculating the default spanning tree timers in the 802.1d standard.

Can I take my network beyond the recommendation of 7?

Sure, and in most cases it will probably hold together OK; however even though the timer values in the standard look pretty conservative, they are chosen to maximise the stability of the network under load. Your network may run stably under normal load situations, but under heavy load (i.e. when you most need stability) you may find that your spanning tree calculation becomes non-convergent and you get a spanning tree failure causing loops in your network. Switches may seem expensive when you have a stable network but when you have experienced the instantaneous meltdown a spanning tree failure can cause you'll understand that the extra cost involved in reducing the network diameter is well worth it.

TrackBack

TrackBack URL for this entry:
http://blog.s8n.net/mt/mt-tb.cgi/990

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About

This page contains a single entry from the blog posted on August 22, 2006 9:31 AM.

The previous post in this blog was Is cricket-95 still needed?.

The next post in this blog is Implementing a ranked cloud list.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.33