Switching

Expand all | Collapse all

What is the STP learning state for?

  • 1.  What is the STP learning state for?

     
    Posted 01-24-2021 00:27
    Hi.

    I have a question about the STP port's learning state.

    In STP, ports in both the 'listening' and 'learning' states listen to and transmit BPDUs.

    But what exactly is the 'learning' port learning? MAC addresses? Is it receiving traffic even before moving to the 'forwarding' state?

    Thanks, 
    Deepak


  • 2.  RE: What is the STP learning state for?

    Posted 01-24-2021 01:52
    The old spanning tree (802.1D) used several states:
    • blocking
    • listening
    • learning
    • forwarding

    During the blocking phase, it would look at the BPDUs that it's receiving, and work out what the port role should be. That is, should this port be root, designated, or blocking? It takes 20s to move through this state (by default).

    In listening, the switch would wait and see if the network is stable. That is, are there changes happening? Are there any TCN's? It will wait 15s to make sure the topology is stable.

    While learning, the switch is just doing what switches do. It's listening to regular traffic, looking a MAC addresses, and build the MAC table. That's another 15s.

    Finally, it (may) move into the forwarding state and start passing traffic.


    The problem with this is the time it takes to forward traffic. That's 50 seconds, which is far too long!
    Notice how I said 'old spanning tree' earlier? That's basically the original 802.1D (originally from 1990, revised in 1998).

    A new type of spanning tree was released to deal with this. This was Rapid Spanning Tree (RSTP); 802.1w.
    This is the default version of spanning tree on Juniper switches.

    The blocking and listening states no longer exist. They have been replaced with the 'discarding' state. 
    The learning and forwarding states still exist, and act as normal.

    The other big change here is that there's no timers for these states anymore. Now switches will use BPDUs to negotiate (or 'sync') information and decide the state of a port.
    This dramatically improves convergence times.


    TLDR:
    The learning state does receive traffic, and uses it to learn MACs. However, the port is not forwarding traffic in this state.


  • 3.  RE: What is the STP learning state for?

     
    Posted 01-24-2021 02:09
    Hi Luke.

    Thanks for your reply.

    You mention:
    "While learning, the switch is just doing what switches do. It's listening to regular traffic, looking a MAC addresses, and build the MAC table."

    But a 'learning' port shouldn't be receiving traffic, should it?

    Thanks,
    Deepak



  • 4.  RE: What is the STP learning state for?

     
    Posted 01-25-2021 10:11
    Traffic is being received (not dropped), just not forwarded. 

    Regards, 


    ------------------------------
    Yasmin Lara
    Juniper Ambassador
    JNCIE-SP, JNCIE-ENT, JNCIE-DC, JNCIE-SEC
    JNCDS-DC, JNCIA-DevOps, JNCIP-CLOUD, CCNP-ENT
    ------------------------------