cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
10344
Views
15
Helpful
11
Replies

STP port state

nnn_sss22
Level 1
Level 1

Hello

When switch will bootup. it will goes to the blocking state or Listening state?

11 Replies 11

Moses Fernandes
Level 1
Level 1

Hello,

STP is a industry standard. So every OME has to follow the standard rules.

STP switch port states:

  • Blocking - A port that would cause a switching loop if it were active. No user data is sent or received over a blocking port, but it may go into forwarding mode if the other links in use fail and the spanning tree algorithm determines the port may transition to the forwarding state. BPDU data is still received in blocking state. Prevents the use of looped paths.
  • Listening - The switch processes BPDUs and awaits possible new information that would cause it to return to the blocking state. It does not populate the MAC address table and it does not forward frames.
  • Learning - While the port does not yet forward frames it does learn source addresses from frames received and adds them to the filtering database (switching database). It populates the MAC address table, but does not forward frames.
  • Forwarding - A port receiving and sending data, normal operation. STP still monitors incoming BPDUs that would indicate it should return to the blocking state to prevent a loop.
  • Disabled - Not strictly part of STP, a network administrator can manually disable a port

https://en.wikipedia.org/wiki/Spanning_Tree_Protocol

If a suggestion helps you mark it answered.It will help others too....

Regards,

Moses.

Hello

Thanks for your reply.

I know about STP Port States. But my question is.... When switch will bootup. it will goes to the blocking state or Listening state?

Hi,

Good question - The ports will be originally in a BLK state to prevent loops in the network as upon bring up we have no idea of the topology. Here's an example output that demonstrates this behavior immediately after reloading a switch:

Switch# show system uptime
System start time: Sun Jul 30 14:53:59 2017 << Shows bring up time
System uptime: 0 days, 0 hours, 2 minutes, 27 seconds
Kernel uptime: 0 days, 0 hours, 3 minutes, 37 seconds

Looking at VLAN 2374 for this example:

Switch# sh spanning-tree internal event-history tree 2374 int e1/1
VDC01 VLAN2374 <Ethernet1/1>
0) Transition at 345652 usecs after Sun Jul 30 14:54:38 2017 
State: DIS Role: Unkw Age: 0 Inc: no [STP_PORT_EV_UP]

1) Transition at 346253 usecs after Sun Jul 30 14:54:38 2017
State: DIS Role: Desg Age: 0 Inc: no [STP_PORT_ROLE_CHANGE]

2) Transition at 346704 usecs after Sun Jul 30 14:54:38 2017
State: BLK Role: Desg Age: 0 Inc: no [STP_PORT_STATE_CHANGE]

3) Transition at 163463 usecs after Sun Jul 30 14:54:53 2017
State: LRN Role: Desg Age: 0 Inc: no [STP_PORT_STATE_CHANGE]

4) Transition at 670740 usecs after Sun Jul 30 14:55:07 2017
State: FWD Role: Desg Age: 0 Inc: no [STP_PORT_STATE_CHANGE]

Final State:

Switch# show span vlan 2374

VLAN2374
Spanning tree enabled protocol rstp
Root ID Priority 35142
Address 00fe.c80e.2715
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 35142 (priority 32768 sys-id-ext 2374)
Address 00fe.c80e.2715
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Eth1/1 Desg FWD 2 128.1 P2p <<< 

Hope this helps.

- Andrea

- Andrea, CCIE #56739 R&S

Hello

I heard in some video lectures, when we attach computer with switch port then. It will skip blocking state and it will take 30 seconds.

In some videos i heard when we bootup the switch then all port will goes to blocking port first.

I am confuse .

Regards

Hi,

On boot up or when you attach a computer to a switchport, the port will be Disabled and then Blocking - Once the Forward Delay timer expires, the port enters the learning state. When the Forward Delay timer expires a second time, the port is transitioned to the forwarding or blocking state. This is where the 30 seconds comes from.
When you enable PortFast on a switch or trunk port, the port is immediately transitioned to the spanning tree forwarding state making the transition much faster - This is only for host ports where you are certain a switch will not be connected.

Here's an example when I connect my laptop to a switchport:

+ Connecting my laptop to Eth4/1 - I have the port shutdown to illustrate the entire process:

Switch# sh int e4/1
Ethernet4/1 is down (Administratively down)

+ Immediately as I "no shut" this port to simulate a linkup:

Switch# sh span int e4/1

Vlan Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
VLAN0012 Desg BLK 2000 128.513 P2p

+ 15 seconds later:

Switch# sh span int e4/1

Vlan Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
VLAN0012 Desg LRN 2000 128.513 P2p

+ 15 seconds later:

Switch# sh span int e4/1

Vlan Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
VLAN0012 Desg FWD 2000 128.513 P2p

+ Verification:

Switch# show spanning-tree internal event-history tree 12 interface e4/1
VDC02 VLAN0012 <Ethernet4/1>
0) Transition at 52998 usecs after Sun Jul 30 13:49:11 2017
State: DIS Role: Unkw Age: 0 Inc: no [STP_PORT_EV_UP]

1) Transition at 53998 usecs after Sun Jul 30 13:49:11 2017
State: DIS Role: Desg Age: 0 Inc: no [STP_PORT_ROLE_CHANGE]

2) Transition at 54998 usecs after Sun Jul 30 13:49:11 2017
State: BLK Role: Desg Age: 0 Inc: no [STP_PORT_STATE_CHANGE]

3) Transition at 819998 usecs after Sun Jul 30 13:49:25 2017
State: LRN Role: Desg Age: 0 Inc: no [STP_PORT_STATE_CHANGE]

4) Transition at 820998 usecs after Sun Jul 30 13:49:40 2017
State: FWD Role: Desg Age: 0 Inc: no [STP_PORT_STATE_CHANGE]

Hope that clarifies it a bit better. 

- Andrea

- Andrea, CCIE #56739 R&S

hi

Why listen state skipped ?

if first state is blocking state then total delay time should be 50 Sec.

Hi there,

 

That would be because Listening state is not part of Rapid-STP which is the STP mode my switch is running.

 

There are only three port states left in RSTP that correspond to the three possible operational states. The 802.1D disabled, blocking, and listening states are merged into a unique 802.1w discarding state.

 

More on this here:

https://www.cisco.com/c/en/us/support/docs/lan-switching/spanning-tree-protocol/24062-146.html#anc3

 

Thanks!

- Andrea, CCIE #56739 R&S

gmati-nesrine
Level 1
Level 1

Hi, 

Please can a port from learning state go to blocking state ?

Hello gmati,

yes in traditional STP ( not rapid)  the port can go from learning to blocking state.

In traditional STP listening and learning states are transitory states each one has duration of Forward Delay timer (default 15 seconds)

Rapid STP introduces roles and states and also the handshake of proposed role with the neighbor switch.

In point to point inter switch links with Rapid STP the negotiation is performed via handshake and ports can move to forwarding state (Designated port or root port) or to Alternate Blocking or other without the need to wait for Forward Delay timer to expire two times.

 

Hope to help

Giuseppe

 

Thank you Giuseppe Larosa

Hi,

Another question why in RSTP they moved listening state not both listening and learning state ?

 

thank you 

Review Cisco Networking for a $25 gift card