Avatar of Habi Z
Habi Z
 asked on

Finding the designated ports and root ports

Hi Experts,

I have issue always identifying the root ports and the designated ports on the switchs. My issue is that I can not understand which mac address is lower then the other. What should I compare. Is there any logical explanation that someone can give me.

I have 4 swtiches and the question is to identify the port roles for 3 switches.

identify the RSTP ports.
Network ManagementNetwork OperationsNetwork Architecture

Avatar of undefined
Last Comment

8/22/2022 - Mon

Just think of it chronologically
      OPQR STUV WXYZ (let's call these columns)
A = 0013.8039.9500
B = 0013.80d7.d580
C = 0013.8030.5e80
D = 0013.80c7.9700

All MACs start with 0013.80xx.xxxx
Columns O through T are the same
1st (digressing) all 4 switches are made by the same manufacturer (based on the values above)
These range is owned by Cisco

Hex number range
0 1 2 3 4 5 6 7 8 9 A B C D E F
0 being the least and F being the highest

the addresses start to change from column U.
3 is the lowest number in this column but 2 devices A and C have 3 in that column.
This eliminates B and D as candidates for lowest Mac address
0 is the lowest number in column V
We don't have to proceed since there is no tie any more.

C has the lowest Mac Address

Arranging the switches from lowest mac to highest mac, we will have

C = 0013.8030.5e80
A = 0013.8039.9500
D = 0013.80c7.9700 (C is lower than D in column U)
B = 0013.80d7.d580

Default rule for Root bridge if all devices have default priority (33768) is that the oldest device becomes the root bridge.

During production, manufacturers will assign mac addresses chronologically  just like you would assign numbers to your anything if you have multiple items
eg 1st car, 2nd Car 3rd car etc
Cisco (identified by 0013.80) will have the first mac address for that range as
the next device will be 0013.8000.0002 etc
the 9th device will be 0013.8000.0009
the 10th device would normally be 0013.8000.00010 (but that exceeds 4 bits.
10 will therefore be replaced with A
So you 10th device will be 0013.8000.000A
the 11th device will be 0013.8000.000B
the 15th device will be 0013.8000.000F

15 is the maximum number when counting in hexadecimal, just like you would move from 9 to 10 in decimal, you would move from F to 10 in hexadecimal
So your 16th device will be 0013.8000.0010 and so on.

The Default priority is 32768
For Vlan 1, the default priority will be default + vlan number
= 32768 + 1 = 32769
For Vlan 2
32768 + 2 = 32770
for vlan 10
32768 + 10 = 32778
You can then influence which device becomes the root bridge by lowering the priority for that device.
Spanning tree will go through the following checks to determine Root bridge.
1. Checks priority per vlan. It then selects the device with the lowest priority. If there is a tie (that is, 2 devices having the same priority)
Spanning tree will then skip to step 2
2. Selects the device with the lowest Mac address

Port Assignment
the Root bridge (Imagine it as King) has no restrictions on it's port.
It is honored by having all its ports in Designated (forwarding) state.
Every other device will now decide which of their ports is closest to the root bridge.
Once they elect that port, they will identify it as the Root Port (Meaning, this port is the closest to the Root Bridge and we must use this port to connect to the Root Bridge)

In essence, there will only be 1 Root Port per switch on the network except for the Root Bridge Switch.

There is NEVER a Root Port on a Root Bridge because it does not need to connect to itself.

Spanning tree sends probes into the network to determine loops and it is also used in the election of a Root Bridge. Every switch when turned on assumes it is the root bridge (per vlan) until it receives a BPDU (Bridge Protocol Data Unit) from another switch and finds out that the other device either has a lower priority or a lower mac address than itself. It then freely submits to that switch. If it receives another BPDU form another device that has even a lower priority or mac address than the previous switch it had assigned as its Root Bridge, it automatically replaces the old switch and makes the new switch the Root Bridge.
This is done per vlan
Every Switch sends out BPDUs to announce itself to other switches on the network and also inspect other BPDUs it finds.
A switch never expects to receive its own BPDU (by default as the BPDU would not return the way it went out. If however, a switch sees it's own BPDU, it knows there is redundancy set up somewhere which potentially can cause a loop.
It will then determine which of the redundant connections it needs to block if it is the "Highest switch in the pile based on priority or mac address.

I hope this helps.

I have made an article out of this.
"Root Bridge Election"

This will have a sequel
"Blocked Port Selection"
Habi Z

Hi Askinsd,

Your explanation does help me and now I know Switch C is the root switch. Why in the diagram cisco has FA01 connected to Gi0/1? Does bandwidth play any role in selecting root port or designated port?

Thank you.

Yes Bandwidth and number of hops determines which port becomes the Root Port.
Root Port on a switch is considered the fastest port to the root bridge. The bigger the bandwidth, the faster the link, and the lower the cost

Which Switch are you referring to? (Fa01 to Gi01)

Just to clarify
E01 - Indicates an Ethernet port 01(Though not used in the pic above)
Ethernet ports are 10Mbps. Associated cost is 100
Fa01 -  Indicates an Fast Ethernet port 01 - 100Mbps. Associated cost is 19
Gi01 -  Indicates an Gigabit Ethernet port 01 - 1000Mbps or 1 Gbps. Associated cost is 4

The port with the lowest cost to the Root Bridge becomes the Root Port. All other ports are Designated (Forwarding) with the exception if the Switch is the highest in the pile (least efficient) in which case one of the ports has to be blocked.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.

View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.