Spanning Tree

Posted on 2006-05-10
Last Modified: 2008-01-16
See anyone have better understanding of this. I am kind of confused. I need some direction.
Question by:ittechlab
    LVL 3

    Expert Comment

    See anyone have better understanding of this. I am kind of confused. I need some direction.

    Ok what you have are three bridges with redunant links between all three.  At this point you have a network loop.  In networking the loops are not a good thing to have.  Spanning tree looks at this and knows that it needs to block a path so that the loop will no longer exist.  In order to do this it needs to elect a root bridge so that there is a place to start.   It takes the MAC IDs of the 3 bridges and creates a root bridge by using the lowest number.  ONce the root bridge is elected it is pretty easy to figure out what link will be killed to prevent the loop.  It kills the link between Bridge C and Bridge B.  It did that because Bridge A was elected at the root bridge and all traffic will be routed through there.
    LVL 4

    Accepted Solution

    A great place to start learing about spanning tree is Radia Perlman's poem:

    The stuff that follows is something I wrote when trying to explain spanning tree to myself


    I think that I will never see
    A graph more lovely than a tree
    A tree whose crucial property
    Is loop-free connectivity
    A tree which must be sure to span.
    So packets can reach every LAN.
    First a root must be selected
    By ID it is elected
    Least cost paths from the root are traced
    And in the tree these paths are placed
    A mesh is made by folks like me
    And bridges find a Spanning Tree

    By Radia Perlman

    *Who is root?*

    1.      There is one root bridge - the bridge with the lowest ID becomes root
    2.      Bridges send Configuration BPDUs advertising whom they believe to be root, and the cost for them to get there (and some other stuff).
          a.      Configuration BPDUs are only sent away from the root bridge, never back towards the root
          b.      Ports that continue to send Configuration BPDUs become Designated Ports
          c.      Configuration BPDUs are sent every HELLO_TIMER (2 seconds) by the root bridge.
          d.      Configuration BDPUs advertise:
                i.      The root bridge ID
                ii.      The path cost to the root
                iii.      The sending Bridge ID
                iv.      The sending Port ID
                v.      timers
    3.      When a bridge receives a Configuration BDPU it recalculates the path cost to the root and forwards the BPDU out all its designated ports.
    4.      When a bridge receives a Configuration BDPU advertising a better root than the one he believes is root, he sends a unicast Topology Change notification BDPU to the root bridge.
          a.      From now on, it advertises the new root bridge - but never back towards the root.

    *Determining the best path back to root*

    5.      If a bridge receive BDPUs on two (or more) different ports both advertising the same root bridge, then it will:
          a.      Look at the advertised cost in each BPDU
                i.      If one has a lower cost, it becomes the root port and the other port(s) are put into blocking.
          b.      If both have the same cost then it looks at the Bridge ID of the sending bridges.  
                i.      If one bridge has a lower Bridge ID, it becomes the root port and the other port(s) are put into blocking.
          c.      If the cost is the same, AND the BPDUs have the same bridge ID (ie a parallel connection between two bridges) then it looks at the Port ID described in the received BPDUs.  
                i.      In this case, one MUST have a lower port ID, so it becomes the root port and the other port(s) are put into blocking.
    6.      BPDUs continue to be received and monitored on the blocked ports.  Since these BPDUs advertise an inferior path back to the root, they are known as inferior BPDUs.
    Port Types
    7.      A port which is not blocking is known either as a
          a.      Root port
                i.      The root port is the port that yields a bridge its best path back to the root
                ii.      Bridges can only ever have a single root port
                      (1).      any other port that has a path back to the root bridge via an inferior bridge or path will be put into blocking.
                      (2).      Corollary: all ports in blocking have an alternative path back to the root via an inferior bridge or path - in other words, are potential root ports
                iii.      Configuration BPDUs are never sent on the root port
          b.      Designated port
                i.      All ports on the root bridge are designated ports (unless two ports are looped back on each other on the root bridge)
                ii.      All ports that are not connected to other bridges are designated ports
                iii.      Configuration BPDUs are sent every HELLO_TIMER (2 seconds) on designated ports
                iv.      Designated ports are the only ports to send Configuration BPDUs
    8.      A port which is blocking;
          a.      Expects to receive configuration BDPUs from a neighbour every HELLO_TIMER (2 seconds).
          b.      Will not send configuration BPDUs unless it fails to receive configuration BPDUs for MAX_AGE (20 seconds) from a superior bridge.
          c.      Are known as either Alternate ports (usual case) or Backup ports (when a port on a bridge is looped back on itself) in 802.1W


    1.      Initially, all ports go into blocking mode for a period of MAX_AGE (20 seconds).
          a.      Ports in blocking:
                i.      listen to BPDUs
                ii.      do not listen to or forward user traffic
                iii.      do not send BPDUs
    2.      When a port become active, it will go into a listening mode for a period of FWD_DELAY (15 seconds)
          a.      Ports in listening mode:
                i.      listen to BPDUS
                ii.      send BPDUs
                iii.      do not listen to or forward user traffic
          b.      at the end of LISTENING the bridges will have determined the Spanning Tree Topology.
          c.      Ports who have been determined to go into BLOCKING do so now.
    3.      When a port has listened for FWD_DELAY, it goes into learning mode where it simply listens to user traffic to fill its SAT, and in so doing avoid a barrage of unknown destinations when the port finally goes into forwarding mode:
          a.      Ports in learning mode:
                i.      listen to BPDUS
                ii.      send BPDUs
                iii.      listen to user traffic
                iv.      do not forward user traffic
    4.      When a bridge port has listened for FWD_DELAY it will go into forwarding
          a.      Ports in forwarding mode
                i.      listen to BPDUS
                ii.      send BPDUs
                iii.      listen to user traffic
                iv.      forward user traffic


    5.      If a bridge fails to hear a BPDU on its root port for MAX_AGE, it assumes it is root and starts advertising the fact out all ports.
    6.      If a bridge hears an inferior BPDU it replies immediately with a BPDU advertising the bridge it believes to be root (and with the TC bit set)
    7.      If a bridge hears a BPDU advertising a better root bridge, it will send a Topology Change Notification BPDU back out its root port
    8.      When a bridge receives a Topology Change Notification BPDU, or a CBPDU with the TC bit set, it resets the aging timer for its SAT to FWD_DELAY (15 seconds) so as to age out potentially wrong MAC addresses more quickly.
    9.      A bridge that receives on a port a better BPDU than the one it would send out, puts this port in blocking mode unless it is its root port. This means that on the segment connected to this port, there is another bridge that is designated bridge. A bridge stores on a port the value of the BPDU sent by the current designated bridge.
    10.      The path cost is in terms of cost away from the root, therefore the root bridge always advertises a cost of 0
    11.      The cost is added on receipt of a BPDU, therefore a bridge with a root port having a cost of 10 receiving a BPDU with a cost of 100 would advertise a cost of 110 out all designated ports
    12.      Before 1998, the cost assigned to a port was (by default) based on the formula cost=1 000 000 000/(interface speed). Thus a 10Mbs interface has a cost of 100, a 100 Mbs interface has a cost of 10, and a 1Gbs interface has a cost of 1.
          a.      Since the 1998 revisions to 802.1D, a table of values is used rather than a formula.  For example, a 1Gbs interface now has a default cost of 4.
          b.      Troubleshooting:  In many cases you will find bridges that use the old formula, while others use the new (1998) table.  Check the advertised costs carefully.


    13.      All bridges set their HELLO_TIMER, MAX_AGE and FORWARD_DELAY to the values propagated by the root bridge via configuration BPDUs
          a.      Default values for these timers are:
                i.      HELLO_TIMER = 2 sec
                ii.      FORWARD_DELAY = 15 Sec
                      (1).      based on
                      = 7 (max bridge diameter) x HELLO_TIMER
                      +1 sec (to allow for delay variations)
                iii.      MAX_AGE
                      (1).      based on
                      = 7 (max bridge diameter) x HELLO_TIMER
                      + 3 missed BPDUs)
          b.      setting these values on other bridges will have NO effect on Spanning Tree unless that bridge becomes root
          c.      If changing these values, use the formulas mentioned above based on the actual bridge diameter- ie
                i.      FORWARD_DELAY = bridge diameter x HELLO_TIMER +1 sec
                ii.      MAX_AGE = bridge diameter x HELLO_TIMER + 3 missed BPDUs


    Inferior BPDU      a BPDU from a bridge with a higher bridge ID than me
    Superior BPDU      BPDU from a bridge with a lower bridge ID than me
    BRIDGE PRIORITY      16 bit user configurable value used to force bridges to be root (or not).  Default value is 0x8000 (32768)
    BRIDGE ID      64 bit number consisting of 16 bits BRIDGE PRIORITY followed by 48 bits equal to the MAC address of the bridge.
    PORT PROIRITY      8 bit user configurable value used to force ports to be designated ports on the designated bridge where parallel paths exist to another bridge
    PORT ID            16 bit number consisting of 8 bits of PORT PRIORITY followed by 8 bits of port number.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Suggested Solutions

    Some time ago I was asked to set up a web portal PC to put at our entrance. When customers arrive, they could see a webpage 'promoting' our company. So I tried to set up a windows 7 PC as a kiosk PC.......... I will spare you all the annoyances I…
    If your business is like most, chances are you still need to maintain a fax infrastructure for your staff. It’s hard to believe that a communication technology that was thriving in the mid-80s could still be an essential part of your team’s modern I…
    After creating this article (, 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…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    779 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

    14 Experts available now in Live!

    Get 1:1 Help Now