9 Replies Latest reply: May 23, 2015 12:14 AM by Martin RSS

    STP question: is the information provided by BPDUs stored on a per-port basis for each switch?

    Chih

      When I first started reading about/studying STP I thought that BPDUs were only received on root ports and designated ports. I later learned that all ports (even blocking ports) received BPDUs. Someone had explained to me that this was necessary so that a switch can keep up with topology changes, but that answer didn't make complete sense to me because a switch (like all computers) have centralized processing components so a BPDU received on a root port or designated port should still be able to apply the appropriate process to blocking or any other local port. I accepted this answer though because I figured a path that a root port or designated port may become compromised and isolate the switch.

       

      Now an article I recently read (attached for your review) has thrown my assumption into question:

       

      Throughout this article it uses similar language which implies that each port stores "unique" (for lack of a better word) BPDU information. I suppose that each port has some mechanism for comparing its received BPDUs with a globally stored copy of the BPDU with superior information. I've been trying to find a good diagram of a switch's motherboard which clearly outlines each component and the buses that connect each, but I haven't been able to turn up with anything.

       

      I appreciate any input you all might have to share with me on this topic.

       

      Message was edited by: Chih PDF removed as per moderator's request

        • 1. Re: STP question: is the information provided by BPDUs stored on a per-port basis for each switch?
          Martin

          BPDUs were only received on root ports and designated ports. I later learned that all ports (even blocking ports) received BPDUs.

          BPDUs are received on root ports; not designated ports. DP ports are sending BPDUs out.  The flow of BPDU is downstream or away from Root bridge in normal STP operation (after elections or synchronization).  Root sw has all ports as DP. Downstream switches has at least 1 Root port to Root sw.and may have other DP ports to other downstream switches.

          i.e. 2 switches with 2 links between them. sw1 is root, all ports are DP.  Sw2 keeps 1 link open and 2nd link as blocking.  sw1 sends BPDUs via both links; it does not know that one of sw2 ports is blocking. it does not care.  Sw2 gets BPDUs on both links. 

          • 2. Re: STP question: is the information provided by BPDUs stored on a per-port basis for each switch?
            Navneet.Gaur

            Hi Chih.

             

            Short Summary

            The port receiving best BPDU from the root switch is assigned root port status & put in forwarding state.


            For rest of the ports

            • If they transmit better BPDU than the one they received, they are assigned designated port status & put in forwarding state
            • If they receive better BPDU than the one they sent, they stop sending the BPDUs and are put in blocking state

             

             

            1. The convergence process of STP consists of these factors.

             

            • The port that receives the best BPDU from the root switch is assigned root port status & is put into forwarding state.
            • Rest of the active ports of that switch emit this BPDU.
            • However, if any of these port receives a better BPDU, it stops transmitting its BPDU.
            • If the port transmits a BPDU & doesn't receive any, it assumes a role of a designated port & is put into forwarding state.
            • If a port is not transmitting any BPDU it is put in a blocking state. It still receives the BPDU.

             

            2. How is all this related to each other ?

             

            *Click on the image to enlarge

             

            STP-Exact.png

             

            Phase 1

            • Assuming Switch-1 to be the root switch, all its ports will transmit its BPDU - which is the best among the four switches.
            • Any BPDU they will receive will be inferior to this BPDU.

             

            Phase 2

            • Switch-1 can receive BPDUs sent from Switch-2 & Switch-3.
            • Since both Switch-2 & Switch-3 are sending BPDUs that are worse than the BPDU Switch-1 has, ports on Switch-1 will assume the role of designated status & retain the forwarding status.

             

            Phase 3

            • Switch-2 will receive the BPDU directly from Switch-1 & from Switch-4
            • The best BPDU will be on port connected directly to Switch-1 & this port will be assigned a root port status & forwarding state.

             

            Point 1

            The other active port will transmit this best BPDU towards Switch-4 - We will come to this later

             

            Phase 4

            • Switch-3 will receive the BPDU directly from Switch-1 & from Switch-4
            • The best BPDU will be on port connected directly to Switch-1 & this port will be assigned a root port status & forwarding state.

             

            Point 2

            The other active port will transmit this best BPDU towards Switch-4 - We will come to this later

             

            Phase 5

            • Switch-4 will receive the BPDU directly from Switch-2 & from Switch-3
            • The best BPDU will be on port connected directly to Switch-2 & this port will be assigned a root port status & forwarding state.

             

            Point 3

            The other active port will transmit this best BPDU towards Switch-3 - We will come to this later

             

            3.

            Going back to Point 1

            • Switch-4 has assigned a role of root port to its port connected to Switch-2. If the BPDU it has, {for the sake of argument} from the other port, were to be transmitted back to Switch-2, it would still be inferior than the one being sent by Switch-2.
            • Therefore, Switch-2 keeps on transmitting the BPDUs and by that reasoning, assumes the role of designated port with forwarding state.

             

            4.

            Going back to Point 2 & 3

            • Switch-3 is sending a BPDU towards Switch-4 - This is better
            • Switch-4 is sending a BPDU towards Switch-3 - This is worse

             

            • Switch-4 will stop sending the BPDU towards Switch-3 because the BPDU it is receiving is better than the one it is transmitting
            • Now, only Switch-3 will be sending BPDUs because it is sending better BPDU than the one it received

             

            Finally

            • The port sending BPDUs, on Switch-3, will assume the role of designated port
            • And the other port that stopped sending the BPDUs, on switch-4, will be put in blocking state

             

            5. Coming to your question.

            • If the port on Switch-4 stops receiving better BPDUs than the one it has, for any reason, it will be able to transmit BPDUs.
            • And this will allow it to assume the role of designated port and forwarding state.

             

            Take care,

            Navneet.

            • 3. Re: STP question: is the information provided by BPDUs stored on a per-port basis for each switch?
              Martin

              nice work! did u come up with those by yourself?

              • 4. Re: STP question: is the information provided by BPDUs stored on a per-port basis for each switch?
                Chih

                Wow I really appreciate the time you took to do that, but my question was about where the BPDU information is stored in a switch, whether or not this is done on a per-port basis and if so how.

                 

                Few things about your post I wanted to confirm my understanding with and get clarification on though... Are we talking legacy STP (802.1D-1998) here or Rapid STP (802.1D-2004/802.1w)?

                Phase 2
                
                • Switch-1 can receive BPDUs sent from Switch-2 & Switch-3.
                • Since both Switch-2 & Switch-3 are sending BPDUs that are worse than the BPDU Switch-1 has, ports on Switch-1 will assume the role of designated status & retain the forwarding status.

                 

                To confirm my understanding... In the case of legacy STP switch 1 would receives BPDUs from switch-2 and switch-3 only during the election process. Following this all non-root bridges will simply forward the BPDUs made by switch 1 (root) downstream through their designated ports. Switch-2 and Switch-3 will only send a BPDU to switch-1, post election, if a change in topology is detected.

                 

                In which case TCN BPDUs are generated by the switch which detected the change and sent to the parent switch (in this case switch 1 which is also root) at every Hello interval (the sending switch's locally configured Hello timer) until it receives an TCA message (a Configuration BPDU with the TCA flag set) from the parent switch; but in this case because the parent switch is the root bridge it simply starts sending Configuration BPDUs with the TC flag set downstream out of every working port.

                 

                The root bridge continues to send Configuration BPDUs with the TC flag set until a certain amount of time has passed. The article I had to remove said that this interval is defined as Max Age + Forward Time. I'm assuming the author meant Max Age + 2xForward Delay Timer. I haven't been able to confidently confirm this from my readings of the 802.1D-1998 standard. In any case the root bridge continues to send out these configuration BPDUs with the TC flag set for a duration of time which should account for propagation delays.

                 

                When non-root bridges receive this Configuration BPDU with its TC flag set, it shortens the aging timers of its CAM table; effectively flushing out old learned MAC addresses in preparation of relearning MAC addresses.

                 

                Note that what I'm about to describe is largely based on what I've read in the CCNP OCG and TCP/IP The Protocols Vol 2. I haven't had as much time with the 802.1D-2004 document as I have with the 802.1D-1998 document

                 

                In the case of RSTP, a root bridge is elected in the same way legacy STP elects a root bridge. However it operates completely differently from legacy STP in that all switches generate and send out BPDUs at regular Hello time intervals. Instead of topology changes being relayed through a root switch. This is largely thanks to RSTP using bits in the Flag field which legacy STP does not use.

                 

                These flag bits enable a "handshake" process to occur between neighboring switches (this is covered in the Synchronization section of Chapter 9 in the CCPN Switch book). When a switch is determining its ports' roles it first puts all working non-edge ports into discarding state while it exchanges RST BPDUs in the form of a proposal (here the proposal bit is set) with a neighboring switch.

                 

                This proposal is suggesting that the switch become the designated switch for the segment by advertising its STP information and claiming that it has a superior BPDU. The neighboring switch compares this BPDU to its own STP information and determines who advertises (or has) the superior BPDU (or STP information). If the neighboring switch concludes that it has inferior information it will reply with an agreement message (a BPDU with the agreement bit set). If the neighboring switch concludes that it has superior information it replies with its own proposal message which the first switch will naturally accept.

                 

                Each switch repeats this process in succession on each of its working non-edge ports that it had put into the discarding state when we first started until all work states are determined. Naturally this process propagates throughout the network until every switch has synchronized

                • 5. Re: STP question: is the information provided by BPDUs stored on a per-port basis for each switch?
                  Navneet.Gaur

                  Hi Chih.

                   

                  • Regarding BPDU information, it is stored on per-port basis.
                  • The author, Petr Lapukhov, CCIE#16379, is an established & respected network professional.
                  • He is also the one, I consider to be a yardstick for network professionals who is extremely thorough & his analysis is usually technically pristine.
                  • I will go through the article he has published.
                  • The chances are that interpretation of his observation may be incorrect than those observations themselves.

                   

                  • This is just to let you know that I have viewed your recent post.
                  • I was occupied & I had an exhausting day today.
                  • Just give me a day & I will formulate a reply, hopefully with some diagrams, that addresses the queries that you have put up in your post.
                  • A quick read of your post indicates that your overall understanding is right. But I need to give it a more thorough read. If any deviations are required I will address them in my reply by tomorrow.

                   

                  Take care,

                  Navneet.


                  Update

                  • I would like to prepare a more thorough reply based on Petr Lapukhov's document.
                  • That requires more resources than I have at my disposal at the moment.
                  • Therefore, I will keep this in my pending list of articles to complete, till I have gathered the required resources
                  • 6. Re: STP question: is the information provided by BPDUs stored on a per-port basis for each switch?
                    Martin

                    no, Max Age + Forward Time is correct.  see Understanding Spanning-Tree Protocol Topology Changes - Cisco  "Every bridge is then notified and reduces the aging time to forward_delay (15 seconds by default) for a certain period of time (max_age + forward_delay)."

                     

                    Max Age + 2xForward Delay Timer refers to Indirect failures. 2xForward Delay means Direct failures.

                    • 7. Re: STP question: is the information provided by BPDUs stored on a per-port basis for each switch?
                      Chih

                      Thanks for the link. Makes me feel a little better about considering the length that the TC Flag bit is set is Max_Age+Forward_Delay. Still It doesn't make perfect sense to me and it may be just one of those things I'm going to have to accept until I get set up a proper lab to test this stuff. I'm simply not capable of conducting a trustworthy mind experiment of this.

                       

                      The reason it doesn't make sense to me is that the whole purpose of keeping the TC Flag bit set for a period of time is to accommodate propagation delays throughout the entire network. Throughout the article by Lapukhov he's said that the time it takes for a switch to complete a convergence process ranges from 2xForward_Time to Max_Age+2xForward_Time for both direct and indirect link failure depending on different conditions.

                       

                      If it is possible that there is a switch in the topology that will take Max_Age+2xForward_Time to complete its convergence process but the root switch is only going to send out configuration BPDUs with the TC Flag bit set for Max_age+Forward_Time then that means that a switch might not finish its convergence process before the time those TC Configration BPDUs have stopped being sent.

                       

                      Maybe that doesn't matter though? Because it's safely assumed that even after the root has stopped generating those Config BPDUs with the TC Flag set there are still some being propagated that will eventually reach the switch slowest to complete convergence?

                      • 8. Re: STP question: is the information provided by BPDUs stored on a per-port basis for each switch?
                        Martin

                        Yes, convergence process ranges from 30 sec to 50s. OCG has 3 examples of topology failures and describes why and when Max Age comes into play.

                         

                        Rapid STP is described Understanding Rapid Spanning Tree Protocol (802.1w) - Cisco  but I like the way OCG describes 802.1w.

                         

                        TC Change relay by Root with TC bit in configuration BPDU which is set by the Root for 35 sec (max_age + forward_delay). TC BPDU is send to all other switches so that they can change CAM aging timeout to 15 sec.  Various authors/sources mention "condition lasts for 35 sec (Max Age + Fwd_delay) when referring to CAM aging.  However, we tried to test this CAM aging theory last year without definite success. Debug shows mac aging out within 12-22 sec from TCN.  My test showed that mac was removed after 11sec from TCN, then, after 12-13 sec, MAC came back.  Of course, my lab tests are not official and inconclusive.

                        None of sources I read described the reason for "duration of 35s" in clear and conclusive way so you may be right: extra time is for convergence process to complete.

                        • 9. Re: STP question: is the information provided by BPDUs stored on a per-port basis for each switch?
                          Martin

                          Just verified with iou lab. captured stp packets shows Root switch keep sending TC bit in configuration BPDU for 35 sec (max_age + forward_delay) after acknowledging TCN.  However, MAC table appears to be cleared immediately.

                          IOU4#sh mac add

                                    Mac Address Table

                          -------------------------------------------

                           

                          Vlan    Mac Address       Type        Ports

                          ----    -----------       --------    -----

                             1    aabb.cc00.0500    DYNAMIC     Et2/0

                             1    aabb.cc00.0800    DYNAMIC     Et0/0

                          Total Mac Addresses for this criterion: 2

                          IOU4#

                          *May 14 04:36:05: STP: VLAN0001 Topology Change rcvd on Et2/0

                          mat_check_age_of_addrs: Addr: aabb.cc00.0500 addr_type: 1 table_type: 1 table_id: 1 : Deleted

                          IOU4#sh mac add

                                    Mac Address Table

                          -------------------------------------------

                           

                          Vlan    Mac Address       Type        Ports

                          ----    -----------       --------    -----

                             1    aabb.cc00.0800    DYNAMIC     Et0/0

                          Total Mac Addresses for this criterion: 1

                          IOU4#