Spanning tree election calculator
The root bridge, every root port, every designated port and the ports left as alternate or backup in a small switched network you describe in a few lines, each step with the comparison that decided it; and the long (802.1t) and short (802.1D-1998) path costs by link speed, with each vendor's documented default.
NetworkingKept in this browser · My desk
Path cost method
bridge SW1 32768 00-00-5E-00-53-01: a name, a priority (a multiple of 4096 from 0 to 61440) and a MAC address; end the line withshortorlongto give that bridge its own path cost method.link SW1:1 SW2:1 1G: two ports and a speed (10M, 100M, 1G, 10G, 25G, 40G, 50G, 100G, 1T or 10T), orcost 4000in place of the speed; three or more ports make a shared segment.port SW1:2 priority 64orport SW1:2 cost 4000: a port priority (a multiple of 16, 128 by default) or a cost for that port alone.vlan 10adds the VLAN ID to every priority (the system ID extension);priority-format 802.1dreads the 16-bit priorities of 802.1D-1998. A # starts a comment.- Up to 16 bridges, 32 links, 8 ports on a segment, 128 ports, 80 lines and 4000 characters.
Runs locally in your browser. Nothing is sent anywhere.
Describe a switched network, one statement per line, or press Example for the course's six-bridge example (chapter 2.4, slide 259).
API endpointGEThttps://ronutz.com/api/v1/stp-election-calculatorDocumented, not served. Opens the specification.
References
- IEEE 802.1, ieee802-dot1q-rstp YANG module, revision 2025-02-04: bridge-id (4-bit priority, 12-bit system ID extension, 48-bit address), port-id (4-bit priority, 12-bit port number), port-role, root-path-cost, port-path-cost (1 to 200000000)
- IEEE 802.1, IEEE8021-SPANNING-TREE-MIB, LAST-UPDATED 2022-11-08 (published with IEEE 802.1Q-2022): ieee8021SpanningTreePriority, ...PortPriority, ...PortPathCost
- RFC 4188, Definitions of Managed Objects for Bridges, September 2005: dot1dStpPriority, dot1dBaseBridgeAddress, dot1dStpPortPriority, dot1dStpPortPathCost, dot1dStpPortPathCost32, dot1dStpPortState
- RFC 9542, IANA Considerations and IETF Protocol and Documentation Usage for IEEE 802 Parameters, April 2024 (BCP 141, obsoletes RFC 7042): sections 2.1.1 and 2.1.4
- IEEE SA, IEEE 802.1D-2004, Media Access Control (MAC) Bridges: Superseded Standard, published 2004-06-09, superseded by 802.1Q-2014
- IEEE SA, IEEE 802.1Q-2022, Bridges and Bridged Networks: Active Standard, published 2022-12-22
- Juniper Networks, Spanning Tree Protocols User Guide, Junos OS: spanning tree protocols overview (bridge priority, root and designated bridge election, port roles and states)
- Juniper Networks, Junos OS CLI Reference: cost (Protocols STP, RSTP, VSTP, MSTP)
- Juniper Networks, Junos OS CLI Reference: show spanning-tree interface (example output)
- MikroTik, RouterOS Manual 7.24: Bridging and Switching (bridge settings: priority, protocol-mode, port-cost-mode; port settings: path-cost, priority)
- MikroTik, RouterOS Manual 7.24: Spanning Tree Protocol user guide (default values, election process)
- Extreme Networks, Switch Engine v33.7.1 Command References: configure stpd ports cost
- Extreme Networks, Switch Engine v33.7.1 Command References: configure stpd priority
- Extreme Networks, Fabric Engine v9.4 User Guide: Configure Multiple Spanning Tree Protocol
- Cisco, Layer 2 Configuration Guide, Cisco IOS XE 17.18.x (Catalyst 9300 Switches): Configuring Spanning Tree Protocol (read via WebFetch: the site refused curl)
- Cisco, Layer 2 Configuration Guide, Cisco IOS XE 26.x (Catalyst 9300): Configuring Spanning Tree Protocol (read via WebFetch: the site refused curl)
- Cisco, STP Configuration Guide, Cisco IOS XE 17: Spanning Tree Protocol (updated 17 July 2026) (read via WebFetch: the site refused curl)
- Cisco, Command Reference, Cisco IOS XE 17.18.x (Catalyst 9300 Switches): Layer 2/3 Commands, spanning-tree pathcost method, spanning-tree cost, show spanning-tree (read in a browser on 2026-11-08: the site refuses automated reads)
- Cisco, Command Reference, Cisco IOS XE 26.x.x (Catalyst 9300 Switches): Layer 2/3 Commands, spanning-tree pathcost method (read in a browser on 2026-11-08: the site refuses automated reads)
- Huawei, S5700 and S6700 V200R025C00 Command Reference: STP/RSTP/MSTP/VBST Configuration Commands, stp pathcost-standard (Table 5-92), stp cost, stp mode (read in a browser on 2026-11-08: the site refuses automated reads)
- Cisco, Troubleshoot STP Root Inconsistency Due to Path Cost Mismatch, document 225591, updated 11 March 2026 (read via WebFetch: the site refused curl)
- HPE Aruba Networking, AOS-CX 10.16 Layer-2 Bridging Guide (6300/6400): spanning-tree cost (read via WebFetch: the site refused curl)
- Arista Networks, EOS 4.37.0F User Manual: Spanning Tree Protocol (read via WebFetch: the site refused curl)
- Cisco Networking Academy, Scaling Networks Companion Guide, Cisco Press, 2014 (ISBN 978-1-58713-328-2), chapter 2: Table 2-1
- RFC Editor, RFC index (XML): the current status of RFC 4188, RFC 9542 and RFC 7042
- RFC 3986, Uniform Resource Identifier (URI): Generic Syntax, January 2005: section 3.5 (fragment)