Click a switch to make it root · drag a switch to reshape the layout

Spanning Tree Protocol: Loop Prevention (2D)

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.