Question on STP

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
dissolvedAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Don JohnstonInstructorCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dissolvedAuthor Commented:
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
PennGwynCommented:
> 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
Don JohnstonInstructorCommented:
"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
dissolvedAuthor Commented:
Thanks guys!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Routers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.