The idea
core, floor1 and floor2 are three switches cabled in a triangle, with alice, bob and a printer plugged in. Rapid Spanning Tree (RSTP) keeps a spare port ready, so a cut cable heals in about a second, and host ports forward at once.
Steps
-
Port roles and states: the loop, solved
The triangle is a loop, so one cable end must not pass traffic, as in classic spanning tree. core's priority is lowest, so core is the root. Ask floor2 for its RSTP view.
floor2:~# ovs-appctl rstp/show br0 core:~# ovs-appctl rstp/show br0
-
Edge ports (PortFast): a host port forwards at once
Behind bob's port there is only bob, no switch, so no loop can start there and waiting is wasted. We make it an ordinary port and bounce its cable; then we mark it edge and bounce it again.
floor2:~# ovs-appctl rstp/show br0 floor2:~# ovs-appctl rstp/show br0
Pro
3 more steps in the app
- Rapid convergence: a cable fails
- BPDU guard: a switch on an access port is shut down
- BPDU filter: a silent edge port