The Wayback Machine - https://web.archive.org/web/20240905205631/https://www.geeksforgeeks.org/introduction-of-spanning-tree-protocol-stp/
Open In App

Introduction of Spanning Tree Protocol (STP)

Last Updated : 21 Sep, 2022
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

In a LAN, redundant links are added to improve the network availability of LAN. But these redundant links may cause the frame to loop in the network for an infinite time until some action is taken, e.g, some links are taken down. To cope with the problem of frame looping, Spanning Tree Protocol (STP) comes into play. 

Need for Spanning Tree: 

Consider the scenario below with 3 switches with one user attached to each switch. 

Looping of Frame in LAN

 

Arvind sends a broadcast frame to LAN and as nature of switch frame are send out from other ports (Gi0/1 & Gi0/2) except receiving port (Fa0/3). Now, this frame goes to SW2, SW2 also broadcast frame out of Gi0/2 and Fa0/2 ports. SW1 receives frame in its Gi0/1 ports. SW1 also broadcast frame then this frame goes to SW3 and frame broadcasting goes on. Remember that this frame broadcast also occurs in other direction from SW3 out of Gi0/1 port. Above discussed frame looping was from SW3’s Gi0/2 ports. You can imagine the frame flooding in that small LAN. This forever looping of frames around LAN is called Broadcast storm. This Looping of frames causes three problems as stated below:

  1. MAC table instability – Due to looping of frame around LAN, MAC-Table of switch get changed frequently. Looping causes incorrect MAC-table entries resulting in incorrect frame delivery.
  2. Broadcast Storm – Repeated forwarding of frames around links in LAN causes the inefficient use of links.
  3. Multiple Frame Transmission – A very serious negative effect of looping is that multiple copies of same frame are delivered to host. This process left host with confusion.

How Spanning Tree Protocol Helps?

Spanning tree protocol prevent looping of frames around LAN by placing ports of switch in either forwarding or blocking state. Interfaces (ports of switch) which are in forwarding state act as normally but Interfaces in blocking state doesn’t process any frame received except STP messages and other important overheads. Blocking Interfaces doesn’t learn MAC addresses, don’t forward frames and don’t process received frames. Now if we again consider the above discussed scenario with SW3’s Gi0/2 interface in blocking state. 

Frame looping prevention by STP

 

 

  • Arvind sends the frame to SW3.
  • SW3 forwards frame only to Gi0/1 port as Gi0/2 port is in blocking state.
  • Now SW1 receives frame and forward to Fa0/1 and Gi0/1 interfaces.
  • SW2 receives frame and forward to Fa0/2 and Gi0/1 interfaces.
  • SW3 will receive the frame on Gi0/2 interface but ignores the frame as it is in blocking state.

In this way looping of frame around LAN can be prevented by using STP.


Previous Article
Next Article

Similar Reads

Difference between Spanning Tree Protocol (STP) and Rapid Spanning Tree Protocol (RSTP)
1. Spanning Tree Protocol (STP) : STP is also known as spanning tree protocol is a layer 2 (Data link layer) protocol, it runs on switches and bridges. The IEEE standard of STP is 802.1D. STP is a feature used to prevent loops when using redundant switches. For example, we have three switches they are all linked together and without STP a loop coul
4 min read
Types of Spanning Tree Protocol (STP)
Prerequisite - Spanning Tree Protocol Spanning Tree Protocol (STP) is used to make a loop free network by monitoring the network to track all the links and shut down the least redundant ones. Root bridge is a switch in a single VLAN or whole topology (according to the type of STP standard used) which is responsible for distributing BPDUs and block
3 min read
Working of Spanning Tree Protocol (STP)
Spanning Tree Protocol (STP) prevents the looping of the frame by putting the interfaces of the switch in either forwarding or blocking state. How Switch is able to decide which interface should be in forwarding or blocking state. We’ll learn the answer to this question in this article. Before we further proceed, we must know some terms. BID – It s
3 min read
How Spanning Tree Protocol (STP) Select Designated Port?
Spanning tree protocol is a type of communication protocol that functions to build a loop-free topology, which means the arrangement of elements in a computer network. STP commonly works for layer-2 bridges and switches. It also provides a backup link for the network system if the active link fails. Layer-2 devices send the data in the form of fram
3 min read
Topology Changes in Spanning Tree Protocol (STP)
Spanning Tree Protocol (STP) is used to prevent loops in the network due to redundant connections between switches in the network. It determines an efficient path from non-root switches to root switches with the help of Bridge Protocol Data Unit (BPDUs). BPDU carries information regarding topology changes within the network to notify all the switch
4 min read
Spanning Tree Topology (STP) Convergence
Once the Spanning Tree Topology (STP) is established, STP continues to work until some changes occurs. Manual changes that Network Engineer can apply are configuration of Bridge ID and port costs. Also there are other changes like the addition of switch or failure of port of an existing switch. The reaction of STP when some changes occurs by reconf
2 min read
Root Bridge Election in Spanning Tree Protocol
Redundant links are used to provide a backup path when one link goes down but a Redundant link can sometimes cause switching loops. The main purpose of Spanning Tree Protocol (STP) is to ensure that you do not create loops when you have redundant paths in your network. Spanning Tree Protocol (STP) - As IEEE STP is used to make a loop-free network b
4 min read
What is MSTP(Multiple Spanning Tree Protocol)?
The Multiple Spanning Tree Protocol (MSTP) and algorithm, gives both straightforward and full network doled out to any given Virtual LAN (VLAN) all through a Bridged Local Area Network. MSTP employments BPDUs to trade data between spanning-tree consistent gadgets, to avoid circles in each MSTI (Multiple Spanning Tree Instances) and within the CIST
2 min read
Rapid Spanning Tree Protocol
RSTP is the more improved and advanced version of STP which is a layer 2 protocol that prevents bridge loops and broadcast storms in local networks with redundant connections. Rapid spanning tree protocol has faster convergence and it is also backward-compatible with STP. To make sure a loop-free topology, the Rapid Spanning Tree Protocol (RSTP) pr
5 min read
Configuring Spanning Tree Protocol Portfast
Spanning Tree Protocol is a data link layer or layer-2 protocol whose prime objective is to prevent loops in the different network configurations or network topologies. It tracks all the links and closes the redundant ones. It uses the spanning tree algorithm(STA) to create a topology database and then search out the redundant links to disable them
5 min read
What is STP(Shielded Twisted Pair)?
Today, people can very easily communicate with one another no matter the distance that might lie before them. All of this has been made possible by inventions like the telephone, the computer, etc. It has brought people together and that is only made possible by the specific way in which the system has been built - which is to say that one must kee
4 min read
Difference between Unshielded Twisted Pair (UTP) and Shielded Twisted Pair (STP) cables
In networking, UTP and STP both are used for data, voice, and signal transmission, made of twisted pair of copper wires to reduce electromagnetic interference (EMI) and crosstalk. As the name suggests UTP consists of pairs of wires twisted together without any shielding layer, it depends on external shielding whereas STP has an additional layer of
5 min read
Hot Standby Router Protocol (HSRP) and Virtual Router Redundancy Protocol (VRRP)
Hot Standby Router Protocol (HSRP) is a CISCO proprietary protocol used to provide redundancy in a network. Only one router is the active router while others will be in standby state i.e the standby router will be responsible for forwarding the traffic when the active router fails. Virtual Router Redundancy Protocol (VRRP) is an open standard proto
3 min read
Difference between File Transfer Protocol (FTP) and Secure File Transfer Protocol (SFTP)
FTP (File Transfer Protocol) It is a protocol that is used to transfer or copy the file from one host to another host. But there may be some problems like different file names and different file directories while sending and receiving a files in different hosts or systems. And in FTP, a secure channel is not provided to transfer the files between t
3 min read
Difference between Serial Line Internet Protocol (SLIP) and Point-to-Point Protocol (PPP)
The main difference between the Serial Line Internet Protocol (SLIP) and Point-to-Point Protocol (PPP) is that Serial Line Internet Protocol is the Predecessor protocol of Point-to-Point Protocol. On the other hand, Point-to-Point Protocol is the Successor protocol of Serial Line Internet Protocol. Features of SLIP: Simple: SLIP is a simple protoco
4 min read
Cisco Discovery Protocol (CDP) and Link Layer Discovery Protocol (LLDP) in Data Link Layer
Layer 2 or the Datalink layer provides physical addressing and access to media. It defines how data is to be formatted for transmission and how access to the network is to be controlled. It also provides error detection, ensuring data on higher layers is formatted correctly for transmission. Cisco Discovery Protocol (CDP) and Link Layer Discovery P
2 min read
Difference between Stop and Wait protocol and Sliding Window protocol
Both the Stop and Wait protocol and the Sliding Window protocol are the techniques to the solution of flow control handling. The main difference between the Stop-and-wait protocol and the Sliding window protocol is that in the Stop-and-Wait Protocol, the sender sends one frame and waits for acknowledgment from the receiver whereas in the sliding wi
5 min read
Difference between Border Gateway Protocol (BGP) and Routing Information Protocol (RIP)
When dealing with network routing, it's crucial to understand the various protocols that help direct traffic across complex networks. Two significant protocols in this space are the Border Gateway Protocol (BGP) and the Routing Information Protocol (RIP). Each serves different purposes and operates under different principles. This article explores
5 min read
Spanning Tree Port States
Spanning tree protocol prevent looping of frames around LAN by placing ports of switch in different states based on the criteria such as selection of root switch, switch's root cost, etc. There are five Spanning Tree Port States : 1. Blocking State : Switch port enters the blocking state at time of election process, when a switch receives a BPDU on
3 min read
Spanning Tree Path Cost Value
Prerequisite: Introduction of Spanning Tree ProtocolWorking of Spanning Tree ProtocolTypes of Spanning Tree ProtocolSpanning Tree Protocol (STP) is used to prevent loops in the network due to redundant connections between switches in the network. It determines a unique and shortest path from non-root switches to root switches with the help of Bridg
3 min read
Introduction of Virtual Router Redundancy Protocol (VRRP) and its configuration
VRRP is an open standard protocol, which is used to provide redundancy in a network. It is a network layer protocol (protocol number-112). The number of routers (group members) in a group acts as a virtual logical router which will be the default gateway of all the local hosts. If one router goes down, one of the other group members can take place
4 min read
Introduction of Message Queue Telemetry Transport Protocol (MQTT)
Message Queuing Telemetry Transport, or MQTT, is a communications protocol designed for Internet of Things devices with extremely high latency and restricted low bandwidth. Message Queuing Telemetry Transport is a perfect protocol for machine-to-machine (M2M) communication since it is designed specifically for low-bandwidth, high-latency settings.
9 min read
MAC Protocol Used in Wireless Sensor Networks
Pre-requisites: Classification of MAC Protocols In Wireless Sensor Networks (WSNs), the Medium Access Control (MAC) protocol is a set of guidelines that dictate how each node should transmit data over the shared wireless medium. The primary objective of the MAC protocol is to minimize the occurrence of idle listening, over-hearing, and collisions o
6 min read
Hot Standby Router Protocol (HSRP)
Hot Standby Router Protocol (HSRP) is a CISCO proprietary protocol, which provides redundancy for a local subnet. In HSRP, two or more routers gives an illusion of a virtual router. HSRP allows you to configure two or more routers as standby routers and only a single router as an active router at a time. All the routers in a single HSRP group share
4 min read
What is DCCP (Datagram Congestion Control Protocol)?
Congestion in a network means deterioration of network or services which are caused due to overloading of network nodes, basically, this problem is primarily associated with large networks, in which a large amount of data and information is being transmitted. Congestion can be caused by several reasons: either the routers which are being used are n
6 min read
Dynamic Trunking Protocol (DTP)
Trunk ports are ports that are used to carry the traffic of more than one VLAN. The port which connects two different switches and the switches have more than one VLAN configured then that port should be made trunk. If all the VLANs are allowed then trunk ports will carry traffic of all the VLANs including native VLANs for which the traffic goes un
4 min read
VLAN Trunking Protocol (VTP)
To carry traffic of a VLAN, it must be first configured on the switch. Suppose, if the user wants to send a frame from source to destination and the shortest path between them contains 1000 switches. To process a frame of any VLAN, VLANs should be configured first so, have to configure the same VLANs on all the 1000 switches manually. It will not b
5 min read
Features of Enhanced Interior Gateway Routing Protocol (EIGRP)
Enhanced Interior Gateway Routing Protocol (EIGRP) is a Cisco-proprietary Hybrid routing protocol that contains features of distance-vector and link-state routing protocols. It is a network layer protocol that works on protocol number 88. Some of its features are: Rapid convergence - EIGRP uses a DUAL algorithm to support rapid convergence. If a ro
4 min read
Open Shortest Path First (OSPF) Protocol fundamentals
Open shortest path first (OSPF) is a link-state routing protocol that is used to find the best path between the source and the destination router using its own shortest path first (SPF) algorithm. A link-state routing protocol is a protocol that uses the concept of triggered updates, i.e., if there is a change observed in the learned routing table
5 min read
Open Shortest Path First (OSPF) protocol States
Prerequisite - OSPF fundamentals Open Shortest Path First (OSPF) is a link-state routing protocol that is used to find the best path between the source and the destination router using its own Shortest Path First). OSPF is developed by Internet Engineering Task Force (IETF) as one of the Interior Gateway Protocol (IGP), i.e, the protocol which aims
4 min read
Article Tags :