Introduction to Spanning-Tree

I kind of miss a lesson in the STP-section that gives an overview of the different protocols and their benefits and that compares them. I have tried to make an overview but I still have a few questions. Hope someone can help me with this:

Non-proprietary:

STP (“classic” or 802.1d)
This is just for teaching purposes?

RSTP (802.1w)
-Improvement of 802.1d.
-Faster convergence and some other advantages.
-Needs to be explicitly configured on Cisco switches as it is not the default.
-Disadvantage: by default all VLANs are participating in the same VTP process.

Cisco:

PVST+
-Default on all Cisco switches
-An instance of this protocol will run on every VLAN, so every VLAN has its “own” STP-process.
-Allows for Cisco features such as portfast and BPDU guard.
-What about the speed of convergence in comparison to the non-proprietary ones?

Rapid PVST+
Is there a reason why this version is not covered here?

Hello Marit

There is an issue with the various types of STP because of the fact that not all documentation refers to the same type of STP in the same way. Some of the discrepancies that you will find include:

PVST and PVST+ - These are two different types of PVST. The first supports ISL VLAN tags while the second support 802.1Q VLAN tags. Even so, you will find that some people don’t include the + at the end, and simply write PVST, but they mean PVST+. PVST is almost never used, so wherever you see PVST, you can assume PVST+. PVST+ is currently the default STP version for devices using IOS 15.0 and higher. But even so, the command to configure PVST+ (or return a device to it’s default STP configuration) is just pvst without the “+”. So that can be confusing.

RSTP and Rapid PVST and RAPID PVST+ - RSTP is an improvement on STP, but is also not a good choice for today’s networks. Many of the newer Cisco platforms don’t support plain RSTP. However the term RSTP unfortunately is often used to refer to Rapid PVST+. Needless to say that Rapid PVST and Rapid PVST+ (like plain PVST and PVST+) are also confused. Once again, the command to enable Rapid PVST+ is rapid-pvst without the +. Rapid PVST+ is actually covered in this lesson.

So to summarize:
STP - original protocol, not used today, and actually not supported on new Cisco devices
RSTP - improvement, not used today, and not supported on most new Cisco devices
PVST - per VLAN STP, but supports ISL tags, also not supported on most if not all new Cisco devices (ISL tags are a Cisco proprietary way of tagging VLANs as opposed to 802.1Q).
PVST+ - currently the default STP version on most Cisco devices, but uses pvst as the command to enable/configure it
Rapid PVST - I’m 99% sure this doesn’t actually exist, but if it did it would be a rapid version of PVST that uses ISL VLAN tags instead of 802.1Q VLAN tags. However, this term is often used (confusingly) to refer to Rapid PVST+.
Rapid PVST+ - This is a Cisco enhancement to PVST+, but confusingly, is enabled using the rapid-pvst command.

This Cisco document may help you further in clarification of the various types of STP. Even there, it’s a good idea to try to understand which specific protocol they’re talking about by looking at the context.

I hope this has been helpful!

Laz

1 Like

Thanks a lot for your comprehensive answer Laz, very helpful :smile:

1 Like

Hi,

I have one question, when the switches reduce the MAC address age timer to the forward delay time to flush out the older MAC entries, does this happen during the listening state?

Hello Helen

The MAC address age timer is reduced from 300 seconds to 15 seconds ( the value of the forward delay timer) when a Topology Change Notification (TCN) message is received by a switch. When such a notification is received, the switch will also determine if it needs to change its root port based on any revised costs to reach the root bridge. If it does, then it chooses a new root port that goes through the listening, learning, and forwarding stages as needed. If it does not, then its ports remain in the states they are already in.

So the reduction of the MAC address age timer, although it occurs simultaneously, is independent of the particular states in which the ports of a switch may find themselves.

You can see a more detailed description of this whole process at the following lesson:

I hope this has been helpful!

Laz

1 Like

Hi Lazaros,

Thank you for your detailed explanation. I’ve already read the lesson few times. However, I’m still confused in certain questions:

  1. I forgot where I read this, but I remember it says STP is smart enough to know when an interface goes down, and it will bypass the Max Age Time then immediately switch to the listen state. I think I’m confused when will this Max Age Time comes to play.

  2. If the link failure happens on different places, will the convergence time be any difference? For instance, will the convergence time be different if link failure happens between SW1 1/0 – SW3 0/0 VS SW1 f0/0 – SW2 0/0 VS SW2 1/0 – SW3 1/0?
    Capture

  3. You mentioned if it needs to change its root port, then it will go through the port states process. If it doesn’t need to change its root port, then ports remain in the state they’re already in. What if the link failure happens between the DP – alternative port? I tested it by myself and found out if I shutdown the block port, the debug spanning-tree events doesn’t show anything. But If I shutdown the DP port that connects to the block port, TCN generated. Would you please share more details on the logic under the circumstance that no root port need to be changed?

Thank you so much for your help, I cannot get my head around this.

Helen

Hello Helen

Yes, this is correct. Remember that the max age timer is the amount of time a received BPDU is considered valid. If a new BDPU is not received within Max Age Timer, (by default 20 seconds), then the port is no longer considered a root port. But if the root port goes down, STP won’t wait for the Max Age timer, it KNOWS the root can’t be reached via that port, so it will put the other ports immediately into the listening state to determine the new root bridge. So the Max Age Timer comes into play only when new BPDUs are not received, but the current root port remains up.

Yes, the convergence time will indeed vary. Assuming SW1 is the root bridge, if the link between SW2 and SW3 fails, reconvergence time is zero. The Fa0/0 ports on both SW2 and SW3 remain the root ports and nothing changes. If the link between SW1 and SW2 fails, reconvergence procedures will only take place on SW2. SW3 and SW1 remain as they are. Such a reconvergence should take about 30 seconds (15 listening + 15 learning), assuming the failure is detected as a downed port on SW2. The same would happen if the link between SW1 and SW3 failed, only reconvergence would only take place on SW3, once again, for 30 seconds.

As your experiment states, if you shutdown the blocked port, or if you shut down the port opposite the blocked port, in both cases, you will find that there is no debug information on the switch with the blocked port. This is because the port goes from blocked to shutdown. There is nothing changing. However, in both cases, you will find that there is indeed a TCN generated on the other switch, because the port goes from a designated state to a down state. Even so, the TCN will not change any of the STP topology, therefore reconvergence doesn’t need to take place. STP topology remains the same.

I hope this has been helpful!

Laz

How can I configure STP in GNS?
I have heard that we cannot create VLAN and cant do no switchport command in GNS so are there any other alternative?
I have even seen Eve-ng but there I have to download paid versions of Virl images. so any other alternative which is free ?

Hello Vedant

This was the case in the past, however, this now has changed. GNS3 does support STP and its various versions using several different images and platforms. You can find out detailed information about these and how to set them up at this GNS3 link.

Try it out and if you need any further help, let us know!

I hope this has been helpful!

Laz

Hi Rene/Laz,

Q1)I wanna know that what is the STP convergence time while using features STP Port-
fast and STP backbone-fast ?

Q2) what is the RSTP Convergence time to move port from Discarding State to
Forwarding State ?

Q3) In STP whenever topology changes it takes 30s to move port from blocking state to
forwarding state but I think it must be 50 sec b/c port stayed in blocking mode for
20 sec + 15sec for listening + 15 sec for learning state ( Total Convergence Time =
50sec) ?

Q4) When we say convergence time, It is the time taken by stp to move port from
Learning state to Forwarding state or Blocking state to Forwarding state?

Hello Pradyumna

Let me start by answering your last question first:

Convergence time for STP refers to the amount of time it takes for the whole STP topology to stabilize. For any single STP topology, that may be composed of many switches, the convergence time is the amount of time it takes for all ports on all switches in the topology to go through the various states until they become either root, designated, or blocked ports, and stop changing. Because the state of one port on one switch will affect the state of another port on another switch, convergence time (of the original STP 802.1D) can sometimes be on the order of several minutes in extensively large networks.

Based on the definition of convergence time, you can see that this question depends on the network topology. Portfast and backbone-fast do improve convergence times, each in their own way. Indeed, portfast eliminates the requirement of reconverging a network at all. If a portfast port is shut down, the STP topology will simply ignore it, and the STP topology remains stable. No reconvergence need take place, so convergence time is zero. Backbonefast will reduce the process of moving through the states by 20 seconds, thus making convergence 20 seconds faster, at least for the specific link in question.

In the RSTP lesson, Rene states the following:

Rapid spanning doesn’t use timers to decide whether an interface can move to the forwarding state or not. It will use a negotiation mechanism for this.

This negotiation mechanism means that convergence is on the order of seconds, even for very large networks. I suggest you go through the RSTP lesson for more detail.

There is a difference here. If a port is already in the blocking state, and a topology change occurs, only then will the port wait for 20 seconds in the blocking state, and then 15 listening, and 15 learning before forwarding. In this case, we have a total of 50 seconds. But for a switch that has just been turned on, or for ports already in designated or root states, there is no 20 seconds in the blocking state. We go immediately to 15 listening and 15 learning before going to forwarding.

I hope this has been helpful!

Laz

Dear Sirs,
Hello,
I usually use from packet tracer in order to practice my CCNA lessons.
I wanted to monitor the port status of STP by typing in enable mode#debug spanning-tree events , but the command isn’t working.
can you please tell me how to do that in packet tracer or how to monitor STP port status in Cisco Packet tracer?
I thank you and appreciate in advance for the help.

Regards,

Ajmal" Ahmadi"

Hello Ajmal

Unfortunately, Packet Tracer is limited in the debugs available for STP. You will be unable to achieve what you need using Packet Tracer. In order to be able to monitor STP, you must implement it either using GNS3, VIRL, or real equipment. You can find out more about GNS3 and VIRL at the following lesson:

I hope this has been helpful!

Laz

Thanks sir, for instructions!
Appreciated

Regards

Ajmal" Ahmadi"

Hi Guys.
I’ve a dubt. :S

What happen when I connect a switch with a STP configured with another without STP? ( as I know in this case the the SW without STP simply drop BPDU packets…correct me if i’m wrong…)

And If I connect a switch with STP to an access to anoyher SW with STP configured?
Can I risk to impact my network with L2 converge in this case…

Thanks

Hello Giovanni

Simply put, if you interconnect switches that do not support STP into a physical loop, you will experience network degradation, and very likely a complete failure of your network.

However, keep in mind that if your network topology doesn’t include any physical loops, then you can use whatever switches you want. STP will not play any role whatsoever in such a topology.

If a switch that does not support STP receives BPDUs, it will most likely forward them out of all of its ports. BPDUs have a multicast destination address of 01:80:C2:00:00:00, or 01:00:0C:CC:CC:CD in the case of Cisco’s PVST. Most switches are configured to forward multicast addresses out of all their ports. But what will actually happen in such a case depends on how that particular switch is designed to function.

Switches that don’t support STP are typically small non managed switches with 5, 8, or 16 ports. These should never be used in your backbone network, and should only be used in a SOHO environment, or in the worst case, as a temporary access switch in an office where there aren’t enough network jacks. Making sure these switches don’t participate in any physical loop will ensure your network remains functional, even if they don’t support STP.

Beware of end-users that try to interconnect their PCs and other devices using such switches, as they could easily inadvertently create a loop and cause your network to fail.

I hope this has been helpful!

Laz

Question regarding the Root bridge election. Its says SW3 000f.34ca.1000 has a lower MAC address then SW1 0011.bb0b.3600 and SW2 0019.569d.5700. Wouldn’t SW1 have the lower mac address if you convert 000f it would be “0015” and “0011” is lower?

Hello Christopher

If you take a look at the hex values and convert them to decimal, you will see that

  • 000f = 15
  • 0011 = 17
  • 0019 = 25

So SW3 does indeed have the lowest MAC address. It can get confusing, so no worries!

I hope this has been helpful!

Laz

Port numbers are defined internally for STP:
use command to see which port number is assigned: show spanning-tree vlan 1 detail

i hope this helps to understand the number “18”

1 Like

Kindly help me sir…

Q-1=How many bits the Prio.Nbr in STP ?What is Prio and Nbr.
Q-2-Whats the use of Max age if the MAC flush timer is 300sec , How STP deal with it ?
Q-3=Which Layer 2 MAC address is putting by a switch in BPDU as destination MAC?,
Q-4=When a switch sends the BPDU which MAC ID it uses as source ,System MAc or Interface MAC address ?
Q-5= Why all SVI in a switch has same MAC ID ?
Q-6=The BPDU sent and received on Blocked port or not ?
Q-7=What the order of election happens to elect the root port selection and blocking port selection.
Q-8=Switch sends the BPDU to their neighbor switch or the BPU can be sent transit via one switch ?(Sw1=>sw2=>Sw3),(Can Sw1 send the bpdu to sw3)?
Q-9=Does root bridge comes in as transit every time in data plane when the switch does forwarding ?
Q-10=How STP converges the root port failure and root bridge failure ?
Q-11- How the port transition happens normally when there is a root port failure and non root port failure ?
Q-12-what is port blocking state in port transition ?