Whenever you have an RSTP-enabled switch connected to a client, a classic STP switch, or just anything that doesn’t run RSTP (therefore it cannot complete the Proposal-Agreement synchronization mechanism, the switch will operate that port under Classic STP rules. So it will spend 15 seconds in the Discarding state and 15 seconds in the Learning state before transitioning to forwarding.
RSTP(config)#do debug spanning-tree events
Spanning Tree event debugging is on
RSTP(config)#interface G0/0
RSTP(config-if)#no shutdown
*Aug 21 11:51:51.664: %LINK-3-UPDOWN: Interface GigabitEthernet0/0, changed state to up
*Aug 21 11:51:52.664: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up
Aug 21 11:51:52.821: RSTP(1): initializing port Gi0/0
*Aug 21 11:51:52.825: RSTP(1): transmitting a proposal on Gi0/0
*Aug 21 11:51:53.351: RSTP(1): transmitting a proposal on Gi0/0
.... after a while
*Aug 21 11:52:07.822: RSTP(1): Gi0/0 fdwhile Expired - 15 seconds have passed
*Aug 21 11:52:19.413: RSTP(1): transmitting a proposal on Gi0/0
*Aug 21 11:52:21.417: RSTP(1): transmitting a proposal on Gi0/0
*Aug 21 11:52:22.823: RSTP(1): Gi0/0 fdwhile Expired - 30 seconds have passed
*Aug 21 11:52:22.824: STP[1]: Generating TC trap for port GigabitEthernet0/0
THE PORT IS FORWARDING
Notice how the port, upon being enabled, starts the synchronization process which never finishes because the client isn’t running RSTP. So 15 seconds pass, another 15 seconds pass, and then the port starts forwarding which are basically classic STP’s rules. Although the debug output is a little unclear when it comes to that, so I’ve marked the important points for you.
The solution? When you connect to a client, enable PortFast so the port can instantly transition into forwarding.
RSTP(config)#interface G0/0
RSTP(config-if)#spanning-tree portfast trunk
RSTP(config-if)#no shutdown
*Aug 21 11:55:07.159: %LINK-3-UPDOWN: Interface GigabitEthernet0/0, changed state to up
*Aug 21 11:55:08.159: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up
*Aug 21 11:55:08.316: RSTP(1): initializing port Gi0/0
*Aug 21 11:55:08.316: RSTP(1): Gi0/0 is now designated
THE PORT IS INSTANTLY FORWARDING
I’m not sure what you are asking. Typically, you shouldn’t connect a device like a PC onto a trunk port, regardless of what type of STP is running. If the trunk port is configured statically, there will most likely be connectivity problems on the PC itself.
End devices like PCs, printers, IP phones, cameras and others should be connected to access ports that are configured with portfast or as edge ports in RSTP. If you do that, then as soon as you connect the PC it will immediately enter the forwarding state.
If you have further questions, or if you would like to clarify your question, feel free to respond!
I tried to reproduce the same scenario, as well, but in my case the port is getting designated very shortly after I bring up the port:
SW(config-if)#do sh run int gi0/2
Building configuration...
Current configuration : 115 bytes
!
interface GigabitEthernet0/2
switchport trunk encapsulation dot1q
switchport mode trunk
negotiation auto
end
SW(config-if)#no shut
*Aug 6 21:40:39.981: %LINK-3-UPDOWN: Interface GigabitEthernet0/2, changed state to up
*Aug 6 21:40:40.981: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to up
*Aug 6 21:40:41.212: RSTP(1): initializing port Gi0/2
*Aug 6 21:40:41.212: RSTP(1): Gi0/2 is now designated
*Aug 6 21:40:41.221: RSTP(1): transmitting a proposal on Gi0/2
*Aug 6 21:40:41.651: RSTP(1): transmitting a proposal on Gi0/2
*Aug 6 21:40:43.662: RSTP(1): transmitting a proposal on Gi0/2
*Aug 6 21:40:45.668: RSTP(1): transmitting a proposal on Gi0/2
*Aug 6 21:40:47.675: RSTP(1): transmitting a proposal on Gi0/2
*Aug 6 21:40:49.684: RSTP(1): transmitting a proposal on Gi0/2
*Aug 6 21:40:51.690: RSTP(1): transmitting a proposal on Gi0/2
*Aug 6 21:40:53.698: RSTP(1): transmitting a proposal on Gi0/2
*Aug 6 21:40:55.704: RSTP(1): transmitting a proposal on Gi0/2
*Aug 6 21:40:56.213: RSTP(1): Gi0/2 fdwhile Expired
*Aug 6 21:40:57.719: RSTP(1): transmitting a proposal on Gi0/2
*Aug 6 21:40:59.729: RSTP(1): transmitting a proposal on Gi0/2
*Aug 6 21:41:01.739: RSTP(1): transmitting a proposal on Gi0/2
*Aug 6 21:41:03.750: RSTP(1): transmitting a proposal on Gi0/2
*Aug 6 21:41:05.761: RSTP(1): transmitting a proposal on Gi0/2
*Aug 6 21:41:07.771: RSTP(1): transmitting a proposal on Gi0/2
*Aug 6 21:41:09.780: RSTP(1): transmitting a proposal on Gi0/2
*Aug 6 21:41:11.219: RSTP(1): Gi0/2 fdwhile Expired
*Aug 6 21:41:11.224: STP[1]: Generating TC trap for port GigabitEthernet0/2
The PortFast is not activated. How come the port in my case has become designated so quickly? I have used CML, too.
Remember that Designated is just a port role. This doesn’t necessarily mean that the port is always forwarding data.
The port role is determined in the discarding state. If the port role is alternate/backup, the port remains in discarding. If the port role is designated/root, it still has to transition through discarding and learning in your scenario (if the proposal-agreement mechanism fails) in order to be able to forward data.