L2 vs L3 switches (switch class)
Switches come with different amounts of brains, and the price tag follows. A "basic" switch just shovels packets between its ports — no smarts, cheap, and happy until you give it a second cable to the same place. A "smart" switch adds a loop guard: run a redundant cable and it quietly parks the spare as a standby instead of letting it cause trouble. A "routing" switch is the smartest of the three — it can move traffic between separate networks AND use every redundant cable at the same time, not just hold one in reserve.
The danger shows up the moment you wire two paths between the same two boxes. A basic switch has no way to tell "this is the same place I already reach" — the duplicate cable forms a loop, traffic chases its own tail, and the whole segment melts in a broadcast storm. A smart switch sees the loop and stands the spare down (safe redundancy: instant standby if the live one dies). A routing switch goes one better and runs BOTH cables live at once. So: basic is cheap but dangerous with redundant cabling; smart gives you safe standby paths; routing gives you active-and-active plus the ability to grow into a big fabric.
Garage starters are basic switches — fine while every box has exactly one cable. The first time you want a backup link, step up to a smart switch so the redundancy is safe instead of a time bomb. When you start building real fabric — leaves and spines that lean on every path at once — you need routing switches. Higher tiers cost more up front and draw more power, so don't pay for routing you won't use yet, but don't run a basic switch anywhere you've doubled up the cabling.
Detailed explanation
The capability axis is SwitchClass, authored explicitly per SKU (NOT inferred from role or port speed — a 1G box can be L3, a 10G box can be dumb L2). Unmanaged: no control plane, pure bridging, runs_stp() is false — a cabling loop can't be broken and degrades to a broadcast storm that saturates the segment. ManagedL2: runs STP/RSTP, so a redundant inter-switch link is blocked into a safe standby (active/standby); loops park gracefully. ManagedL3: routes between networks and can run a link in Routed/L3 mode with ECMP — both members of a redundant pair carry traffic (active/active) and the link is loop-exempt, never STP-blocked.
Layer 2 = same network / bridged: devices share one broadcast domain and talk to each other directly by MAC. Layer 3 = a routed hop: traffic is forwarded BETWEEN networks by IP. An unmanaged or L2-managed switch keeps you inside one bridged domain; an L3 switch is the prerequisite for routing between domains AND for ECMP load-sharing across redundant uplinks. l3_capable() is true only for ManagedL3 — that's the gate on leaf/spine active/active fabrics versus L2 STP active/standby.
Match class to topology, not to budget. Unmanaged is acceptable only on single-homed edges with no redundant cabling. Any redundant pair demands at least ManagedL2 (STP saves you from the storm) — ideally ManagedL3 if you want both links live. Clos fabric (leaf/spine, ECMP everywhere) is ManagedL3-only by construction. Tier up = more capex + higher draw on the power budget, so size the class to the cabling you actually run.