Spanning Tree Protocol (STP)- What It Is and How It Works? 2023 (2024)

Spanning Tree Protocol (STP)- What It Is and How It Works? 2023 (1)

by Aakriti

Spanning Tree Protocol (STP)- What It Is and How It Works? 2023 (2)

The Spanning Tree Protocol (STP) is a network protocol that is situated in Layer 2 (Data Link Layer) of the Open Systems Interconnection (OSI) model. It was built to prevent the problems that arise when data is exchanged through computers over a Local Area Network (LAN).

If 2-3 switches are connected together, they broadcast by default. When a message is broadcasted, it is sent all across the switches back and forth. This could lead to a broadcast storm or the formation of a loop.

Note: The Spanning Tree Protocol (STP) is the topic in CCNA 200-301 examandone of the most important topic in switching .

If you haven’t read the previousblog of our CCNA 200-301 series,I highly recommend you do so.

Spanning Tree Protocol (STP)- What It Is and How It Works? 2023 (3)

This is where the Spanning Tree Protocol (STP) comes in handy.

What Does Spanning Tree Protocol (STP) Do?

The Spanning Tree Protocol (STP) avoids the formation of loops or broadcast storms. It does so by blocking ports where it senses loop formation. In other words, the STP looks after the network to make it loop-free by tracking all the links and stopping the working of useless links.

The STPs are now standardized by the Institute of Electrical and Electronics Engineers (IEEE). It is now referred to as STP (802.1D).

How Does STP Work?

The STP works in the following three steps:

  • Selecting the root bridge
  • Selecting the root port
  • Selecting designated port and non-designated port

Before we dive deep into these steps, here are some terms that you must know about!

1. Bridge:

A bridge is a very important component of VLAN Trunking Protocol (VTP) that functions to connect to or more LAN segments.

2. Bridge ID:

The bridge ID refers to the MAC address of a particular bridge. It is an 8-byte entity that consists of a bridge priority (2 bytes) and a Base MAC address (6 bytes). The base MAC address is considered in cases where there is a tie on the bridge priority.

Spanning Tree Protocol (STP)- What It Is and How It Works? 2023 (4)

3. Root Bridge:

The bridge with the lowest bridge ID is called the root bridge. The root bridge chooses which port has the best path to the root bridge.

4. Bridge Priority Data Unit (BPDU):

An STP network device has to exchange messages to run a loop-free topology smoothly. All the switches exchange BPDU to select the right root bridge. The switch with the lowest Bridge ID is chosen as the root bridge.

5. Bridge Priority:

Every switch is assigned a priority. It is 32768 by default.

Now that you are familiar with all these terms, let’s learn how the STP works.

1. Selecting the root bridge:

The root bridge with the lowest bridge ID is selected. The lower bridge ID is found as follows:
Bridge ID = Priority + MAC Address

By default, the priority of all the switches is the same. If the priority is the same, then we look for the MAC addresses of the switches. The BPDU message is sent and it compares the MAC addresses of all the switches.

The switch that has the lowest MAC Address is then chosen. Therefore, this is our root bridge. This root bridge becomes the focal point of the connection.

Note: No port of the root bridge is ever blocked.

2. Selecting the root port:

Now that we have found our root bridge, other switches will find out the best path to reach the root bridge. They do so by checking the path cost. The path with the lowest cost is selected to connect with the root bridge.

Spanning Tree Protocol (STP)- What It Is and How It Works? 2023 (5)

From the above path cost table, you can see that the cost for 100 Mbps is 19.

3. Selecting designated port and non-designated port:

You should remember that there are two types of ports:

Forwarding Ports

Block Ports

1. These are the designated ports.

1. These are the non-designated ports.

2. The root ports are the forwarding ports.

2. The block ports are non-forwarding ports.

The root bridge is the designated port.

In case, if the cost of a path is the same no matter what path is chosen, the switches look for lower Bridge ID using BPDU.

The port with the higher bridge ID (MAC address + Priority) is blocked.

If you want to learn how STP works in a visual way, you can watch this video right here:

What are the Types of Spanning Tree Protocol?

There are over six types of STP protocols that we study. Let’s go over each of them and learn the difference between them!

Standard

Description

Short Form

802.1D

  • Prevents loop
  • Also known as Common Spanning Tree (CST).
  • It is very slow (32 seconds to converge).
  • In case of changes, it auto-configures the trees.
  • No load balancing is performed.

STP/CST

Cisco Proprietary

  • Finds root bridge per VLAN for Cisco devices.
  • It is more optimized.
  • It is slow as CST.
  • Backward compatibility with CST.

PVRST+ or R-PVST+

802.1w

  • It is referred to as the Rapid Spanning Tree Protocol.
  • It has improved STP with fast performance.
  • Backward compatibility with STP.

RSTP

Cisco Proprietary

  • Per VLAN Rapid Spanning Tree.
  • Faster convergence than PVST+.

RPVST+

802.1s

  • VLANs are grouped.
  • RSTP is run for each group.
  • Multiple Spanning Tree Protocol.

MSTP

802.1Q

  • It is the Virtual LAN.
  • It uses single STP for all VLANs.

CST

What are the States of STP?

There are five different states of STP. These are as follows:

Spanning Tree Protocol (STP)- What It Is and How It Works? 2023 (6)

1. Blocking State:

  • It is a non-designated port.
  • It does not take part in the forwarding of frames.
  • Switch ports are kept in the blocking state for 20 seconds. After that, they change to the listening state.

2. Listening State:

  • It is the first state of the Spanning Tree Protocol after the blocking state.
  • The STP decides whether to use the port in frame forwarding or not.
  • The ports stay in the listening state for 15 seconds and then move on to the next state.

3. Learning State:

  • This state helps prepare STP to take part in the frame forwarding state.
  • The STP discards frames received on the port during this state.
  • It receives BPDUs.
  • It learns the addresses.
  • The learning state lasts for 15 seconds.

4. Forwarding State:

  • The ports forward the frames received to the other ports in this state.
  • It receives BPDUs in this state.
  • It also learns the addresses.
  • The ports remain in the forwarding state until any change occurs.

5. Disabled State:

  • When an administrator commands the port to get disabled, the port enters the disabled state.
  • it then discards the frames received on the port.
  • It stops learning the LAN addresses.
  • It does not receive BPDUs.

It’s a Wrap!

That’s all for our STP blog. I have covered everything that you need to know about STP.

Now, you are familiar with what is STP, how it works, the types of STP, and the various states of STP. If you are not familiar with switches very well, I recommend you to read this blog.

Stay tuned for moreblogs for the CCNA 200-301 series!

Happy learning!

  1. if Switch 1 is root bridge and it is connected to switch 2 and 3
    and switch 4 is Connected to Switch 2 and 3 whether STP Priority of Switch 2 is low and Switch 3 is High on Switch 4 as Switch 2 port is root port on Switch 4.
    my question is if Switch 1 Port Goes down of Switch 2
    Switch 1 and Switch 2 are Disconnected Although we set on Switch 4 priority for Switch 2
    so, how data will travel to root bridge when connectivity between switch 2 and 4 is ok but 1 and 2 are not connected???
    Please Answer

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Spanning Tree Protocol (STP)- What It Is and How It Works? 2023 (2024)
Top Articles
8 Next Cryptocurrencies to Explode in 2024 | The Motley Fool
10 Best Crypto Coins for Long-Term Investment in July 2024 - Disrupt Africa
Unblocked Games Premium Worlds Hardest Game
Western Union Mexico Rate
Jeremy Corbell Twitter
Georgia Vehicle Registration Fees Calculator
Lexington Herald-Leader from Lexington, Kentucky
Sissy Transformation Guide | Venus Sissy Training
Noaa Swell Forecast
How to Type German letters ä, ö, ü and the ß on your Keyboard
Natureza e Qualidade de Produtos - Gestão da Qualidade
I Wanna Dance with Somebody : séances à Paris et en Île-de-France - L'Officiel des spectacles
24 Best Things To Do in Great Yarmouth Norfolk
Yakimacraigslist
NBA 2k23 MyTEAM guide: Every Trophy Case Agenda for all 30 teams
Hewn New Bedford
Used Patio Furniture - Craigslist
Spiritual Meaning Of Snake Tattoo: Healing And Rebirth!
Gma' Deals & Steals Today
Netspend Ssi Deposit Dates For 2022 November
Robotization Deviantart
Black Lion Backpack And Glider Voucher
Joann Fabrics Lexington Sc
Skepticalpickle Leak
Past Weather by Zip Code - Data Table
Redbox Walmart Near Me
Wells Fargo Bank Florida Locations
Ridge Culver Wegmans Pharmacy
Ucm Black Board
Autotrader Bmw X5
Capital Hall 6 Base Layout
Puerto Rico Pictures and Facts
Song That Goes Yeah Yeah Yeah Yeah Sounds Like Mgmt
The Mad Merchant Wow
Hannibal Mo Craigslist Pets
Caderno 2 Aulas Medicina - Matemática
R Nba Fantasy
Troy Gamefarm Prices
Main Street Station Coshocton Menu
Mvnt Merchant Services
Yogu Cheshire
140000 Kilometers To Miles
Invalleerkracht [Gratis] voorbeelden van sollicitatiebrieven & expert tips
If You're Getting Your Nails Done, You Absolutely Need to Tip—Here's How Much
Promo Code Blackout Bingo 2023
2294141287
Www.homedepot .Com
Motorcycle For Sale In Deep East Texas By Owner
Maurices Thanks Crossword Clue
Swissport Timecard
Latest Posts
Article information

Author: Kimberely Baumbach CPA

Last Updated:

Views: 6500

Rating: 4 / 5 (41 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Kimberely Baumbach CPA

Birthday: 1996-01-14

Address: 8381 Boyce Course, Imeldachester, ND 74681

Phone: +3571286597580

Job: Product Banking Analyst

Hobby: Cosplaying, Inline skating, Amateur radio, Baton twirling, Mountaineering, Flying, Archery

Introduction: My name is Kimberely Baumbach CPA, I am a gorgeous, bright, charming, encouraging, zealous, lively, good person who loves writing and wants to share my knowledge and understanding with you.