Wednesday, August 7, 2013

STP port transitions - I missed these somehow

Not sure how I missed this info in my last post, but it's important none the less.

Because STP is designed to remove switching loops while providing a redundant topology for the network, it needs a means to adjust port state if a failure occurs.  Spanning Tree goes through some transitional port states to move a port from blocking to forwarding, and each has a timer to keep the network from unnecessary loops during topology update.

The transition process and states of a port in a Spanning-Tree topology:

  1. Disabled - either administratively or due to security violation.  No data sent
  2. Blocking - no user data sent, but listening for BPDUs.  This state will wait 20 seconds before transitioning to the next state.  The 20 second timer is known as the max-age timer.  In essence, the switch needs to miss 10 BPDUs (2 seconds each) before it will transition
  3. Listening - no user data sent, listening for and forwarding BPDUs with topology updates.  This lasts 15 seconds
  4. Learning - no user data sent yet.  Adding MAC addresses it receives to the CAM table and building root path.  A port will take 15 seconds on this state as well.
  5. Forwarding - normal operation, user data sent
Based on this information, STP can take up to 50 seconds for a network to converge.  In small networks, these forward-delay timers can be manually set to quicken convergence.

When a nonroot switch recieves a BPDU indicating a topology change, it sends a special BPDU back to the root bridge called a Topology Change Notification, or TCN.  This is one of the only times a BPDU does not originate from the root bridge.  Once received, the root bridge will alert the other switches to start expiring their MAC address tables 8 times faster than the normal 300 seconds and to rebuild the root paths.

 The max-age and forward-delay timers are configured based on a network diameter of 7 switches.  The network diameter is the number of switches between any two hosts on the network.  If you have a small network diameter, such as 2 switches, these timers can be adjusted to lower values to speed convergence, however, when the network grows (like it always does) you will need to reconfigure these timers on the root bridge and the information will propagate to the rest of the network from there.

No comments:

Post a Comment