Skip navigation
Cisco Learning Home > Certifications > Routing & Switching (CCNA) > Discussions

_Communities

1392 Views 10 Replies Latest reply: Apr 22, 2012 10:25 PM by Mr. Akshay J RSS

Currently Being Moderated

STP 4 switches explaination

Mar 24, 2012 12:51 AM

Mr. Akshay J 132 posts since
Jul 3, 2011

STP.bmp

Please look at the above scenerio.

I have marked switch1 as the root because all switches tie with priority and switch1 has smallest mac.

 

2 and 4 find their directed connected paths as RP.

 

Can anyone expalin me how 3 end up having fa0/1 as its blocked port.

  • Mohamed Sobair 340 posts since
    Oct 21, 2008
    Currently Being Moderated
    1. Mar 24, 2012 1:49 AM (in response to Mr. Akshay J)
    Re: STP 4 switches explaination

    Hello,

     

    The Designated port  in a non root bridge is selected based on the following criteria:

     

    1- The port with the Lowest path Cost towards the root bridge.

     

    2- If there is a tie in (1), choose the port with the lowset Sender Bridge ID.

     

    3- If there is a tie in (2), choose the port with the lowest port ID.

     

     

    As you can see from you example, Switch 3 prefers Switch 4 because Switch 4 has the lowest Bridg-id than Switch 2, and would therefore conside the port connects to Switch 4 as the prefered port.

     

     

    Switch-3 recieves the information of the root bridge from two different switches (Switch 3 and Switch 4) , and it selects Switch 4 because of its lowest bridge id.

     

     

     

    Thanks,

    Mohamed

  • Stephen 488 posts since
    Apr 22, 2011
    Currently Being Moderated
    3. Mar 24, 2012 1:27 PM (in response to Mr. Akshay J)
    Re: STP 4 switches explaination

    Quick answer:


    It's either because you have adjusted your switch priorities, written the mac addresses down incorrectly, or STP is still converging; else its a bug.

     

    Long answer:

     

     

    As SW3 has an equal cost to reach the root bridge via both paths, there is a tie braker decision that is performed on SW3.  The process is as follows:

     

    1. Lowest root bridge ID
    2. Lowest root path cost to the root bridge (which is where we are currently)
    3. Lowest sender bridge ID
    4. Loewst sender port.

     

    So as you can see, the next stage is to compare the bridge ID.  The bridge ID is comprised of 8 bytes:

     

    • The first 2 bytes = Bridge Priority (defaults to 32768)
    • The last 6 bytes = MAC address.

     

    So when you consider SW2's bridge ID vs SW4's bridge ID, SW4 will have the lower bridge ID because of the lower MAC address.  This is the deciding factor that should now makes SW3 use Fa0/2 to reach the root bridge; and become the root port.  Unless the spanning-tree is still converging, or you're switch priorities have been adjusted, this is a bug (welcome to packet tracer).

     

    Regards,

    Stephen

  • Martin 13,071 posts since
    Jan 16, 2009
    Currently Being Moderated
    4. Mar 24, 2012 1:49 PM (in response to Mr. Akshay J)
    Re: STP 4 switches explaination

    Sw 4 has lower MAC address than SW2;

     

    PT has one flawed with STP, it does calculate and blocks ports correctly but it does not show costs correctly in one of sh spann tree outputs.

  • Currently Being Moderated
    5. Mar 24, 2012 3:10 PM (in response to Mohamed Sobair)
    Re: STP 4 switches explaination

        Mohamed is correct

  • Currently Being Moderated
    7. Mar 24, 2012 11:03 PM (in response to Mr. Akshay J)
    Re: STP 4 switches explaination

    To the best of my recollection, it is always the upstream facing interface that spanning tree is dealing with (the one facing upstream to the root), for efficiency's sake.

     

    Here is what I think happens...we have designated interfaces fa0/1 on S2 and S4.  Before spanning tree converges, from S3's perspective the cost to get to the root is the same either way.  So THAT switch is the one that has to employ the tie breaker and block the appropriate interface.  Thats the first thing.

     

    The other thing is this: lets say spanning did it the other way - S3 is where the calculation happens, but spanning tree actually blocks Fa0/1 on S2.  Now assume there is another switch attached to the left of S3, a frame comes in and what does it do?  S3 might say you can get to the root mac address by going out either of my interfaces.  But if it goes out the top route, its wasting a trip, it will just get blocked.  So it is also more efficient to block Fa0/1 on S3 in the first place.

     

    But then, this wouldnt happen because this is the whole point of spanning tree - to have only one possible path to the root switch, and certainly not to direct frames up dead-ends.

     

    Kevin

  • Daryl 55 posts since
    Oct 9, 2011
    Currently Being Moderated
    8. Apr 20, 2012 1:06 PM (in response to Mr. Akshay J)
    Re: STP 4 switches explaination

    This is because Switch 2 has a cost of 19 to the Root and switch 3 has a cost of 38. It already compared mac addresses of 2 and 4 and decided 4 was the lower of the two so it forwards out that port and blocks fa0/1 to switch 2?

  • chemilio 243 posts since
    May 31, 2009
    Currently Being Moderated
    9. Apr 22, 2012 5:33 PM (in response to Mr. Akshay J)
    Re: STP 4 switches explaination

    Hi Akshay,

     

    I have edited your original pic to help illustrate my answer.

     

    stp-4-switches.jpg

     

    One fast rule about stp. The one with the lowest anything always wins.

     

    The bridge advertising the lowest bridge-id in its BPDU's wins the election to become  the root.

    #Assuming a tie in priority,  bridge-1 wins to become the ROOT based on lowest BID(i.e lowest mac-address in the BID).

    From then on, bridge-1 is responsible for originating all new BPDU's and sending them out it's designated ports. Other bridges do not originate new BPDU's. The role of non-root bridges is only to receive BPDU'S from the root bridge, process them and forward them out to other non-root bridges.


    Starting the election from the ROOT switch

    From the switch 1 perspective it cost 0 to reach the root bridge because _it is_ the root bridge.

     

    Then switch 2 and 4

    From switch 2's perspective the lowest path cost to the root bridge is via port fa0/2  0+19=19 --->This is elected RP

    From switch 4's perspective the lowest path cost to the root bridge is via port fa0/2  0+19=19 --->This is elected RP

     

    Then from swich 3

    From switch 3's perspective there is a tie in the lowest cost path to the root between fa0/2 and fa0/1.  Both are 19+19=38. The tie breaker to elect the root port is the lowest sender bridge- id. 

    In our case, lowest sender bridgde-id from switch 3's perspective is from the one received from switch 4,  because switch 4 has the lowest mac address. fa0/2 therefore is ----->elected the RP of switch 3.


    #Election of Designated ports occurs per broadcast  segment.

     

    As stated above, from the roots' switch perspective, all it's segments have designated ports because _it is_ the designated bridge.

     

     

    #TO ANSWER YOUR QUESTION.

    Broacast segment between switch 3 and 2

    Switch 3 is advertising _in_ the broacasting segment (marked in blue in the illustration) that it's cost to reach the root bridge is 38(19+19) while switch 2 is advertising _in_the segment a cost of 19(19+0) to reach the root bridge. The lowest always wins, so fa0/1 on switch 2 is --->elected Designated Port for the segment. The rest(i.e fa0/1 on switch 3) is non-designated/ blocking.

     

    Now just hypothetically, if we assume that  there was tie between the cost which swich 2 and switch 3  was advertising _in_ the broacast segment,  what factor could be chosen to break the tie? Is it the lowest bridge-id or the lowest sending port-number?

     

    HTH,

     

    Chemillio.

     

    Message was edited by: chemilio

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)