Spanning-Tree Root Bridge Configuration

This topic is to discuss the following lesson:

may i know what u have updated in this lesson compared to previous article ??

Hi everyone
what tips or practices do you use to search for root bridges quickly
in a network with 290 switches

thank you

Hello Giovanni

In order to find the root bridge, you can issue the show spanning-tree command, and this will show you the root bridge for each VLAN configured on the switch. You’ll get something like this:

SW2#show spanning-tree vlan 10

VLAN0010
  Spanning tree enabled protocol ieee
  Root ID    Priority    24586
             Address     5254.001a.935a
             Cost        4
             Port        1 (GigabitEthernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    28682  (priority 28672 sys-id-ext 10)
             Address     5254.0015.bc74
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Gi0/0               Root FWD 4         128.1    P2p 
Gi0/1               Desg FWD 4         128.2    P2p

From the above output, you can see that for VLAN 10, the root bridge has an address of 5254.001a.935a. You also know which is the root port.

Now if you know nothing else about your network of 290 switches, it may be hard to find that particular switch. What you can do is take a look at the cost to the root bridge, and this will give you an idea of how far away it is. In this case, the cost is 4. For more info on how to interpret these costs, take a look at the NetworkLessons note on STP cost calculation methods.

Once you know the cost and the root port from the output, you can determine how far away the root bridge is, and via what path you can get there. You can trace your way back, from switch to switch, until you reach it. If you have no other information, that would be the way to find the root bridge.

Now having said that, even if you have 290 switches it is unlikely that the root bridge for any particular VLAN would be very far away from any switch. An STP tree should never be more than six or seven switches in diameter, and a network of 290 switches should be subdivided into several network segments anyway. A purely Layer 2 network of so many switches would not be functional.

But in most networks of that size, you would have some sort of monitoring system, so if you learn the MAC address of the root bridge, you can then search for it easily within that monitoring system. And in most such networks, you would manually configure the switches in such a way so that a specific device would become the root bridge, thus any (responsible) administrator should know which switch that is… :stuck_out_tongue:

I hope this has been helpful!

Laz

Question about the BID.
What is the purpose to add the vlan id to the priority ?

Hello Michael

The valid values for bridge priorities in STP are between 0 and 61440. Hpwever, the value must be in increments of 4096. So in practice, the valid values for bridge priorities are: 0, 4096, 8192, 12288, …, up to 61440.

Have you ever wondered why they’re in increments of 4096? It’s not a coincidence that the VLAN ID is a 12-bit value, which can represent up to 4096 VLAN IDs. The reason is because for every VLAN you have a different priority.

In the original 802.1D standard for Spanning Tree Protocol, the 2-byte (16-bit) Priority field in the BPDU is actually divided into two parts: the most significant 4 bits are for the Priority, and the least significant 12 bits are for the VLAN ID. This scheme is used in a variant of STP known as Per-VLAN Spanning Tree Plus (PVST+), which is common on Cisco devices.

This means that the Bridge Priority is effectively a 4-bit value, but it’s still stored in a 16-bit field along with the VLAN ID. Because of this, it can only be incremented in steps of 2^12 (4096), which corresponds to shifting the bits over by 12 places. This is why the valid priorities are multiples of 4096.

So a bridge with a set priority of 12288 that is using VLAN 7 will actually have a priority value in the BPDU field of 12288+7 = 12295. That priority value is unique to VLAN 7 because you can have a root bridge for each individual VLAN, and the priorities must be unique. Does that make sense?

I hope this has been helpful!

Laz