Home > Spanning Tree Protocol STP Tutorial – Premium Tutorial

Spanning Tree Protocol STP Tutorial – Premium Tutorial

June 1st, 2011 Go to comments

To provide for fault tolerance, many networks implement redundant paths between devices using multiple switches. However, providing redundant paths between segments causes packets to be passed between the redundant paths endlessly. This condition is known as a bridging loop.

(Note: the terms bridge, switch are used interchangeably when discussing STP)

To prevent bridging loops, the IEEE 802.1d committee defined a standard called the spanning tree algorithm (STA), or spanning tree protocol (STP). Spanning-Tree Protocol is a link management protocol that provides path redundancy while preventing undesirable loops in the network. For an Ethernet network to function properly, only one active path can exist between two stations.

Let’s see a situation when there is no loop-avoidance process in operation. Suppose you have two switches connected with redundant links. One switch connected to PC A and the other switch connected to PC B.

Now PC A wants to talk to PC B. It then sends a broadcast, say an Address Resolution Protocol (ARP) to find out where the location of PC B, the green arrow shows a broadcast frame sent by PC A.

When the switch A receives a broadcast frame, it forwards that frame to all ports except the port where it receives the request -> SwA forwards that ARP frame out of fa0/0 and fa0/1 ports.

STP_broadcast_storm.jpg

Please Register or Login to read the rest of this tutorial.
Comments (105) Comments
Comment pages
1 2 3 611
  1. Rod
    June 3rd, 2011

    I understand……

  2. bridge priority
    June 16th, 2011

    in this article it is written that the bridge priority can be made 32767 from the default of 32768. It is wrong, we can only change it to (multiple of 4096+vlan no).
    plz correct that if possible.
    Suddhoshil Ghosh.

  3. whoa
    June 27th, 2011

    Omfg this is by FAR the best STP explanation I have ever seen.

    Also watch Cisco’s swf presentation of the 3 bridges/switches. Very practical!

  4. Anonymous
    July 7th, 2011

    a very comprehensive explanation for STP :)

  5. vinicius
    July 8th, 2011

    9tut, Awesome tutorial! One of the greatest summary of STP that I have ever read.

  6. VS
    July 13th, 2011

    Extremely good explanation of the STP concept in summary. Great explanations of the terms assosciated with STP.

  7. Canada
    July 15th, 2011

    9tut, Great explanations of the terms associated with STP/

  8. 9tut
    July 22nd, 2011

    @bridge priority: I updated the bridge priority number. Thanks for your detection!

  9. Aaron
    August 23rd, 2011

    Thank you

  10. nanaluv32
    August 25th, 2011

    Grateful to all for the contributions. Thank you 9tut for being an authority in this field and yet very respectful to suggestions. I have been blessed from this site. Thank you once again.

  11. Anonymous
    August 31st, 2011

    I want to donate something , but my paypal account is limited . suggest how to do it . you are doing good job.
    cheers

  12. xallax
    August 31st, 2011

    @anonymous
    try donating directly from your credit card on paypal.com
    just make sure you add the correct email address when sending :)

  13. Gaurav Audil
    September 6th, 2011

    Greate job guys………….nice explanations…..

  14. Auger3
    September 8th, 2011

    This is a very good tutorial. The concepts are explained in very easy to understand manner unlike many text books. Great job 9tut! Appreciate your effort.

  15. bashyan
    September 10th, 2011

    very nice,,,,, Keeps future updatesssssss………:D

  16. Parvez Alam Sheikh
    September 14th, 2011

    its great…. about STP.

  17. Filmore Y’sam
    September 18th, 2011

    Amazing!!! I keep on searching for a precise explanation of it.. and great, you explained it… perfectly.. thankns

  18. Filmore Y’sam
    September 18th, 2011

    Amazing!!! I keep on searching for a precise explanation of it.. and great, you explained it… perfectly.. thanks

  19. More Complex
    September 25th, 2011

    How about spiceing things a bit, and making a 4 connected switches in a round fashion, such as you can see on some dumps and i presume on cisco exam.

  20. Matteo “roghan” Cappelli
    September 29th, 2011

    Good overview…

  21. Daniel
    October 4th, 2011

    Very good tutorial !!!

    Thanks 9tut.com

  22. Lakshmi
    October 28th, 2011

    This is really useful..!!!
    Can you kindly post same kind of explanation for IGMP and IGMP Snooping.???

  23. CCNA Learner
    December 18th, 2011

    @9tut and all

    How would I calculate root path cost. We know that link speed of 10gbps is 2 and 1gbps is 4 or 100mbps is 19 or 10 Mbps is 100. But my question is, how would I know which link speed is 1 gbps or 100 Mbps? Is there any way?

  24. 9tut
    December 18th, 2011

    @CCNA Learner: Usually, we can see the port on which the link is connected. If it is a FastEthernet port -> 100 Mbps; Gigabit port -> 1 Gbps. Otherwise we need to check each interface connected to that link with the “show interfaces” command.

  25. CiscoMan
    December 21st, 2011

    Hello,
    In the above example, how the switch defines the root port if the 2 fastEthernet ports have the same speed (100mb/s for example) ? The switch watch the MAC address of the interface and use the lower one as root port ?

  26. Divy
    December 23rd, 2011

    Easy to understand..Great and thanks.

  27. filling in blanks
    December 28th, 2011

    what is the order of priority for mac address values? is it, lowest to highest 0 – 9 then a – f? or is a the lowest value and 9 the highest? i thought i had it figured out, but i run across practice questions, on here and other places with conflicting answers. for example, which mac is lowest:

    0f00.0ace.0000
    0f00.cafe.0000
    0f00.face.0000

    thanks!

  28. Kash
    January 21st, 2012

    9tut: Please confirm below;
    In Listening state it does forward frames. http://en.wikipedia.org/wiki/Spanning_Tree_Protocol

    Waiting

    Thanks in advance for the gr8 help

  29. xallax
    January 21st, 2012

    @kash
    from wiki:
    “Listening – The switch processes BPDUs and awaits possible new information that would cause it to return to the blocking state. It does not populate the MAC address table, but it does forward frames.”

  30. Decannon04
    January 22nd, 2012

    Good tutorial

  31. mouradteleco
    January 28th, 2012

    @xallax

    In listening it does forwad frames !!!! I ve thougt forwandig frames is just in forwanding phase please confirm to me

  32. xallax
    January 28th, 2012

    @mouradteleco
    it forwards frames… even in listening mode…

  33. realdreams
    February 10th, 2012

    Switch FE interfaces start from f0/1, not f0/0

  34. realdreams
    February 10th, 2012

    “SPT” must performs three steps to provide a loop-free network topology:
    typo
    should be STP LOL

  35. A B M Moniruzzaman
    February 17th, 2012

    Very good understanding description. thanks

  36. Rahul Soni
    March 1st, 2012

    Good for first time learner.

  37. Anonymous
    March 2nd, 2012

    @xallax,how a swich forward frames in listening mode? it doesn’t it only forwards frames when stp converges and it only converge when it’s ports are either in forwarding or blocking mode.

  38. Anonymous
    March 2nd, 2012

    @xallax
    i got it from http://www.cisco.com/en/US/docs/switches/lan/catalyst2950/software/release/12.1_6_ea2c/configuration/guide/swgstp.html
    Blocking State

    An interface in the blocking state does not participate in frame forwarding. After initialization, a BPDU is sent to each interface in the switch. A switch initially functions as the root until it exchanges BPDUs with other switches. This exchange establishes which switch in the network is the root or root switch. If there is only one switch in the network, no exchange occurs, the forward-delay timer expires, and the interfaces move to the listening state. An interface always enters the blocking state following switch initialization.

    An interface in the blocking state performs as follows:

    •Discards frames received on the port

    •Discards frames switched from another interface for forwarding

    •Does not learn addresses

    •Receives BPDUs
    Listening State

    The listening state is the first state an interface enters after the blocking state. The interface enters this state when STP determines that the interface should participate in frame forwarding.

    An interface in the listening state performs as follows:

    •Discards frames received on the port

    •Discards frames switched from another interface for forwarding

    •Does not learn addresses

    •Receives BPDUs
    Learning State

    An interface in the learning state prepares to participate in frame forwarding. The interface enters the learning state from the listening state.

    An interface in the learning state performs as follows:

    •Discards frames received on the port

    •Discards frames switched from another interface for forwarding

    •Learns addresses

    •Receives BPDUs
    Forwarding State

    An interface in the forwarding state forwards frames. The interface enters the forwarding state from the learning state.

    An interface in the forwarding state performs as follows:

    •Receives and forwards frames received on the port

    •Forwards frames switched from another port

    •Learns addresses

    •Receives BPDUs
    Disabled State

    An interface in the disabled state does not participate in frame forwarding or STP. An interface in the disabled state is nonoperational.

    A disabled interface performs as follows:

    •Discards frames received on the port

    •Discards frames switched from another interface for forwarding

    •Does not learn addresses

    •Does not receive BPDUs

  39. xallax
    March 2nd, 2012

    @anonymous
    at first i thought it was only something on the IOS version or the switch 2950 model.

    first thing first: checked wiki. it still says what it did few months back
    http://en.wikipedia.org/wiki/Spanning_Tree_Protocol
    “STP switch port states:
    [...] Listening – The switch processes BPDUs and awaits possible new information that would cause it to return to the blocking state. It does not populate the MAC address table, but it does forward frames. [...]”

    dug deeper into it, got here:
    http://www.cisco.com/univercd/cc/td/doc/product/rtrmgmt/sw_ntman/cwsimain/cwsi2/cwsiug2/vlan2/stpapp.htm
    “A port in the listening state performs as follows:
    Discards frames received from the attached segment.
    Discards frames switched from another port for forwarding.”

    if cisco says IT DOESNT then this leads me to only one logical conclusion: i got it all wrong and IT DOESNT :)
    there’s also a small error on wiki too. took the liberty to change that

    thank you very very much anonymous poster. i learn something new everyday :)

  40. njukiaz
    March 8th, 2012

    oh!..what a great explanation…keep them coming people!!

  41. Donnie
    March 20th, 2012

    I have to admit guys I was in the CCNA Network Academy. I saw a router up close and configured both the switch and router, but never truly grasping the concepts. The whole time I was in class I only knew about configuring an interface with the usual boring stuff. I guess this is why I failed the CCNA so many times. Now Im confident that I can actually work and correct a network ticket if I’m a Jr. Network Engineer. Thanks to 9tut. I’m so in your corner!

  42. MzeeNyani
    March 28th, 2012

    You are awesome,thank you so much

  43. Arafat
    March 31st, 2012

    Very nice… Get extreme help.

  44. Huzaif
    April 16th, 2012

    Nice explanation. Very nice tutorial. you can grasp the concepts easily.

  45. Jamwal
    May 18th, 2012

    Please ….Can any one answer this ?

    With RSTP, which two ports roles are included in the active toplogy ?
    A) root and alternate
    B) root and desiginated
    C) alternate and backup
    D) desiginated and backup

  46. Jim
    May 30th, 2012

    Jamwal, I am going to say alternate and backup since they are the additional roles that are added for RSTP. But, I guess it depends on what they mean by active topology. The more I think about it root and designated are active, so if it is active ports then the answer changes. It seems to be a tricky question. Anyone else know the answer?

  47. RJCCNA:)
    June 16th, 2012

    Thanks a lot 9tut, Its help me lot to understand properly.

  48. JMR
    June 18th, 2012

    Good tutorial

  49. Bubbanet
    June 27th, 2012

    Thank you for taking the time to describe a couple of scenarios that would CAUSE a loop in the first place. This has been a lost concept on me until reading this tutorial.

  50. sanbt
    July 15th, 2012

    its very very nice wonderful

Comment pages
1 2 3 611
Add a Comment