Posts tagged stp

BCMSN Notes — STP States

I’ve decided to take on the CCNP certification, so I’m going to wind up with a few posts will be more my own notes than anything.  :)

A switch port on a 2960 comes up with a default configuration on VLAN 1.  What happens from the perspective of spanning-tree?

  • First, the port comes up on blocking mode.  This is to make sure that loops aren’t created without first listening to the network to see what’s going on.
  • Next, if the port may be a root or designated port, the port is moved to the listening state.  In this state, the port can send and receives BPDUs only.  It can’t send traffic, but it can discover the other switches participating in STP.
  • After the forwarding delay, the port goes into the learning state.   In this state, the port can send and receive BPDUs as in listening, but it can now receive traffic.  It can’t yet send any.
  • After the forwarding delay again, the port goes into the forwarding state.  The port can now send and receive data.

If the port is configured with spanning-tree portfast, the mode goes from blocking directly to forwarding without going through these steps.  Obviously you don’t want a switch plugged into a port configured for portfast since you may wind up with a loop.

Here’s the debug spanning-tree events output from one of my labs.  F0/3 is configured for portfast.  I shut/no shut it to see what happens.

*Mar  8 18:09:51.163: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down
sw01#
*Mar  8 18:09:51.747: set portid: VLAN0007 Fa0/3: new port id 8003
*Mar  8 18:09:51.747: STP: VLAN0007 Fa0/3 ->jump to forwarding from blocking
sw01#
*Mar  8 18:09:53.739: %LINK-3-UPDOWN: Interface FastEthernet0/3, changed state to up
*Mar  8 18:09:54.739: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up

Notice the “jump to forwarding from blocking”.

Here’s the same output when the port is not in portfast mode.  Notice the timestamps.  It takes about 30 seconds (2 x default foward delay) to go from blocking to listening to learning to forwarding.

*Mar  8 18:13:05.313: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down
sw01#
*Mar  8 18:13:06.013: set portid: VLAN0007 Fa0/3: new port id 8003
*Mar  8 18:13:06.013: STP: VLAN0007 Fa0/3 -> listening
sw01#
*Mar  8 18:13:06.381: %LINK-3-UPDOWN: Interface FastEthernet0/3, changed state to up
*Mar  8 18:13:07.381: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up
sw01#
*Mar  8 18:13:21.013: STP: VLAN0007 Fa0/3 -> learning
sw01#
*Mar  8 18:13:36.013: STP: VLAN0007 Fa0/3 -> forwarding

Send any obvious corrections and questions my way.

Mixed-platform LANs and Spanning Tree

We just an HP C-class blade chassis which included two GbE2c network modules.  These modules are Nortel switches running AlteonOS that connect the blades to the rest of your network.  When I turned these guys up the other day, every VLAN stopped working, so I ran down to the data center and unplugged the uplink.  I called HP and soon found out that the GbE2c doesn’t play nice with Cisco switches out-of-the-box.  Since we have a Cisco network (not now, I guess), we can into some problems.

By default, Cisco runs Per-VLAN Spanning Tree (PVST).  That means that every VLAN on a Cisco switch has its own Spanning Tree (STP) instance.  The Nortels, however, run a single STP instance for all VLANs, so, when I turned up the uplinks, the single STP started talking to all of the PVSTs on the Cisco switches.  The result was not good.  Every VLAN converged over and over simultaneously, totally locking up the network.

When we got that fixed and the uplinks were working, I found another problem — every switch in the network decided that the Nortels were the root bridges.  While this is not a show-stopper, it can prove to be a problem since the root bridge is used by STP to decide where the center of the network is.  It turns out that the GbE2c has a default priority of 32768 (which is the 802.1d standard) and advertise themselves as that.  Cisco switches actually add the VLAN ID to the priority on the PVST, so the Nortels always wind up with the lowest priority.  These things are absolute pieces of crap, so that’s not a good thing.  I had to take an outage and reduce the priority of two of our core Cisco switches to make everything right.

Moral of the story:  Be careful when you have a mixed-platform LAN environment since competing problems don’t always (read: never) play nice.