Spanning Tree Protocol STP Tutorial – Premium Tutorial
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.
Please Register or Login to read the rest of this tutorial.
I understand……
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.
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!
a very comprehensive explanation for STP :)
9tut, Awesome tutorial! One of the greatest summary of STP that I have ever read.
Extremely good explanation of the STP concept in summary. Great explanations of the terms assosciated with STP.
9tut, Great explanations of the terms associated with STP/
@bridge priority: I updated the bridge priority number. Thanks for your detection!
Thank you
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.
I want to donate something , but my paypal account is limited . suggest how to do it . you are doing good job.
cheers
@anonymous
try donating directly from your credit card on paypal.com
just make sure you add the correct email address when sending :)
Greate job guys………….nice explanations…..
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.
very nice,,,,, Keeps future updatesssssss………:D
its great…. about STP.
Amazing!!! I keep on searching for a precise explanation of it.. and great, you explained it… perfectly.. thankns
Amazing!!! I keep on searching for a precise explanation of it.. and great, you explained it… perfectly.. thanks
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.
Good overview…
Very good tutorial !!!
Thanks 9tut.com
This is really useful..!!!
Can you kindly post same kind of explanation for IGMP and IGMP Snooping.???
@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?
@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.
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 ?
Easy to understand..Great and thanks.
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!
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
@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.”
Good tutorial
@xallax
In listening it does forwad frames !!!! I ve thougt forwandig frames is just in forwanding phase please confirm to me
@mouradteleco
it forwards frames… even in listening mode…
Switch FE interfaces start from f0/1, not f0/0
“SPT” must performs three steps to provide a loop-free network topology:
typo
should be STP LOL
Very good understanding description. thanks
Good for first time learner.
@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.
@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
@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 :)
oh!..what a great explanation…keep them coming people!!
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!
You are awesome,thank you so much
Very nice… Get extreme help.
Nice explanation. Very nice tutorial. you can grasp the concepts easily.
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
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?
Thanks a lot 9tut, Its help me lot to understand properly.
Good tutorial
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.
its very very nice wonderful