6 Replies Latest reply: Apr 24, 2011 3:51 AM by DrMxxxxx RSS

    Spanning Tree Port "Election"


      Hello Guys!


      I have a question regarding the election process of Spanning Tree.


      When I have four switches connected to a circle (like on the Image) and I change the priority of one switch to a higher value, why and with which values is spanning tree changing the topology? Because when I look on the mac-addresses of the interfaces not always the interface with the lowest mac-address is a designated port.


      I don't understand the election process of the spanning tree protocol in this case.


      Thanks a lot!





      P.s.: Oh, before I forget it. I didn't pass the CCNA Exam last Saturday...   Because of WANs and Frame Relay...

        • 1. Re: Spanning Tree Port "Election"

          Sorry to hear about the CCNA test. You'll get it next time though! At least you know where to study.


          STP decides on a root by the "base" mac address and not the mac adddress of a certain port. If you set the priority to a "higher" number than the default there's almost no chance that switch will become the root. You need to set it to a lower number. For instance 32768 is default. Set it to something lower than that (if the rest are default) and it will be designated as the root. The priority has to be in incriments of 4096 to accomodate for vlan's however. Just keep that in mind. If you are talking about a non designated port those are determined by the port ID. that is the ID of the interface. So say for instance interface fa 0/1 has a port id of 128.1, and fa 0/2 has a port id of 128.2. The interface with the lower number will be designated as the root, or forwarding port.


          I hope this helps. If you need more clarification just let me know.

          • 2. Re: Spanning Tree Port "Election"

            Thanks for the answer.


            What you did explain I understood, but I don't understood why the blocked port is switching when the priority is higher.


            For example (in the picture) the blocking port is Fa0/1 at Switch0. But when I increase the priority value of Switch2 than the Fa0/1 of this Switch gets into blocking state...




            • 3. Re: Spanning Tree Port "Election"

              First is selection of the Root sw;

              then; if there are 2 paths to Root switch:

              switch compares speed costs:

              1942 = costs are 2, 4, 19, 100

              assuming that those are same speeds:

              switch will compare Bridge Ids from senders;

              lowest Bridge ID wins (usually MAC decides)

              then if there are 2 links to same switch -like Ether channel,

              receiving switch will look at ports ID; lower Sender port ID wins.


              Thing about Packet tracer is that is not totally 100% acurate for STP;


              adding corrections

              • 4. Re: Spanning Tree Port "Election"
                Wee Teck Andrew, Tan - I Do Not Use Braindumps

                Hi Martin,


                I do not quite agree with you. The lowest-cost port becomes the root port. If multiple links have the same cost, the bridge with the lower advertising bridge ID is used. Since multiple links can be from the same device, the lowest port number will be used.


                Hi DrMx,


                To answer your last reply, it is dependant from the actual LAN segment and senario. For example, I have three switches 1, 2 and 3 interconnected to each switch forming three-separated LAN for segments A, B and C and all three switches were running IEEE 802.1D (STP). In segment C, there are two equal path costs to Switch 1 through Switch 2 and Switch 3. Switch 1 has the lowest Bridge ID and became the Root Bridge. The traffic from segment C could flow to Switch 1 through Switch 2 (C->2->A->1) or Switch 3 (C->3->B->1).


                Since the cost of both the paths to the Root Bridge were equal and if Switch 2 has a better (lower) Bridge ID than Switch 3, Switch 2 will become the designated bridge for segment C thus its port connected to the LAN segment will also become the designated port. On the other hand, the port connected to the same segment from Switch 3 will be block to prevent any traffic from looping. In this case, Bridge IDs are use to break the tie for two equal path costs. The traffic from segment C to reach segment A and B will go through Switch 2. Likewise if Switch 3 has a lower Bridge ID, the direction of the traffic will be vice versa.


                For cases like simultaneous links between a switch to a root bridge and the Bridge ID in a switch is equal. Port Priorities are use to break the tie and if it were equal, Port IDs will be use to elect the root port. There will only be one root port per bridge/switch to the root bridge.


                I hope this will help. (:



                Andrew Tan

                • 5. Re: Spanning Tree Port "Election"

                  thanks; I forgot about one criteria

                  • 6. Re: Spanning Tree Port "Election"

                    Hello Guys,

                    hello Andrew,


                    thanks for the answers and thanks, Andrew, for the detailed answer. Now I understand it.


                    When the cost are equal the BID will be the tiebraker. The lower BID wins the election.


                    Thanks a lot!