# bridge id in stp

Jun 1st, 2008
• Bronze, 100 points or more

hi every body!

i was studying stp and one thing baffled me about bridge id.

bridge id uses mac address and priority

but which mac address is used for bridge id as a switch could have as many mac address as ports it could have ?

my second question is about selection of root port on non- root switch.

what happens if a non-root switch receives the two Bpdu with the same root path cost from its two neighbor, assuming non-switch has same path cost configured on the ports BPdu received?

let me explain my question better with example.

assume root port is already elected

switch A is connected to swich B via f0/1 and switch C via f0/2

switch A has path cost of 1 on f0/1,f0/2

swA receives BPDU fron sw B with root pah cost =3 on f0/1. swA receives another BPDU from sw C with the root path cost 3 on f0/2

SWA finds that the cost to reach root switch via f0/1 is

3+1=4 ( add the path cost 1 of f0/1 to the root path cost received in bpdu from sw B)

SWA also finds the cost to reach root switch is

3+1=4 ( add the path cost 1 of f0/2 to the root path cost received in bpdu from sw C)

which port Would swA select as a root port?

thanks lot!

The sequence of selection is like this:

lowest priority --> lowest mac-add --> lowest path cost --> lowest port id.

The interface MAC address does not play into the Spanning-Tree equation. The switch MAC address does.

As for the other query, yes - you are correct. It's exactly as I stated in my previous post. The lower number port will be preferred when all things being equal.

HTH,

__

Edison.

Overall Rating: 5 (3 ratings)

## Replies

Edison Ortiz Sun, 06/01/2008 - 09:29
• Super Bronze, 10000 points or more
• Hall of Fame,

Founding Member

bridge id uses mac address and priority

but which mac address is used for bridge id as a switch could have as many mac address as ports it could have ?

The switch only uses one MAC Address. This MAC Address can be found in the show version command.

Here is the output on a 3560 switch:

S1#sh ver | i MAC Address

Base ethernet MAC Address : 00:17:59:F6:10:00

S1#sh spanning vlan 1 | i Address

S1#sh spanning vlan 21 | i Address

The MAC Addresses which are associated to a port when issuing the show mac-address-table command are from devices attached to the switchport, not the switch itself.

what happens if a non-root switch receives the two Bpdu with the same root path cost from its two neighbor, assuming non-switch has same path cost configured on the ports BPdu received?

One port will go in blocking mode and the one in forwarding mode will be the lowest port number (with all things being equal).

If F0/1 and F0/2 are the ports, F0/1 will be forwarding and F0/2 blocking.

HTH,

__

Edison.

sarahr202 Sun, 06/01/2008 - 12:54
• Bronze, 100 points or more

hi edison

when i used the command " show int " on a switch , I did find a mac address though switch is not connected to any port. Please check the attachment.

I also noticed in your reply, that f0/1 was selected for forwarding while f0/2 was blocked.

correct me if i am wrong, If a switch receives two two bddu with equal cost on f0/1 and f0/2, assuming everthing else being equal,then f0/1 is selected as forwarding port because f0/1 has lower slot number than f0/2. Am i right ?

switch use the mac adddress for bridge id which can be seen by " show version command "Am i correct?

thanks alot 1

Attachment:
Edison Ortiz Sun, 06/01/2008 - 13:24
• Super Bronze, 10000 points or more
• Hall of Fame,

Founding Member

The interface MAC address does not play into the Spanning-Tree equation. The switch MAC address does.

As for the other query, yes - you are correct. It's exactly as I stated in my previous post. The lower number port will be preferred when all things being equal.

HTH,

__

Edison.

sarahr202 Sun, 06/01/2008 - 13:59
• Bronze, 100 points or more

Thanks alot Edison !

I find that crieria to break the tie to choose rootport or designated port on a switch is

Root path cost If tie, lower sender bridge id, will be used to choose root port or designated port.

However, in your response, i learnt it is the port slot that will be used ,if root path cost is same, to choose root port/designated port.

So which one is correct?

thanks alot for your help !

bvsnarayana03 Mon, 06/02/2008 - 00:12