STP, the definitive tested answers.

GDainesGDaines Posts: 266Member
Following on from this thread in which the election process in STP was discussed, I decided to investigate in more depth as there seemed to be conflicting answers given. At one stage I thought I understood how it worked, only to go read something on the Internet that completely contradicted my understanding, so I thought the best way to get conclusive answers was to lab... extensively!

In my labs SW2 has the lowest BID and so is always elected as the Root Bridge, SW1 has the next lowest BID and SW3 the highest BID.

First off I ran the equivalent of the two scenarios from the other post in which there are two switches with redundant links between them. In scenario 1 the links are straight port-to-port 23-23 and 24-24, while in scenario 2 the links are swapped at the Root Bridge so 23-24 and 24-23.

In both tests the port connected to the lowest port number on the Root Bridge was elected on the second switch as the Root Port, which actually contradicts the NetSim lab that was run in the thread.

I then ran 6 more tests:

3. 3 switches with non-redundant links and multiple paths.
4. Same lab with the connections on the Root Bridge swapped to see if the elected Root ports change.
5. Added a redundant link between the non-Root Bridge switches (SW1 and SW3).
6. Swapped the ports over on the redundant link between SW1 and SW3 to see if it affected the port statuses.
7. Swapped the links back to test 5 and broke the direct link between SW1 and the Root Bridge to see which of the 2 ports back to SW3 would be elected as the Root Port.
8. All switches connected with redundant links.

As you can imagine the test results are far too extensive to type out, but anyone that wants the spreadsheet complete with network diagrams and CLI output is welcome to a copy.

In brief the results were as follows:

The Root Bridge will always be the switch with the lowest BID (resulting from having the lowest MAC address).
The Designated Bridge on a network segment will always be the switch with the lowest BID of the two connected switches where neither switch is the Root Bridge (*see test 7 result).
The port elected as the Root Port will always be the port connected to the lowest port number on the connected Root Bridge or Designated Bridge where all other factors are equal (eg path cost etc).

In test 7 when SW1, the Designated Bridge on the network segment linking SW1 to SW3. lost it's direct connection back to the Root Bridge, SW3 became the Designated Bridge as it still had a direct connection.

Comments

  • networker050184networker050184 Posts: 11,962Mod Mod
    As I said in the last thread, and how I've always understood it, the info received in the BPDU is used to make the decision. The port ID field in the BPDU is populated by the switch sending.
    An expert is a man who has made all the mistakes which can be made.
  • GDainesGDaines Posts: 266Member
    As I said in the last thread, and how I've always understood it, the info received in the BPDU is used to make the decision. The port ID field in the BPDU is populated by the switch sending.

    Yes you were one of those with the correct understanding, while there were as many replies from users with an incorrect understanding, so it became confusing as to who was right and who was wrong. In addition, I did not properly understand about BPDUs at the time, so even if I knew your response to be one of the correct replies, I didn't know the information contained within a BPDU and how it changes (or doesn't) as it passes between switches.

    Now with all the labbing I've done the terminology and processes have really been rammed home, so terms like 'superior BPDU' and 'inferior BPDU' I heard in the Chris Bryant Udemy videos start to make sense.

    I'm planning to add a 4th switch over the next day or two without a direct connection back to the Root Bridge. I'm pretty confident now that I'll be able to determine the results beforehand.
  • james43026james43026 Posts: 303Member
    For anyone that may still have a need for some visuals. Cisco has a great flash presentation that might just help, located here
  • PristonPriston Posts: 999Member ■■■■□□□□□□
    http://packetlife.net/media/library/11/Spanning_Tree.pdf
    has some good info

    Path Selection
    1 Bridge with lowest root ID becomes the root
    2 Prefer the neighbor with the lowest cost to root
    3 Prefer the neighbor with the lowest bridge ID
    4 Prefer the lowest sender port ID
    A.A.S. in Networking Technologies
    A+, Network+, CCNA
  • sschwietermansschwieterman Posts: 42Member ■■□□□□□□□□
    Oops! Looks like I gave the wrong answer based on my Netsim results in the last thread.

    GDaines, just for curiosities sake, are you using a physical lab or software like GNS3/Netsim? Reason I ask is I may have to start using something else to do my labbing if Netsim is giving me wrong answers...

    Thanks for taking to time to put the correct info out there!
  • Sy KosysSy Kosys Posts: 105Member ■■□□□□□□□□
    And I am revisiting this as well. My apologies for the erroneous information, I was wrong for the second scenario and put the config to the home lab and sonofagun it was not what I thought.

    I mistook "lowest interface of sender" to mean that of the nonroot switch.

    Important thing is, this triggered a conversation which has us all engaged and now we all have definitive proof.

    Sorry guys, will double-check my work next time!
    "The size of your dreams must always exceed your current capacity to achieve them. If your dreams do not scare you, they are not big enough.”
    ― Ellen Johnson Sirleaf
  • GDainesGDaines Posts: 266Member
    Oops! Looks like I gave the wrong answer based on my Netsim results in the last thread.

    GDaines, just for curiosities sake, are you using a physical lab or software like GNS3/Netsim? Reason I ask is I may have to start using something else to do my labbing if Netsim is giving me wrong answers...

    Thanks for taking to time to put the correct info out there!

    I'm using physical switches.
  • GDainesGDaines Posts: 266Member
    For clarity I just edited the original post to add 'where all other factors are equal' before someone picks me up on my summary of results and points out the port number is not the deciding factor if other values are not equal.

    Just to make it clear, all settings and values in my lab equipment are Cisco defaults, no setting has been manipulated to affect the outcome of the test. It is, however, quite possible to manipulate many different values to influence the results in a way that benefits your setup. For example, lowering the switch priority will allow you to guarantee a particular device will always be elected as the root bridge irrespective of whether it has the lowest MAC address or not.
Sign In or Register to comment.