I think that I shall never see
a graph more lovely than a tree.
A tree whose crucial property
is loop-free connectivity.
A tree which must be sure to span
so packets can reach every LAN.
First the root must be selected.
By ID it is elected.
Least cost paths from root are traced.
In the tree these paths are placed.
A mesh is made by folks like me,
then bridges find a spanning tree.
Network Protocol  ·  December 1985

Spanning Tree Protocol

Radia Perlman 1951—
Digital Equipment Corporation

The protocol that prevents the internet from collapsing under its own echoes — written in one night, expressed as a poem, still running invisibly inside every ethernet switch on the planet.

Lesson 5
I think that I shall never see
a graph more lovely than a tree.
Problem Statement

A network is a graph — nodes connected by edges in all directions, with loops and redundant paths. This redundancy is by design: ARPA built the internet to survive a nuclear strike. But redundancy creates catastrophe. A message splits at every junction, copies multiply, the network drowns in its own echoes. A tree — a graph with no loops — is the solution.

A tree whose crucial property
is loop-free connectivity.
The Constraint

Two requirements, stated precisely: no loops and full connectivity. Every node reachable. No message circling forever. These two constraints together define the spanning tree problem — one of the foundational problems in graph theory, solved here in a single line of verse.

A tree which must be sure to span
so packets can reach every LAN.
The Scope

"Span" is a precise mathematical term: a spanning tree touches every single node in a network without creating loops. LAN — local area network — grounds the abstraction in physical reality. This must work in practice, on real machines, inside real buildings. The poem moves from theory to engineering in one couplet.

First the root must be selected.
By ID it is elected.
Step One — Election

The algorithm begins. Every switch has a unique ID. They exchange small messages and the switch with the lowest ID becomes the root. No human decides. No central authority. The machines vote autonomously and reach consensus. This is distributed computing — order emerging from conversation, like a flock of birds, not a railway timetable.

Least cost paths from root are traced.
In the tree these paths are placed.
Step Two — The Tree

From the elected root, the algorithm traces the cheapest path to every other node. "Cost" can mean distance, speed, or reliability. These paths become the active connections — all others fall dormant, sleeping backups ready to wake if something fails. The spanning tree is assembled.

A mesh is made by folks like me,
then bridges find a spanning tree.
The Closing — Human and Machine

The final couplet is the most honest. Engineers like Perlman build the redundant mesh — all those backup connections, all that expensive cable. Then the algorithm finds the tree within it. Human work creates the raw material; distributed computation finds the order. The poem ends where it began: with the tree, now earned.

In December 1985, a manager at Digital Equipment Corporation handed Radia Perlman a problem he considered probably unsolvable — possibly to be rid of the question. Ethernet networks were fragile: redundant connections were necessary for reliability, but they caused broadcast storms that could bring entire networks down. She went home. She woke in the night with the solution. The next day she wrote it up. The spec was complete enough that engineers implemented it without further questions. She also wrote the poem.

The Spanning Tree Protocol is now embedded in virtually every ethernet switch manufactured since 1990. It runs silently, continuously, without anyone in charge — distributed machines reaching consensus through small messages, the lowest ID elected root, least-cost paths traced, all other connections held dormant as sleeping backups. Perlman spent more time on the poem than on the algorithm. The constraint of verse forced her to state each step precisely, in the right order, without ambiguity. This is, she has noted, also what good code does.

Minimum spanning tree — an interactive demonstration of the algorithm Perlman encoded in verse. Mike Bostock, Observable.

She had almost not been there. A teacher brought her undergraduate class to a computing demonstration at Stevens Institute of Technology. She felt she couldn't keep up with the other students and came home discouraged. A teaching assistant at MIT, where she later enrolled, asked her to help with a physics project. When she said she didn't know how to program, he replied: "Yes, I know. That's why I'm asking you. You're obviously bright, so I'm sure you can learn." She stayed.

VAX 11-780, Digital Equipment Corporation
VAX 11-780, Digital Equipment Corporation, c. 1980. The machine on which the Spanning Tree Protocol was first implemented. Dr. Bernd Gross, CC BY-SA 4.0.

Perlman received no royalties. For years the protocol was credited to others. She has been called "the Mother of the Internet," a title she finds reductive and slightly annoying. She would prefer you understood what the problem actually was, and what the solution did. Networks that self-organize without central authority are a design choice, not a natural condition. The consequences of that choice are still accumulating.

Radia Perlman
Radia Perlman
Born
December 18, 1951 Portsmouth, Virginia
Written
One night, December 1985 Digital Equipment Corp.
Still running
Every ethernet switch manufactured since 1990
Earlier work
TORTIS — Logo for children aged 3½, MIT
Other interests
Piano, French horn, poetry, writing
01

It demonstrated that a complex distributed problem — machines reaching consensus without any central authority — could be solved elegantly, and expressed completely in twelve lines of verse.

02

It is one of the earliest and clearest examples of an algorithm written first as poetry — form and function unified. The poem is not a metaphor for the algorithm. It is the algorithm.

03

Perlman's career — from making code accessible to toddlers, to building invisible infrastructure — is a consistent argument that the most important code is code nobody notices. Elegance is what disappears.

Write the algorithm you use to make a decision — any decision — as a short poem. No more than six couplets. Each couplet is one step.

Perlman spent more time on the poem than on the algorithm itself. The constraint of verse forced her to state each step precisely, in the right order, without ambiguity. That is also what good code does. You are not writing poetry about a decision. You are writing the decision as poetry. Bring your poem to the session. We will read them aloud.