/dev/fun

Spanning Tree

One root, one path each, no loops. Find them before a broadcast storm does.

The Spanning Tree Protocol (STP) of IEEE 802.1D (the Institute of Electrical and Electronics Engineers standard for bridges) keeps a switched network with redundant links free of loops. The switches elect a root bridge, every other switch picks its best port towards it, every link gets one designated port, and every remaining port blocks. Work it out the way the switches do.

See the Spanning Tree scoreboard

Kept in this browser · My desk

Streak 0Best streak 0Played 0Where it comes from
100%

Setting up the board…

Where it comes from

Radia Perlman worked out the spanning tree algorithm at Digital Equipment Corporation (DEC) and published it in September 1985, in "An Algorithm for Distributed Computation of a Spanning Tree in an Extended LAN" at SIGCOMM '85: bridges that know only their neighbours compute, between them, a subset of the network that reaches every local area network (LAN) yet has no loops. The paper also carries a short poem of hers, "Algorhyme", which puts the algorithm in rhyme; the scan of the paper, in the sources, shows it.

The Institute of Electrical and Electronics Engineers (IEEE) approved 802.1D-1990, the bridge standard that carries the protocol, on 31 May 1990. The Rapid Spanning Tree Protocol (RSTP) followed as 802.1w in 2001 and was incorporated into 802.1D-2004.

In 2011 RFC 6325, the base specification of Routing Bridges (RBridges), with Perlman as first author, opened its introduction with a sequel, "Algorhyme V2" by Ray Perlner, which answers the first poem's tree with a graph of least-cost paths. Both poems are in the documents listed below.

More on this site

Sources

  1. An Algorithm for Distributed Computation of a Spanning Tree in an Extended LAN, Radia Perlman, SIGCOMM '85 (scan at Northeastern University) (accessed 6 November 2026)
  2. An algorithm for distributed computation of a spanningtree in an extended LAN, ACM SIGCOMM Computer Communication Review 15(4) (accessed 6 November 2026)
  3. IEEE 802.1D-1990, IEEE Standards Association (accessed 6 November 2026)
  4. IEEE 802.1w-2001, IEEE Standards Association (accessed 6 November 2026)
  5. 802.1w - Rapid Reconfiguration of Spanning Tree, IEEE 802.1 Working Group (accessed 6 November 2026)
  6. RFC 6325: Routing Bridges (RBridges): Base Protocol Specification, RFC Editor (accessed 6 November 2026)