# STP Cost Paths Question

Hi everybody,

I am just an IT student and i am actually learning about STP protocol. At school they told us one thing that seems weird to me :

I precise that we decided to not consider the priority field (priority number + vlan id) in the Bridge ID section so that the Bridge ID is only composed of the Mac @ of the bridge.

When you have a bridge that is not directly connected to the root bridge but offers two paths that have the same cost to reach the root bridge, the bridge will select what ? the lowest path I guess (Lowest BID) but the teacher told us that only the root bridge election process used the lowest BID and that for the selection of one path between two paths with the same costs we must consider the highest BID (seems weird no ? Coz' with Cisco I learned that Lowest is best ....)

Thus i have an exam in 4 days and that i tried to join my teacher without success, i am asking the community.

Thanks to everybody that reads this post and therefore responds.

-- Ropza --

• Hello

Here's the logic (algorithm) that makes the path selection when there is a tie between same cost and stuff like that.

1) first of all the highest priority will be given to the " priority field " and a mac address. [ KEEP IN MIND THAT IN STP WORLD LOWER IS BETTER ]. Incase of same priority, lowest MAC address will win.

2) if tie between two same cost path occurs then  " Port ID " [e.g. 128 / (0/1) ] will be used to determine the path.

Ex.  (Least cost )--> if same then (compare BPDU ) ----> if same sending BID then ----> compare sending Port ID and there will not be same port id ever so somebody will win that election and will be the path to root bridge.

-ritenkumar

• so think about it this way. Router A is connected to Router B and Router C. Both router B and router C are connected to Router D. (this forms a diamond shape right?) Router D becomes the Root bridge. How do we know this?

when a router comes into the network it shouts (sends BPDU's) to everyone that he is the best router. Well, that very well may be the case, or it may not. First, you look at the BID (Bridge Priority, then Mac). Default every Router has the Bridge Priority of 32768. So the router with the LOWEST Mac address will become the winner. Since in this scenario Lower is better. So Router D wins.

Once Router D is acknowledged by everyone that he is the root bridge, you start the "flow" (i call it this) of traffic. Router D is the top of the stream and send his BPDU's downstream. So Router B and Router C, will see this and determine that there Root Ports are the ones directly connected to the Root Bridge (assuming all cables are the same speed). And then, Each router B and Router C will send their BPDU's to the Router A. Router A will see both of these "Upstream" BPDU's and determine what the cost of each are. They are the same. So we go to the Bridge Priority (Remember, LOWEST is BEST). He sees the BPDU of router B and sees the Bridge Priority of 32768 and a Mac of 0012.ab12.cc12 and the Bridge Priority of Router C as 32768 and a Mac of 0012.ab13.cc12. So which path will Router A take to go back to the Root Bridge? Router B, and this is because the Bridge Priority is the same on each but the Mac is LOWER on Router B.

PS - I know I stated this but I want to reiterate that ALL CONNECTIONS HAVE SAME SPEED. 3
This solution would not be the case if the connection from Router A to router B was 100 Mbps and Router A to Router C was 1Gbps. in this case the RP (root port) would be the connection to Router C, since of the higher bandwidth.

• In STP all are based on comparing 2 BPDUs.
BPDUs are compared in this order:
1) Root Bridge ID (priority + MAC)
2) Root Path Cost
3) Sender Bridge ID (priority + MAC)
4) Sender Port ID (port priority + port number)
5) Receiver Port ID (port priority + port number)
Note that,always priorities are used first and always lowest is best!

HTH,