So now that we’ve talked all about STP all in my last couple posts, we are still not done lol. STP has been upgraded to RSTP which stands for Rapid Spanning Tree Protocol. This basically functions the same as STP meaning it prevents layer 2 loops while providing redundant back paths, but the difference in RSTP is the speed of convergence. Instead of the long 15 second listening and 15s learning state for a port to reach forwarding that 30 to 50 seconds have been cut into just a couple seconds. This counts for when RSTP first gets enabled, and when a topology change occurs, either one the convergence time is in literal seconds.
Proposal and Agreement- How does RSTP cut that convergence to a crazy quick amount? Well there is a feature in RSTP that is called a “proposal-agreement handshake.” As soon as RSTP is enabled on all the switches in the topology, exchange BPDUs like normal and choose the root bridge. Once the root bridge is elected, the root port is then selected and is selected the same way as STP. The root port is chosen by having the lowest cost to the root bridge, and the tie breaker is the neighbors bridge ID is lower, and after the lowest neighbor port ID. Once that happens, instead of timers when a switch determines that a port is supposed to be a designated port, it will send a proposal to the neighboring switch. The neighboring switch will receive that proposal and perform a synchronization operation, during this synchronization operation it blocks all non edge ports, and it will calculate whether the port that the switch is requesting to forward will cause a loop or not. If it causes a loop, no BPDU will be sent. If the switch determines during the synchronization process that it won’t cause a loop, it will send an agreement BPDU and once the switch receives that agreement BPDU the port will transition into forwarding. This whole sequence happens in a matter of a couple events because it does not have to wait for any timer. It is important to note that the proposal agreement flags are in the same BPDUs that are regularly sent, and not in a unique own BPDU.
Discarding- Now what about convergence? RSTP replaces blocked ports with discarding ports such as alternate and backup. In order to talk about those port roles I need to break down the different states that RSTP has. STP has blocking, listening, learning, and forwarding states. RSTP has combined blocking and listening into one state called discarding. During this state it will operate just like the blocking state and essentially be doing the same thing listening for BPDUs but not forwarding any user data. This state differs from blocking because on top of listening for BPDUs, it also sends BPDUs to speed up the convergence process. The list of states is RSTP is discarding, learning, and forwarding.
Alternate Port- An alternate port is a discarding state in RSTP. This port is essentially the backup port to the root port, so if the root port were to fail for any reason this port would take over that port immediately. RSTP is not timer based like STP was, RSTP has decided as soon as the topology converged that this port is the second best option for the root port and knows that it being activated when the root port goes down will not form a loop. This turns a 50 second reconvergence into a couple second convergence. An alternate port is receiving superior BPDUs from the neighboring switchport. In RSTP, every switch generates BPDUs as opposed to STP where only the root bridge sends BPDUs.
Backup Port- A backup port is also a discarding state, and is not used much in modern networks but has its place when there are redundant interfaces connected to the same segment. You will find backup ports where two interfaces are connected to the same segment(link) as an ethernet hub. Because the interfaces are redundant on the same segment, it makes no sense for both to be in a forwarding state, so the port that receives superior BPDUs from the redundant port on the same switch becomes the backup port. This will be the standby port that will immediately take over the designated port if it were to ever go down for any reason. Functioning the same as an alternate port, it will not go through any forward delay timers, as it was chosen as the second best port to forward traffic trusting that it being up when the designated port fails will not cause any loop.
Edge Ports- What about portfast? RSTP has completely removed the need for portfast. There are different types of ports in an STP topology and they are shared, point-to-point, and edge ports. End devices are usually connected to edge ports and RSTP automatically transitions edge ports into forwarding allowing them to receive time-critical services such as DHCP. This is a built-in feature of RSTP and there is no need to install portfast but the switch will need to have ports configured as edge ports to know which port is which. Edge ports replace portfast altogether, so instead of configuring “spanning tree portfast” you configure an edge port.
Leave a Reply