# Introduction to Spanning-Tree

**URL:** <https://forum.networklessons.com/t/introduction-to-spanning-tree/853>\
**Category:** Lessons Discussion\
**Created:** [December 20, 2016, 9:34pm UTC](https://forum.networklessons.com/t/introduction-to-spanning-tree/853 "2016-12-20T21:34:00Z")\
**Posts on this page:** 20\
**Page:** 5

<div class="post-metadata">

**Author:** ![srikrishnar](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/s/57b2e6/32.png) [@srikrishnar](https://forum.networklessons.com/u/srikrishnar)\
**Post date:** [August 5, 2016, 4:14pm UTC](https://forum.networklessons.com/t/introduction-to-spanning-tree/853/81 "2016-08-05T16:14:04Z")

</div>

Hi Rene

Very good explanations with examples  
However one point.  
To choose a designated port on a network segment which has got no root port , the first priority will be the least cost path to the root bridge.  
The next would be the port on a switch whose bridge priority is less compared to the other port in the segment which you have already stated.  
Iam I right ?

---

<div class="post-metadata">

**Author:** ![andrew](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/andrew/32/645_2.png) [@andrew](https://forum.networklessons.com/u/andrew)\
**Post date:** [August 5, 2016, 4:53pm UTC](https://forum.networklessons.com/t/introduction-to-spanning-tree/853/82 "2016-08-05T16:53:36Z")

</div>

Ramananthan,  
You are correct! Assuming equal cost paths to the root bridge, then the designated port will be the port that belongs to the switch with the lowest bridge ID. If there are multiple connections to this same switch (that has the lowest bridge ID), then the lowest port number will be the DP.

---

<div class="post-metadata">

**Author:** ![wilson.r.02](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/w/85e7bf/32.png) [@wilson.r.02](https://forum.networklessons.com/u/wilson.r.02)\
**Post date:** [August 6, 2016, 4:42am UTC](https://forum.networklessons.com/t/introduction-to-spanning-tree/853/83 "2016-08-06T04:42:47Z")

</div>

I know it’s a little off-topic, but thanks René. I was looking for the Visio stencils as well. The ones you use look cleaner than the ones I was using. Much appreciated.

---

<div class="post-metadata">

**Author:** ![navjotarora1987](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/n/ecb155/32.png) [@navjotarora1987](https://forum.networklessons.com/u/navjotarora1987)\
**Post date:** [August 23, 2016, 3:19am UTC](https://forum.networklessons.com/t/introduction-to-spanning-tree/853/84 "2016-08-23T03:19:48Z")

</div>

Hi Rene,  
Please clear following doubts of spanning tree.

1. In the Listening mode, each switch sends Hello BPDUs. In this stage, Root Bridge is decided. After Root Bridge is decided, then only Root Bridge sends BPDUs for deciding Port Roles like DP, RP etc.Please correct me if I am wrong.
2. Regarding the TCN. In STP, root bridge receives TCN, then it will send BPDU message with TC bit set and this happens for Max Age + Fwd Delay time.  
So during this period only, transition of port is also happening. Its confusing. Can you please explain this point more cleary.

---

<div class="post-metadata">

**Author:** ![navjotarora1987](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/n/ecb155/32.png) [@navjotarora1987](https://forum.networklessons.com/u/navjotarora1987)\
**Post date:** [August 23, 2016, 3:52am UTC](https://forum.networklessons.com/t/introduction-to-spanning-tree/853/85 "2016-08-23T03:52:04Z")

</div>

Hi Rene,

One more small doubt: what is the reason for the root bridge to sent the BPDUs with TC flag set for fwd Delay + Max Age time?

---

<div class="post-metadata">

**Author:** ![ewibowo](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/e/65b543/32.png) [@ewibowo](https://forum.networklessons.com/u/ewibowo)\
**Post date:** [October 4, 2016, 11:02pm UTC](https://forum.networklessons.com/t/introduction-to-spanning-tree/853/86 "2016-10-04T23:02:08Z")

</div>

Suggestion to be clearer:  
For example whenever the switch doesn’t know about a destination MAC address (unknown unicast) in the MAC address table of the switch, it will be flooded.

---

<div class="post-metadata">

**Author:** ![maher1](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/m/9dc877/32.png) [@maher1](https://forum.networklessons.com/u/maher1)\
**Post date:** [October 7, 2016, 8:43am UTC](https://forum.networklessons.com/t/introduction-to-spanning-tree/853/87 "2016-10-07T08:43:48Z")

</div>

Hi Edi,

If your question is whether a switch receive a frame for a destination MAC address which doesn’t have an entry in the MAC address table of the switch, then it is correct that it will be flooded to all the ports of the switch in exception of the incoming port from where the frame has been received.

Here a lesson explaining this in details: [How does a switch learn Mac addresses](https://networklessons.com/switching/how-does-a-switch-learn-mac-addresses/)

Hope I could answer you.

---

<div class="post-metadata">

**Author:** ![junetworker](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/j/fbc32d/32.png) [@junetworker](https://forum.networklessons.com/u/junetworker)\
**Post date:** [November 16, 2016, 1:47pm UTC](https://forum.networklessons.com/t/introduction-to-spanning-tree/853/88 "2016-11-16T13:47:37Z")

</div>

Hi rene!I have a question… if STP is disabled for a VLAN, what will be the state of the ports belonging to that vlan?

Thanks in advance!  
Jimmy

---

<div class="post-metadata">

**Author:** ![ReneMolenaar](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/renemolenaar/32/488_2.png) [@ReneMolenaar](https://forum.networklessons.com/u/ReneMolenaar)\
**Post date:** [November 23, 2016, 12:07pm UTC](https://forum.networklessons.com/t/introduction-to-spanning-tree/853/89 "2016-11-23T12:07:32Z")

</div>

Hi Jimmy,

You can disable STP per VLAN with the **no spanning-tree vlan** command. These interfaces will be forwarding traffic. They don’t go through the listening, learning and/or blocking states.

Rene

---

<div class="post-metadata">

**Author:** ![shantel](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/shantel/32/360_2.png) [@shantel](https://forum.networklessons.com/u/shantel)\
**Post date:** [December 20, 2016, 9:35pm UTC](https://forum.networklessons.com/t/introduction-to-spanning-tree/853/90 "2016-12-20T21:35:59Z")

</div>

19 posts were merged into an existing topic: [Introduction to Spanning-Tree](https://forum.networklessons.com/t/introduction-to-spanning-tree/853)

---

<div class="post-metadata">

**Author:** ![rohgamerps](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/r/9dc877/32.png) [@rohgamerps](https://forum.networklessons.com/u/rohgamerps)\
**Post date:** [January 13, 2017, 7:48am UTC](https://forum.networklessons.com/t/introduction-to-spanning-tree/853/91 "2017-01-13T07:48:35Z")

</div>

Superb explanation Rene!! Keep it up. 🙂 Thank you!!

---

<div class="post-metadata">

**Author:** ![ragskb](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/r/7cd45c/32.png) [@ragskb](https://forum.networklessons.com/u/ragskb)\
**Post date:** [February 2, 2017, 4:19am UTC](https://forum.networklessons.com/t/introduction-to-spanning-tree/853/92 "2017-02-02T04:19:27Z")

</div>

Hi,

I have a doubt. Let’s take a below simple topology

SwitchA ----- switch B

Switch A - root bridge and it’s port connected to switch B is designated port

Switch B - non root bridge and it’s port connected to switch A is root port

Both switch A and switch B ports are in forwarding state.

when I lowered the bridge priority of switch B then switch B becomes root bridge and switch A is non root bridge

Switch B port connected to switch A is designated port and forwarding state

Switch A port connected to switch B is root port and forwarding state.

Now my question is when both switch A and switch B change its port role due to root bridge re-election because of change in switch B bridge priority what will be the port state of the both switch - forwarding? Listening? blocking? or port role continue to change in forwarding state only?

Previously both switch ports are in forwarding state.

Thanks

Raghu.K

---

<div class="post-metadata">

**Author:** ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)\
**Post date:** [February 3, 2017, 7:06am UTC](https://forum.networklessons.com/t/introduction-to-spanning-tree/853/93 "2017-02-03T07:06:11Z")

</div>

Hello Raghu

I am assuming simple STP is configured on the switches.

Switches send a BPDU to each other every 2 seconds by default. The BPDUs contain the bridge priority and ID. Once you change the priority of Switch B, it’s BPDU will contain a superior bridge priority. Once Switch A receives this BPDU, it will no longer consider itself root bridge, but will see Switch B as root bridge.

For the specific topology that you mention, the ports will remain in the forwarding state. This is because the designated port in Switch B immediately becomes a root port since Switch B itself becomes the root bridge and no change of state is necessary. Secondly, the port on Switch A is directly connected to the root itself so again there is no need for a change of state. If there were additional switches with blocked and designated ports, then those would go through the listening, learning and forwarding (or blocking) states.

I tested this on a couple of switches and both ports remained in the forwarding state.

I hope this has been helpful!

Laz

---

<div class="post-metadata">

**Author:** ![ragskb](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/r/7cd45c/32.png) [@ragskb](https://forum.networklessons.com/u/ragskb)\
**Post date:** [February 3, 2017, 3:34pm UTC](https://forum.networklessons.com/t/introduction-to-spanning-tree/853/94 "2017-02-03T15:34:33Z")

</div>

Thx for your reply.

Let me put another topology

Switch A port 1 ----------------- port 1 switch B  
Port 2 Port 2  
- -  
------- Port 1 switch C port 2 ---------

Switch A mac - A(lowest)  
Switch B mac - B(second lowest)  
Switch C mac - C(third lowest)

All switch inter connecting links are gigabit Ethernet

Switch A is root bridge ,port 1 and 2 is designated and forwarding  
Switch B is non root bridge , port 1 is root(F) and port 2 is designated(F)  
Switch C is non root bridge , port 1 is root(F) and port 2 is alternate(BLK)

Now if I lower switch B bridge priority and make it as root bridge then what happens to all switch port state?

My understanding is

Switch B is root bridge,port 1 change its role from root to designated and port 2 remains unchanged I.e. designated.Port 1 and 2 remains in forwarding state while changing its port role

Switch A is non root bridge,port 1 change its role from designated to root port and port 2 remains unchanged I.e designated.Port 1 and 2 remains in forwarding state while changing its port role

Switch C is non root bridge, port 1 change its role from root to alternate and state from forwarding to blocking and port 2 change its role from alternate to root and state from blocking to listening–\>learning—\>forwarding

Thanks

Raghu.K

---

<div class="post-metadata">

**Author:** ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)\
**Post date:** [February 5, 2017, 1:30pm UTC](https://forum.networklessons.com/t/introduction-to-spanning-tree/853/95 "2017-02-05T13:30:15Z")

</div>

Hello Raghu

So, the first situation as you describe it is the following:

 ![](https://cdn-forum.networklessons.com/uploads/default/original/1X/dee04f60d0adf270e248c1eb09c78b23f22a6447.png)

Then we change the priority of SWB so that it becomes the Root Bridge.

- You are correct about Switch B, that both ports will remain in the forwarding state, but Port 1 will become Designated rather than Root. This is done immediately because there is no alternative. If you are the Root bridge, there is no need to listen for BPDUs to find out what role it will have.
- You are correct about Switch A where Port 1 will change from Designated to Root and will remain in the forwarding state.
- Now Port 2 on Switch A must go into blocking, listening and learning because it does not know whether it or the opposite end will become designated and which will become alternate. They must exchange BPDUs for this to occur.
- You are correct that on Switch C, Port 2 will go from blocking to listening to learning to forwarding and will become a Root port.
- Finally, Port 1 on Switch C must also go into blocking, listening and learning because it does not know whether it or the opposite end will become designated and which will become alternate. They must exchange BPDUs for this to be determined.

I hope this has been helpful!

Laz

---

<div class="post-metadata">

**Author:** ![ragskb](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/r/7cd45c/32.png) [@ragskb](https://forum.networklessons.com/u/ragskb)\
**Post date:** [February 5, 2017, 2:37pm UTC](https://forum.networklessons.com/t/introduction-to-spanning-tree/853/96 "2017-02-05T14:37:59Z")

</div>

Thanks for the clarification.

Raghu.K

---

<div class="post-metadata">

**Author:** ![ragskb](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/r/7cd45c/32.png) [@ragskb](https://forum.networklessons.com/u/ragskb)\
**Post date:** [February 5, 2017, 4:08pm UTC](https://forum.networklessons.com/t/introduction-to-spanning-tree/853/97 "2017-02-05T16:08:25Z")

</div>

Thanks for your reply.

My question now is

Why would switch A port 2 and switch C port 1 goes from forwarding to blocking state?

Why I have put the above question is switch C port 2 is still in listening state with port role as root and it is going to take 30 seconds for that port to go into forwarding state(as we know no frame is forwarded in any of the port state except in forwarding state)

Switch A port 2 and switch C port 1 can continue to stay in forwarding state and elect its port role and change any one of the port in that LAN segment to alternate without any L2 loop - switch C port 2 still in transition phase before start forwarding any L2 frame.

Thanks

Raghu.K

---

<div class="post-metadata">

**Author:** ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)\
**Post date:** [February 5, 2017, 8:20pm UTC](https://forum.networklessons.com/t/introduction-to-spanning-tree/853/98 "2017-02-05T20:20:08Z")

</div>

Hello again Raghu.

Yes, if I understood your explanation correctly, you are correct. I tested it out on a lab topology and this is what I found out:

When Switch B becomes the root bridge, the only ports that go through the process of being blocked–\>listening–\>learning are port 1 and port 2 of Switch C. All other ports remain forwarding, but they change roles. So specifically:

Switch A port 1 goes from **D** to **R** and stays **forwarding**  
Switch A port 2 remains **D** and stays **forwarding**  
Switch B port 1 goes from **R** to **D** and remains **forwarding**  
Switch B port 2 remains **D** and stays **forwarding**  
Switch C port 1 goes through **blocking–\>listening–\>learning** and becomes **B**  
Switch C port 2 goes through **blocking–\>listening–\>learning** and becomes **R**

The reason Switch C ports go through these stages is because:

1. **SWC port 1** has exchanged **BPDUs** with **SWA port 2** and has determined that it should be **B** However, since it is changing its state from R to B, it must go through the transition of **blocking–\>listening–\>learning**
2. **SWC port 2** was originally **B** , so since it detects that the other end of the link has the **root bridge** , this port becomes **R** , but because it was originally **B** , it must go through the stages of transition **blocking–\>listening–\>learning** to become **R**.

To simplify the above explanation, when there is a change of root bridge and new BPDUs are exchanged, ports that don’t change their role based on the new topology DO NOT go through the blocking–\>listening–\>learning states. Ports that change their roles WILL go through the blocking–\>listening–\>learning states to determine those new roles.

I hope this has been helpful!

Laz

---

<div class="post-metadata">

**Author:** ![ragskb](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/r/7cd45c/32.png) [@ragskb](https://forum.networklessons.com/u/ragskb)\
**Post date:** [February 6, 2017, 3:32am UTC](https://forum.networklessons.com/t/introduction-to-spanning-tree/853/99 "2017-02-06T03:32:10Z")

</div>

Thanks for your quick lab testing and confirmation.

I am still confused why switch C port 1 changes its state from forwarding to blocking and then goes to listening,learning and again blocking?

Instead switch C port 1 should have stayed in forwarding state and exchange bpdu’s with switch A port 2,change its role to alternate and move from forwarding to blocking.

As we know there won’t be any loop via switch C because port 2 still in transition phase and it would take 30 more seconds to bring port 2 in forwarding state.

My guess is switch C port 1 should change its state directly from forwarding to blocking and role to alternate after exchanging bpdu’s with switch A

Thanks

Raghu.K

---

<div class="post-metadata">

**Author:** ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)\
**Post date:** [February 6, 2017, 6:38am UTC](https://forum.networklessons.com/t/introduction-to-spanning-tree/853/100 "2017-02-06T06:38:18Z")

</div>

Hello Raghu.

I understand your confusion. Keep in mind that the term “Blocking” can be used as a port role, that is the same as “Alternate” as well as a state “blocking”. Let me try to clarify:

In my previous post, we noted that of the six ports involved in STP, only Port 1 and Port 2 of SWC had a change of ROLE. The other four did not. Since their ROLEs did not change, they didn’t have to go throug the STP algorithm, that is, transitioning from blocking–\> listening → learning etc.

**Since the ports on SWC CHANGED their roles, they must run the STP algorithm, which means, they must transition between the blocking–\> listening → learning states to determine what their final ROLE and STATE will be.**

So:

Port 2 in SWC received new BPDUs that indicate that its ROLE must change. In order to determine that role, the STP algorithm begins to function and the port transitions between the blocking–\> listening → learning STATES where it waits for the default timers in each case until its ROLE is determined as ROOT in a state of FORWARDING.

Port 1 on SWC also received new BPDUs that indicate that its ROLE must change. Again, in order to determine that role, the STP algorithm begins to funciton and the port transitions between the blocking–\> listening → learning STATES where it waits for the default timers in each case until its ROLE is determined as ALTERNATE in a state of BLOCKING.

In other words, **any BPDU that enters a port that indicates that there must be a change of role will initiate the STP algorthim.** This causes the transitioning blocking–\> listening → learning to occur before the new ROLE and STATE are determined.

Keep in mind that all this has to do with simple STP, that is, 802.1D.

I hope this has been helpful!

Laz

[Previous page](https://forum.networklessons.com/t/introduction-to-spanning-tree/853.md?page=4)

[Next page](https://forum.networklessons.com/t/introduction-to-spanning-tree/853.md?page=6)
