Solved

Question on STP

Posted on 2004-11-01
583 Views
Last Modified: 2012-05-05
Cisco says:
--------------------------------------------------------------
 The exhange of BDPUs results in the following:
•      The election of a unique root switch for the stable spanning-tree network topology.
•      The election of a designated switch for every switched LAN segment.
•      The removal of loops in the switched network by placing redundant switch ports in a backup state.
---------------------------------------------------------------

So as soon as a switch is powered on, it thinks it is the root bridge . An election process happens and the bridge (switch) with the lowest priority ID gets chosen as bridge root. Every port on the bridge root goes into forwarding mode. I think I understand that part

The part I dont understand is this:
-------------------------------------------------------------------
A BPDU exchange results in the following:
•      One switch is elected as the root switch.
•      The shortest distance to the root switch is calculated for each switch.
•      A designated switch is selected. This is the switch closest to the root switch through which frames will be forwarded to the root.
•      A port for each switch is selected. This is the port providing the best path from the switch to the root switch.
•      Ports included in the Spanning-Tree Protocol are selected.
---------------------------------------------------------------------

So if you have 5 switches in your LAN. One of them will become the root bridge obviously.  Then a "designated switch" is selected? And the 3 switches will forward STP info to this "Designated switch", which will in turn forward it to the root bridge?  Am  I understanding that correctly?
Thanks
0
Question by:dissolved
    5 Comments
     
    LVL 50

    Accepted Solution

    by:
    So if you have 5 switches in your LAN. One of them will become the root bridge obviously.
    Right.

    Then a "designated switch" is selected? And the 3 switches will forward STP info to this "Designated switch", which will in turn forward it to the root bridge?
    Kinda... I'm not happy about the terminology, but I'll live with it. Switches aren't really Designated, ports are.

    A topology will help.

    Sw-A
      |
    Sw-B
      |
    -----------------------------------
      |              |
    Sw-C        Sw-D
      |              |
    --------------------
            |
          Sw-E

    Switch A will be the root in this example. Not neccessarily because of it's priority, but because of it's Bridge ID. The Bridge ID is made up of the Bridge Priority AND the Bridge's base MAC address. Bridge priorities are set by default to 32768 (0x8000) so unless the bridge priority has been changed on a switch, it will be the switch with the lowest base MAC address that's going to be the root.

    But at any rate, Sw-A is the root. All ports on Sw-A become designated ports (which means BPDU's go out those ports).

    The BPDU's enter the top port on SW-B. That port becomes a Root Port (good, or superior, BPDU's come in these ports). All other ports on Sw-B become Designated Ports.

    Sw-B processes the BPDU it got from Sw-A and sends it out all it's Designated Ports.  (The bottom one, in this example)

    The BPDU's are recieved on the top ports of Sw-C and Sw-D. These top ports become Root Ports and the bottom ones become Desiganted Ports.

    Sw-C and Sw-D process and forward the ports out their Designated Ports (the bottom ones).

    Sw-E recieves TWO BPDU's on it's top port!!! One from Sw-C and one from Sw-D. One of those BPDU's is an inferior (or bad) BPDU. First Sw-E looks at the cost of both (in this case they both are showing the same cost to the root). Then it looks at the Bridge ID. Ones showing  the Bridge ID of Sw-C and the other is showing the Bridge ID of Sw-D. Whichever is lower will be the superior (or good) BPDU. The other gets discarded. This makes the top port of Sw-E the Root Port

    While this is happening, Sw-C and Sw-D see each others BPDU coming in their bottom ports. A switch should not receive a BPDU on a Designated Port. Both switches have detected the loop.

    Here's where most people get confused by the Cisco description:
    "Each segment may only have one designated PORT connected to it"

    At this time the segment that C, D and E are connected to has two Designated Ports connected (the bottom port on C and D). One of these ports will have to become a Non-Desiganted Port. The decision is the same as the process that E made when it received the two BPDU's. first is who's offering the lowest cost to the root? In this case C and D are offering the same cost. Next is which switch has the lowest Bridge ID. Let's say that Sw-C has a lower Bridge ID. In that case, C's lower port will remain in Designated Mode while D's lower port will move in to Non-Designated Mode.

    When a port is Non-Designated, no BPDU's or user traffic will go out. Any user traffic coming in will be discarded. BPDU's will be checked before being discarded.

    Sorry for being so long winded.

    -Don
    0
     

    Author Comment

    by:dissolved
    Thanks don.

    Ok, to verify:

    -SwA is the root bridge. Each interface on this switch is in forwarding mode (meaning it spews out BPDUs out all of it's interfaces)

    -The top port of SwB becomes the designated root port. This is the interface SwB receives BPDUs from SwA on.  All other ports on SwB become designated ports (read: forwarding state).

    -SwB uses it's designated ports and sends out BPDUs, that it received from SwA, out to Switches C and D.

    -Cost and Bridge ID are the determinating factors when a switch decides which BPDU to discard

    -A switch should never receive a BPDU on a Designated Port


    So basically, each switch that is NOT the root bridge, will have one or more "designated ports" which it uses to send out BPDUs out.  
    0
     
    LVL 11

    Assisted Solution

    by:PennGwyn
    > So basically, each switch that is NOT the root bridge, will have one or more "designated ports" which it uses to send out
    > BPDUs out.  

    Zero or more.  In the diagram, Switch E has a root port, but no designated ports.

    Note that connecting C, D and E with a 3-port hub is a really odd topology.  A more normal topology would have C and D each connected to their own port on E, so E has two root port candidates; it selects one, and puts the other into the blocking state where it receives no outbound traffic and inbound traffic is discarded unless it's a BPDU.  So the loop is detected only at E, and not at C or D.  

    (Cisco implements several features to optimize STP convergence.  Their switches can, for instance, flag the port from E to D as an alternat root port and unblock it quickly if the root cost by way of C changes (for instance, if C's connection to B is broken)).
    0
     
    LVL 50

    Expert Comment

    by:Don Johnston
    "So basically, each switch that is NOT the root bridge, will have one or more "designated ports" which it uses to send out BPDUs out. "

    Correct. In my example I am only showing switch to switch connections. I left off end user connections for clarity. I should have specified that.

    -Don
    0
     

    Author Comment

    by:dissolved
    Thanks guys!
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Suggested Solutions

    Title # Comments Views Activity
    Using an ASA5505 as a multicast router 2 40
    Blacklist a site 3 59
    cisco 800 newbe 4 27
    VLAN Tag for chained network device. 11 27
    In a WLAN, anything you broadcast over the air can be intercepted.  By default a wireless network is wide open to all until security is configured. Even when security is configured information can still be intercepted! It is very important that you …
    This article is a guide to configure bridging on Cisco Routers.  This is something I never knew was possible until after making a few phone calls to Cisco.  Using bridging saved our company money by not requiring us to purchase a new switch.  Bridgi…
    After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
    After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

    846 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now