A couple more things for spanning tree. Just to recap, STP is the mechanism by which we prevent switching loops on switches. Not much of an issue with small switch networks but important on larger switch networks.
We saw in previous posts that when STP needs to bring up a link that is in blocking mode, it can take almost a minute to complete that reconfiguration. This is where RSTP or Rapid Spanning Tree Protocol comes in.
Rapid Spanning Tree Protocol
Rapid STP (802.1w) is a variation of 802.1d, the STP. So why rapid? Well the basic concept is the same with a root bridge election, but the port roles are different, and the operation is slightly different.
Each switch on the network, connects to the root device, with the lowest port cost connection. This is the Root Port, just like STP, and the root switch ports connected will be designated ports.
But there is a third and fourth type of port, the alternate port, and the backup port. The only time we will see a backup port is when we have more than one connection to a single network segment.
Port Type STP RSPT Root x x Designated x x Alternative x Backup x Edge x P2P x
So what makes it Rapid?
In spanning tree protocol, when a topology change is detected, it takes three missing hello packets to trigger STP (at 2 seconds per packet) and the port(s) must go through the 15 seconds of listening and 15 seconds of learning.
In RSTP, the stp states, disabled, blocking and listening are combined into a new state – discarding.
STP: Disabled > Blocking > Listening > Learning > Forwarding RSTP: discarding > Learning > Forwarding
You’ll notice the port type table also referenced edge ports and P2P (point to point) ports, which are also new port types for RSTP.
Edge ports are ports on the edge of the network. Most often these are ports for hosts. Now in STP, when a port moves into forwarding mode, it triggered an STP recalculation, and for many ports this was unnecessary, after all if one has just connected or disconnected a host, no recalculation is necessary. RSTP recognizes this by ignoring edge ports.
Point to point ports are any port connected to another switch and is running in full duplex mode.
BPDUs are handled differently as well. With STP, the root bridge generates a BPDU every two seconds, and the non root devices forward that BPDU, but in RSTP, every switch generates a BPDU every two seconds. … and this is where the rapid part comes in.
In STP, when the switches have not received 3 BPDUs from the root (6 seconds) the max age time starts (20 seconds) and at the end of that cycle, the link info is aged out and recalculation starts, followed by learning and listening (30 seconds). With RSTP, if three hello packets have not been received, the link information is immediately aged out (6 seconds) and the switches start the recalculations. This is what makes it rapid – 26 seconds in STP verses 6 seconds in RSTP.
Per VLAN STP
Per VLAN spanning tree is the version of STP we usually run, often abbreviated to PVST. In fact my 2950 switches run this version of spanning tree by default as can be seen from the start up config:
! spanning-tree mode pvst no spanning-tree optimize bpdu transmission spanning-tree extend system-id !
We can use some of the features of PVST to create load balancing when we have multiple links between two switches. We could create an etherchannel as well, but its good to know alternative methods.
Usually when we have multiple single links between switches, STP will put all but one of the ports on the non root switch into blocking mode, which means all VLAN traffic is crossing a single link.
If we go into the interface config, we can change the cost per vlan to force STP to pass that VLAN traffic through a non default link. When this happens, the port concerned becomes the root for for that VLAN (or range of VLANs) only.