07-27-2017 08:35 AM - edited 03-08-2019 11:30 AM
Hello Experts,
I am new in Networking world and learning about Switching part. I am getting confused in Spanning Tree Protocol.
Can some help me to understand this STP part?
What is the purpose of this STP and where we are using it?
Thanks in advance..
Solved! Go to Solution.
07-27-2017 08:37 AM
Hi Arvind,
STP runs on bridges and switches that are 802.1D-compliant. There are different flavors of STP, but 802.1D is the most popular and widely implemented. You implement STP on bridges and switches in order to prevent loops in the network. Use STP in situations where you want redundant links, but not loops. Redundant links are as important as backups in the case of a failover in a network. A failure of your primary activates the backup links so that users can continue to use the network. Without STP on the bridges and switches, such a failure can result in a loop. If two connected switches run different flavors of STP, they require different timings to converge. When different flavors are used in the switches, it creates timing issues between Blocking and Forwarding states. Therefore, it is recommended to use the same flavors of STP. Consider this network:
In this network, a redundant link is planned between Switch A and Switch B. However, this setup creates the possibility of a bridging loop. For example, a broadcast or multicast packet that transmits from Station M and is destined for Station N simply continues to circulate between both switches.
However, when STP runs on both switches, the network logically looks like this:
Please Rate if this is helpful....
07-27-2017 11:04 AM
Talking about Standard (IEEE) Spanning Tree Protocol
The ports on a switch with enabled Spanning Tree Protocol (STP) are in one of the following five port states.
• Blocking
• Listening
• Learning
• Forwarding
• Disabled
A switch does not enter any of these port states immediately except the blocking state. When the Spanning Tree Protocol (STP) is enabled, every switch in the network starts in the blocking state and later changes to the listening and learning states.
The Switch Ports will go into a blocking state at the time of election process, when a switch receives a BPDU on a port that indicates a better path to the Root Switch (Root Bridge), and if a port is not a Root Port or a Designated Port.
A port in the blocking state does not participate in frame forwarding and also discards frames received from the attached network segment. During blocking state, the port is only listening to and processing BPDUs on its interfaces. After 20 seconds, the switch port changes from the blocking state to the listening state.
After blocking state, a Root Port or a Designated Port will move to a listening state. All other ports will remain in a blocked state. During the listening state the port discards frames received from the attached network segment and it also discards frames switched from another port for forwarding. At this state, the port receives BPDUs from the network segment and directs them to the switch system module for processing. After 15 seconds, the switch port moves from the listening state to the learning state.
A port changes to learning state after listening state. During the learning state, the port is listening for and processing BPDUs . In the listening state, the port begins to process user frames and start updating the MAC address table. But the user frames are not forwarded to the destination. After 15 seconds, the switch port moves from the learning state to the forwarding state.
A port in the forwarding state forwards frames across the attached network segment. In a forwarding state, the port will process BPDUs , update its MAC Address table with frames that it receives, and forward user traffic through the port. Forwarding State is the normal state. Data and configuration messages are passed through the port, when it is in forwarding state.
A port in the disabled state does not participate in frame forwarding or the operation of STP because a port in the disabled state is considered non-operational.
07-27-2017 08:37 AM
Hi Arvind,
STP runs on bridges and switches that are 802.1D-compliant. There are different flavors of STP, but 802.1D is the most popular and widely implemented. You implement STP on bridges and switches in order to prevent loops in the network. Use STP in situations where you want redundant links, but not loops. Redundant links are as important as backups in the case of a failover in a network. A failure of your primary activates the backup links so that users can continue to use the network. Without STP on the bridges and switches, such a failure can result in a loop. If two connected switches run different flavors of STP, they require different timings to converge. When different flavors are used in the switches, it creates timing issues between Blocking and Forwarding states. Therefore, it is recommended to use the same flavors of STP. Consider this network:
In this network, a redundant link is planned between Switch A and Switch B. However, this setup creates the possibility of a bridging loop. For example, a broadcast or multicast packet that transmits from Station M and is destined for Station N simply continues to circulate between both switches.
However, when STP runs on both switches, the network logically looks like this:
Please Rate if this is helpful....
07-27-2017 11:04 AM
Talking about Standard (IEEE) Spanning Tree Protocol
The ports on a switch with enabled Spanning Tree Protocol (STP) are in one of the following five port states.
• Blocking
• Listening
• Learning
• Forwarding
• Disabled
A switch does not enter any of these port states immediately except the blocking state. When the Spanning Tree Protocol (STP) is enabled, every switch in the network starts in the blocking state and later changes to the listening and learning states.
The Switch Ports will go into a blocking state at the time of election process, when a switch receives a BPDU on a port that indicates a better path to the Root Switch (Root Bridge), and if a port is not a Root Port or a Designated Port.
A port in the blocking state does not participate in frame forwarding and also discards frames received from the attached network segment. During blocking state, the port is only listening to and processing BPDUs on its interfaces. After 20 seconds, the switch port changes from the blocking state to the listening state.
After blocking state, a Root Port or a Designated Port will move to a listening state. All other ports will remain in a blocked state. During the listening state the port discards frames received from the attached network segment and it also discards frames switched from another port for forwarding. At this state, the port receives BPDUs from the network segment and directs them to the switch system module for processing. After 15 seconds, the switch port moves from the listening state to the learning state.
A port changes to learning state after listening state. During the learning state, the port is listening for and processing BPDUs . In the listening state, the port begins to process user frames and start updating the MAC address table. But the user frames are not forwarded to the destination. After 15 seconds, the switch port moves from the learning state to the forwarding state.
A port in the forwarding state forwards frames across the attached network segment. In a forwarding state, the port will process BPDUs , update its MAC Address table with frames that it receives, and forward user traffic through the port. Forwarding State is the normal state. Data and configuration messages are passed through the port, when it is in forwarding state.
A port in the disabled state does not participate in frame forwarding or the operation of STP because a port in the disabled state is considered non-operational.
08-17-2017 05:55 PM
07-27-2017 09:44 AM
I believe STP was originally designed to permit intentional designed physical closed loops within a L2 infrastructure for redundancy. The problem with L2, frames can circulate endlessly if there's a closed loop. (When this happens, generally the L2 network becomes unusable.) STP logically detects closed loops and logically blocks links from forwarding "normal" frames to insure the topology is loop free.
STP constantly monitors the topology, and if a previously logically blocked link would no longer create a loop, it will unblock it. (This would happen if an active link lost its connection, another could take its place.)
STP normally blocks all links as they come on-line until it determines allowing it to pass traffic will not create a loop.
For L2 topologies that, by design, do not have any closed loops, STP should still be run to avoid creating an L2 loop accidentally.
Spooster mentions different flavors of STP. Indeed there are, especially as there are proprietary versions; many will not interoperate.
The big three STP variants are ones based on the original STP, ones based on the "rapid" STP standard or ones based on MST.
When using STP either it will apply to all VLANs on a switch or it may run as a STP instance per VLAN. The latter allows you to physically use redundant/multiple links. I.e. with per VLAN STP, link A is unblocked while link B is blocked for VLAN X, but the converse is true for VLAN Y.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide