HomeCybersecuritySpanning Tree Protocol: Loop Prevention (2D)

Spanning Tree Protocol: Loop Prevention (2D)

Top-down 2D switched-network simulator: a live force-directed graph layout draws a random switch topology while the real IEEE 802.1D Spanning Tree Protocol elects a root bridge, computes root path costs over per-speed port costs, and blocks redundant links to break every Ethernet loop.

Cybersecurity2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-network-engineering ↗ Open standalone

Real switched networks are wired with redundant links for resilience — but two switches connected by more than one active path create a broadcast loop that can melt a LAN in seconds. This top-down 2D companion to the 3D STP simulator draws its random switch topology with a live force-directed (spring-electrical) graph layout instead of a fixed 3D placement — switches repel each other, cables pull toward a natural length, and the whole graph settles into a readable shape you can reshape by dragging any switch. On top of that layout runs the real IEEE 802.1D Spanning Tree algorithm: root bridge election by Bridge ID, root path cost using standard per-speed port costs, and root/designated/blocking port assignment, rendered live — green and cyan links are forwarding, dimmed red links are blocked to break every loop, and animated pulses trace BPDUs flowing outward from the root along the resulting spanning tree.

⚙ Under the hood

Top-down 2D switched-network simulator: a live force-directed (spring-electrical) graph layout draws a random switch topology while the real IEEE 802.1D Spanning Tree Protocol elects a root bridge, computes root path costs from per-speed port costs, and blocks redundant links to eliminate Ethernet loops.

networkingspanning-treestpswitchesloop-preventionieee-802.1dforce-directed-graphgraph-layout

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)