What Is STP Root Bridge Election? Bridge ID, Priority and MAC Address

What Is STP Root Bridge Election? Bridge ID, Priority and MAC Address
Networking ATN Campus October 01, 2026 82 views

What Is STP Root Bridge Election? Bridge ID, Priority and MAC Address

In a switched network, redundant links are useful for availability, but they can also create Layer 2 loops. The Spanning Tree Protocol (STP) helps prevent these loops by logically placing some redundant paths into a blocking state.

One of the most important parts of STP is the election of a Root Bridge. The Root Bridge becomes the reference point that switches use when calculating the spanning-tree topology.

```

What Is the Root Bridge?

```

The Root Bridge is the switch selected by STP as the central reference point for a particular Layer 2 spanning-tree topology.

Other switches calculate their best path toward the Root Bridge and use STP port roles and states to create a loop-free topology.

                Root Bridge
                +---------+
                | Switch1 |
                +----+----+
                     |
          +----------+----------+
          |                     |
     +----+----+           +----+----+
     | Switch2 |-----------| Switch3 |
     +---------+           +---------+

   STP calculates paths toward Switch1
```

Why Does STP Need a Root Bridge?

```

Consider a network with redundant connections:

         Switch1
        /       \
       /         \
   Switch2 ----- Switch3

The redundant link between Switch2 and Switch3 provides an alternative path, but it also creates a potential Layer 2 loop.

STP selects a Root Bridge and calculates a loop-free topology. One or more redundant paths may then be placed into a non-forwarding state.

```

How Does STP Choose the Root Bridge?

```

STP uses the Bridge ID (BID) to elect the Root Bridge.

The switch with the lowest Bridge ID becomes the Root Bridge.

         Lowest Bridge ID
                ↓
          Root Bridge
```

What Is a Bridge ID?

```

A Bridge ID identifies a switch for STP purposes. It contains important information used during the election process.

Conceptually, the Bridge ID is based on:

  • Bridge Priority
  • MAC address

In modern Cisco implementations, the STP Bridge ID also incorporates VLAN/system-ID information as part of the extended system ID.

```

STP Bridge Priority

```

Bridge Priority is one of the most important values used during Root Bridge election.

A lower priority is preferred.

   Lower Priority
         ↓
   Better chance
   of becoming
   Root Bridge

On Cisco switches, the traditional default bridge priority is commonly 32768, with the exact effective value influenced by the extended system ID.

```

What Happens When Priorities Are Equal?

```

If switches have the same effective bridge priority, STP uses the MAC address as the next comparison factor.

The switch with the lowest MAC address wins the election when the relevant priority values are equal.

   Switch A
   Priority = Same
   MAC = 0011.1111.1111

          VS

   Switch B
   Priority = Same
   MAC = 0022.2222.2222

          ↓

   Switch A wins
   because its MAC is lower
```

Root Bridge Election Example

```
Switch Priority MAC Address Result
SW1 32768 0011.1111.1111 Candidate
SW2 32768 0022.2222.2222 Candidate
SW3 24576 0033.3333.3333 Root Bridge

SW3 has the lowest priority, so it wins the election regardless of its higher MAC address.

```

What If All Switches Have the Same Priority?

```

If all relevant priorities are equal, the switch with the lowest MAC address becomes the Root Bridge.

    SW1
    Priority 32768
    MAC 0011....

         ↓

    SW2
    Priority 32768
    MAC 0022....

         ↓

    SW3
    Priority 32768
    MAC 0033....

         ↓

    SW1 wins
    because MAC is lowest
```

Why Should We Manually Choose the Root Bridge?

```

In a production network, network administrators generally want the Root Bridge to be a strategically selected switch rather than leaving the election entirely to default values.

A poorly positioned Root Bridge can result in less desirable traffic paths and unnecessary use of network links.

Therefore, administrators can configure STP priority to influence the election.

```

Cisco Example: Making a Switch Root

```

On supported Cisco IOS platforms, the following command can be used to make a switch preferred as the Root Bridge:

```

Switch(config)# spanning-tree vlan 10 root primary 
```

Cisco can adjust the priority to make the switch more likely to become the Root Bridge for that VLAN.

You can also configure the priority directly:

```

Switch(config)# spanning-tree vlan 10 priority 24576 
```

A lower priority gives the switch a better position in the Root Bridge election.

```

Verifying the Root Bridge

```

One of the most useful Cisco commands for checking STP is:

```

Switch# show spanning-tree 
```

The output can show information such as:

  • Root Bridge information
  • Bridge ID
  • Root path cost
  • Port roles
  • Port states

You can also specify a VLAN:

```

Switch# show spanning-tree vlan 10 

Bridge ID Comparison

```

A simplified way to remember Root Bridge election is:

    Compare Bridge IDs

         ↓

   Lowest priority
         ↓
   If tied...
         ↓
   Lowest MAC address
         ↓
    Root Bridge

In actual modern STP implementations, the Bridge ID includes the extended system ID, so Cisco's displayed priority may include a VLAN-related component.

```

Root Bridge and STP Topology

```
                 ROOT
               +-------+
               | SW1   |
               +---+---+
                   |
          +--------+--------+
          |                 |
      +---+---+         +---+---+
      | SW2   |---------| SW3   |
      +-------+         +-------+

   SW2 and SW3 calculate
   paths toward SW1.

   A redundant path may be
   placed into a non-forwarding state.

The Root Bridge does not mean that every packet in the network must physically pass through that switch. Rather, it provides the reference point for STP's topology calculations.

```

Root Bridge Election Steps

```
  1. Switches exchange STP Bridge Protocol Data Units (BPDUs).
  2. Switches compare the Bridge IDs advertised in BPDUs.
  3. The switch with the best (lowest) Bridge ID becomes the Root Bridge.
  4. Other switches calculate their best path toward the Root Bridge.
  5. STP assigns appropriate port roles and states.
  6. Redundant paths are prevented from forwarding simultaneously where necessary.
```

What Is a BPDU?

```

A BPDU (Bridge Protocol Data Unit) is a control frame used by STP-capable switches to exchange spanning-tree information.

BPDUs allow switches to learn information about the spanning-tree topology and determine the appropriate Root Bridge and port roles.

```

Practical Packet Tracer Lab

```

Topology

         SW1
        /   \
       /     \
     SW2-----SW3

Tasks

  1. Create the three-switch topology.
  2. Connect the switches with redundant links.
  3. Configure VLAN 10 on the switches.
  4. Check the initial STP Root Bridge.
  5. Configure SW1 with a lower STP priority.
  6. Verify that SW1 becomes the Root Bridge.
  7. Check the STP port roles on SW2 and SW3.
  8. Disconnect one link and observe the topology change.

Useful Commands

```

Switch# show spanning-tree
Switch# show spanning-tree vlan 10 

Quick Quiz

```

Question 1

What is the Root Bridge?

Show Answer

The switch selected by STP as the reference point for the spanning-tree topology.

Question 2

Does STP prefer a higher or lower Bridge ID?

Show Answer

STP selects the switch with the lowest Bridge ID.

Question 3

What happens when Bridge priorities are equal?

Show Answer

The MAC address becomes the next comparison factor, and the switch with the lower MAC address wins.

Question 4

What does a lower STP priority do?

Show Answer

It makes the switch more preferred in the Root Bridge election.

```

Key Takeaways

```
  • STP prevents Layer 2 switching loops.
  • The Root Bridge is the reference point for STP calculations.
  • STP elects the switch with the lowest Bridge ID.
  • Bridge priority is an important part of the Bridge ID.
  • Lower priority is preferred.
  • If priority values are equal, the lower MAC address wins.
  • BPDUs carry STP information between switches.
  • Administrators can intentionally select a Root Bridge by configuring STP priority.
  • show spanning-tree is an essential Cisco verification command.
```
```

Want to Learn STP and Switching? Visit ATN Campus

Want to learn STP, VLANs, switching, routing, subnetting, network security, and network troubleshooting through practical training?

Visit ATN Campus and build your networking skills through theory combined with practical Cisco labs and real-world networking scenarios.

Learn More Than Just STP

  • CCNA – Cisco Certified Network Associate
  • CCNP – Cisco Certified Network Professional
  • VLANs & Trunking
  • STP & RSTP
  • Routing & Switching
  • Inter-VLAN Routing
  • Network Security
  • CEH – Certified Ethical Hacker
  • Cisco Packet Tracer Labs
  • Python for Network Automation

Whether you are a beginner, preparing for CCNA or CCNP, or building practical networking skills, ATN Campus can help you move from theory to hands-on networking.

???? Want to learn networking? Visit ATN Campus.

???? Learn Networking. ???? Master Routing & Switching. ???? Practice with Real Labs. ???? Prepare for Certifications. ???? Build Your IT Career with ATN Campus.
Document ATN CAMPUS