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 ?
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.
Hi Rene,
Please clear following doubts of spanning tree.
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.
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.
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.
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.
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
shantel
(Shantel - Networklessons.com)
Split this topic
90
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.
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.
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
So, the first situation as you describe it is the following:
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.
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.
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:
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
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.
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
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.