cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1070
Views
35
Helpful
17
Replies
Highlighted
Beginner

Switch still send BPDU in whole listening state?

Hello experts,

 

I just finished my CCNA course and try to dig more about STP. I have some questions may need your help. Thanks.

 

1.) Does a switch keep sending BPDU(7 times because send Hello every 2 seconds and listening state remains for 15 seconds) during whole listening state even if it has known itself not a root switch?

2.) What is exactly the BPDU propagated? For example, given a topology below

dddddd.png

2.1) Does A generate 2 different BPDU? (one with port id "eth1/1" and the other one with port id"eth1/2")?

2.2) If so, will C/D/E receive two different BPDU of A?

2.3) Assume A is the root switch, and D is also aware of that. How does D know the cost to root switch and put it into BPDU? 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

 


Yes, Sw B gets BPDU from A. Before sending BPDU downstream, sw B edits or replaces following fields: Sender Bridge ID, Cost, interface ID, Message Age.
A's Sender Bridge ID is edited. There are 2 fields: Root Bridge ID and Sender Bridge ID. Only Root A will have both values the same; other switches will keep Root Bridge ID but replace Sender's with its own ID.


this "it takes only one BPDU to complete the election." may depend on how busy switches are with traffic. now, my 4-switch lab shows 4 BPDUs are sent on far end switch. There is no conformation BPDU; once 2 of us exchange BDPUs, we see who wins. however, there is a Topology change BPDU flag and Topology Change Ack flag. 

I do not think TCN flags are used for Root/Port elections but I will check whether that flag is used at initial Root elections (it is used when port goes up/down)

 

Regards, ML
**Please Rate All Helpful Responses **

View solution in original post

17 REPLIES 17
Highlighted
VIP Advisor

Afaik the bpdu s from a received from a are essentially the same. Just b and c will recalculate the bpdu with the received port cost before sending it on to d

Please remember to rate useful posts, by clicking on the stars below.

Highlighted
Engager


after initial root election is done and Root and DP ports are elected, Only Root switch creates an sends BPDUs to all neighbors every 2 secs in the Original STP 802.1D IEEE standard (Rapid STP process is different). Downstream switches add cost of its interfaces to BPDU got from Root and pass it over to their neighbors. BPDUs have Bridge ID value inside as well as cost field.  Root sw sends BDPUs with its BID and cost of 0.


If sw A is Root, sw D will get BPDU from sw A via C and B. One of sw D ports will be blocking which means port listens to BPDUs but doesn't send any. The other port is Root port. From sw D perspective, Cost to reach root A is its cost to C and cost of sw C to A (that cost came inside of BPDU). similarly, D calculates cost to A via sw B; lower cost to reach Root A wins. if cost is the same, lower sender's Bridge ID breaks a tie.

 

 

Regards, ML
**Please Rate All Helpful Responses **

Highlighted

Hi Martin,

 

Thanks for your reply. I've understood that only root switch can create and send BPDU after root switch election. But I'm curious about what happened in each period. As we know, there are four state in STP, blocked, listening, learning and forwarding.

 

 [listening]            [learning]               [forwarding]

       |---------------|---------------|

                   15s                       15s

Here is my understanding, please correct me if I'm wrong.

Root switch election, Root port/Designated port election are executed during the period between listening and learning, which is 15s. Let's assume root switch election is done at 5th second, and A is root switch. Will B/C/D keep sending their BPDU during 5~15 seconds?

 

Because I saw a port-id field in BPDU frame. So I though if A try to send BPDU to B and C via eth1/1 and eth1/2, the content of BPDU should be different. Or could you please show me what A's BPDU looks like in A, B and D switch?

 

Thanks a lot.

Highlighted

 

once sw is up, their ports move thru 4 states of STP beginning with blocking state, then listening, learning and forwarding. Sw Port begins with a brief Blocking state where sw listens to BPDUs but not allowed to send any over that port.  Listening state is needed for switches to elect Root and then ports. it is where sw exchanges BPDUs and adopt ports if needed to be.  Learning state is where sw learns MACs and stores them.

 

Re: your question, Root election is done when all switches agree who is the Root. At that point, only Root sends BPDUs. sw B,C,D will send BPDUs downstream but that BPDU says A is Root.  you mentioned 5 seconds, which means 2 BPDUs.  I think it takes only 1 BPDU for B to agree that A is Root.  So, by that time I think B/C/D should agree that A is the Root. it is unlikely that B,C,D keep sending their own BPDU during 5~15 seconds after root elections; they do, however,  send "copy" or edited version of A's BPDU downstream.

 

Note that although election is done, ports are still going thru listening and learning stages.  1st 15 sec is sort of "reserved" time for STP elections for both Root and ports elections. 

 

 

Regards, ML
**Please Rate All Helpful Responses **

Highlighted

 

I just open my virtual switch lab and I added new switch to existing topology and I see new switch sent 1 BPDUs to Root to establish its role.  

My second test showed 2 BPDUs  sent on what later became the root port. 

Pings came back after about 34 sec (15 + 15 + some other delay like bringing port up)

 

Regards, ML
**Please Rate All Helpful Responses **

Highlighted


@JaySu wrote:

Because I saw a port-id field in BPDU frame. So I though if A try to send BPDU to B and C via eth1/1 and eth1/2, the content of BPDU should be different. Or could you please show me what A's BPDU looks like in A, B and D switch?


Yes, you right, Port ID value is different due to ports via 1/1 and 1/2.  Besides that, later BPDUs will have same Root ID but different Sender Bridge ID and cost values and Message Age values. 

Sw D should get 2 BPDUs; one from B and one from C.  They both are originated by A; but were edited by B and C. 

I guess you call "different" BPDUs get to sw D from sw A. I would call them "edited" BFPUs of Sw A.  Different BPDU means different types: config or topo change notification.  also , different would imply different creators or originators.   I don't think I saw any books mentioned "different" BPDU when referring to STP 802.1D.  

 

 

Regards, ML
**Please Rate All Helpful Responses **

Highlighted

Hi Martin,

Thank you so much. You're right about "different BPDU", I tried to express "edited BPDU" but used wrong term.

There are some questions may need your support


@Martin L wrote:


Yes, you right, Port ID value is different due to ports via 1/1 and 1/2.  Besides that, later BPDUs will have same Root ID but different Sender Bridge ID and cost values and Message Age values. 


1.) What does your "later BPDUs" mean? A's BDPU edited by B/C? 

2.) For A's BPDU, what field will be edited by B/C? I think only cost, port-id, age? B/C should not edit A's Sender Bridge ID?

3.) For root switch election, it takes only one BPDU to complete the election. My another question is, will another BPDU be sent for confirming root switch?

For example:

    step1 : All switches just up and thought they are the root, so the first BPDU of every switches would be like below

BPDU.png

    step2 : Every switch get others' BPDU and know A is the root

    step3: A will keep sending BPDU because it is root. How about B/C/D? Will they send another one BPDU like below to confirm root?

BPDU2.png

Thanks

Highlighted

 


Yes, Sw B gets BPDU from A. Before sending BPDU downstream, sw B edits or replaces following fields: Sender Bridge ID, Cost, interface ID, Message Age.
A's Sender Bridge ID is edited. There are 2 fields: Root Bridge ID and Sender Bridge ID. Only Root A will have both values the same; other switches will keep Root Bridge ID but replace Sender's with its own ID.


this "it takes only one BPDU to complete the election." may depend on how busy switches are with traffic. now, my 4-switch lab shows 4 BPDUs are sent on far end switch. There is no conformation BPDU; once 2 of us exchange BDPUs, we see who wins. however, there is a Topology change BPDU flag and Topology Change Ack flag. 

I do not think TCN flags are used for Root/Port elections but I will check whether that flag is used at initial Root elections (it is used when port goes up/down)

 

Regards, ML
**Please Rate All Helpful Responses **

View solution in original post

Highlighted


Part2
All your steps are true. Note that the flow of BPDUs is downstream from Root sw. So, BPDU flow is from A to B/C then to D. B will not send BPDU to A after Root elections are done unless there is a topo change.
Think of this as a Relay, passing info from Root to downstream neighbors.

At elections, Every sw claims to be Root. A sends BPDU to B and B can send its own BPDU to A and D at the same time. sw A does not agree with B being Root, so keeps sending its BPDU as Root.
B got 1st BPDU from A so it should convert its own BPDU to reflect change, meaning A is Root.  B sends 2nd BPDU with A as Root to D but not back to A.  if not at 1st BPDU, for sure when B gets 2nd BPDU from A, it knows that A is Root. 
it is possible for sw D to see B as root until gets "corrected" or 2nd BPDU from B with new info that A is Root.  

 

Regards, ML
**Please Rate All Helpful Responses **

Highlighted

Hi Martin,

Thanks for your reply and sharing. I think I'm getting more know-how about BPDU. I would like to conclude our discussion below, please correct me if there is something wrong. Thanks.

 

Q1 : Will switches keep sending BDPU in whole listening state?

A1 : Basically no. Every switch send BDPU at first they are just up. And once they receive a BPDU with smaller Bridge ID, they will stop to send BPDU. And if the connections are not stable or heavy traffic, it might be possible take more time to complete root switch election.

 

Q2 : Does D receive two BPDU of A from B and C?

A2 : Yes, D will receive A's BPDU from B and C. However, the two BPDUs which D receive from B and C are different. Because B and C will edit A's BPDU when sending out to D. The Sender-ID, Port-Id, Message-Age and path cost will be edited.

 

We can find many materials about telling how STP works. However, most of them explain the flow from the view of the God. Here I would like to use the view of switch to demonstrate again.

dddddd.png 

*** Let's assume A's bridge id is 4097, B and C's bridge is are 8193 and D's bridge id is 32769 ***

*** Each path is standard Ethernet and cost is 19 ***

step 1 : All switches are just up, everyone thinks itself as the root. They start to send BPDU with Sender-ID and Root-ID themselves.

step 2 : A will receive B and C's BPDU first.

             At the same time, B will receive A and D's BPDU.

             And C will receive A and D's BPDU as well.

             D will receive B and C's BPDU.

step 3 : From B's perspective, it receives A's BPDU, it knows itself won't be the root, so it will not send BPDU anymore. It also got D's BPDU and knows D is neither the root switch. So B will not propagate D's BPDU to A, but it will propagate A's BPDU to D. However, when B propagate A's BPDU to D, it will edit the Sender-ID field with B, Port-Id with 1/12, cost with 19.

step 4 : B will also set it's 1/11 as the root port.

step 5 : B will determine whether it's 1/12 is designated port or blocking port. Note that B receive A's BPDU from 1/11, and also receive another A's BPDU(with D's edition) from 1/12.

step 6 : B will be able to start compare the ports of the connection between B and D

step 7 : B will know the cost of 1/12 (Cost in the BPDU from D + 1/12's cost)

             B will also know the cost of 1/21(Cost in the BPDU from A + 1/12's cost)

 

That's it. Please let me know if I'm wrong. Thank you again, Martin.

          

Highlighted

 

A1 :  no quite.  after Root SW elections we still have Root Port elections and DP/BP ports elections.  It might take 1 BDPU at sw A to B link to agree on Root and RP election but B will send BPDU(s) to D. It might take several BPDUs for D to agree on DP and BP for links B-D and C-D.  I think I saw 4 BPDUs on sw D.

anyway, 15 sec should be enough time for far away sw to agree on all stp elections

A2 : Yes, True

I add rest of answer a bit later

Highlighted


all steps looks good;
In theory, books say Ports elections happen after Root sw election but nothing saying how many BPDUs take to do port election.
I did some quick test; I will double check and will post results later. Test shows Sw A did not received BPDUs from neighboring switches. so that means sw B and C agree on 1st BPDUs they got from A. Sw D in my test got 12 in and out BPDUs during Listening 15 seconds (or around 15 sec)

DO You have home lab to practice?

Highlighted

Hi Martin, Sorry for late reply. I don't have home lab but I think maybe I can use Packet Tracer to help myself. On the other hand, you mentioned that there are some BDPUs for both switches to agree with RP and DP. I am getting confused, because it seems no field related to RP or DP in the BDPU. Would you please help to explain more? Thanks.
Highlighted

"agree" should be in " "
u r right, there is special field related to RP or DP in the BDPU. my quick lab test had following result. Sw A was Root with all default settings, I rebooted all 4 switches at the same time (secureCRT send to all). Sw A came back as Root; number of BPDUs received on both A's links was 0; Sw A just kept sending them out but never got any back which is OK. But, Our assumption was that all Switches claimed to be Root at first boot. So, how B and C know A will win, it is like they already known.

will do and re-do labbing later  .. .   maybe this weekend

Content for Community-Ad