3-R&S/Spanning Tree Protocol (STP), RSTP Part 3.

Let’s continue the STP explanation at the previous two posts 1-R&S/Virtual LAN (VLAN) and Spanning Tree Protocol (STP) and 2-R&S/Spanning Tree Protocol (STP) Part 2., in this post i will mention Rapid Spanning Tree (RSTP) and some configurations and verification commands related to RSTP, and i will mention MST in the next post.

Rapid Spanning Tree (RSTP) IEEE 802.1w:

The RSTP is considered as the improvement protocol for the IEEE 802.1d which is the first Spanning Tree Protocol mentioned at the previous two posts. It is an IEEE standard 802.1w, this means that this improvement is developed by IEEE, hence it can be implemented by any vendor. The improvements provided by RSTP is related to the STP convergence process, which helps in increasing the STP convergence speed than that it is provided by the first version STP, as well the operation of the RSTP itself is modified and is much more different than the normal STP.

Before we talk about the new operation provided by RSTP, we need first to know the modifications RSTP need to make regarding  the port roles and states, as well it added another characteristics for the port which is the port type, so let’s see what is new regarding the port characteristics:

1-Port States:

STP define 5 port states, Disabled, Blocking, Listening, Learning and Forwarding, while RSTP needs to make some modifications related to the port states by reducing the number of port states to only three states, Discarding, Learning and Forwarding.  1-Discarding state: indicates that the port is discarding all the frames either needed to be sent or received at the port and don’t learn MAC addresses as well, at which this port maybe shutdown, not connected or blocked by the RSTP process itself, this means that regardless of the reason of discarding, the switch should not send or receive frames at this port. Discarded port still receive BPDU and process it, and we can say that the Discarding port is similar to the Blocking port at the case of STP. Once the port become live in the network, it is immediately put in the Discarding state as this is the default state for the newly alive ports (except for the ports where hosts are connected and this port is called by “Edge port” from RSTP terminology point of view).
2-Learning state: it is exactly the same as the learning state used by the normal STP protocol at which the port at this state normally learn MAC addresses to be ready to finally transit to the Forwarding state.
3-Forwarding state: it is exactly the same as the Forwarding state used by the normal STP protocol at which the port at this state normally send and receive frames without any issue. The port is put in this state as long as the STP domain is stable or fully converged, this means that this port is always in the Forwarding state as long as no changes happened in this STP domain.

So we can say that the Discarding state can do the same functionality as Disabled, Blocking and Listening states, because the RSTP needs to reduce the no. of port transitions as no need for all these transit states, as the main purpose of the port is either discarding the sent and received frames or  normally forwarding and accepting the frames without any issues, so no need for these transit states.

2-Port Roles:

1-Root Port: it is exactly the same as the Root port definition at the normal STP, which is considered as the best port to reach the Root Bridge (i.e it has the lowest cost to reach the Root Bridge).
2-Designated port: it is exactly the same as the designated port definition at the normal STP, which indicates that this local Switch is the designated bridge in this link/segment between these two switches participating in this link/segment, so the switch that has the superior BPDU is considered as the Designated switch/bridge, hence its port has the Designated role.
3-Alternate Port: it is exactly the same as the Alternate port definition at the normal STP, which is the port with the second best port to reach the Root Bridge (i.e it has the next lowest cost to reach the Root Bridge), this means that if Root port failed for any possible reason, this alternate port become the new Root port as right now (after the Root port failure) has the best path to reach the Root bridge. The following figure shows the meaning of the Alternate port:

alt

4-Backup Port: This port is considered as the second best port in a shared link/segment connecting multiple switches with each others, at which this local switch is connected to this shared link/segment by multiple ports, at which one of them is elected as Designated and the other can’t be at designated as well because of this shared link/segment, and those switches are connected with each others via shared network (via Hub), this means that this port (that can’t be designated) is considered as the backup port for the designated port of this local switch in this shared link/segment. The following figure shows the meaning of the Backup port:

backup

We found in the previous figure that there are three switches Switch1, Switch2 and Switch3 are connected with each others via Hub which is considered as the Shared segment, Switch1 is connected to this shared link/segment via two ports (Eth0/0 and Eth0/1), so when Switch1 send its own configuration BPDU out Eth0/0 toward the Hub, then the Hub will send it out all the ports, so Switch1 received its configuration BPDU from the Hub on Eth0/1, so Switch1 compares the two configuration BPDUs of Eth0/0 and Eth0/1, it found that both BPDUs have the same (Root Bridge ID, Root Path Cost and Sender Bridge ID), but they are different in the Sender Port ID, at which the Port ID of Eth0/0 is 128.1 while Port ID of Eth0/1 is 128.2, for this reason Switch1 found that Port ID of Eth0/0 is better than of Eth0/1, hence it put Eth0/0 in Designated role, while put Eth0/1 in Backup role, while Eth0/2 of Switch2 and Eth0/3 of Switch3 are Root Ports as Switch1 is the Root Bridge. In case the failure of the port Eth0/0 (current Designated port), the second port Eth0/1 should be changed from Backup to designated but the state of this port pass over all the states, this means that it will not transit directly from Discarding to Forwarding, instead it transit form Discarding to Learning and then to Forwarding and this is because of the shared link/segment, at which the switch can’t use the rapid convergence provided by the RSTP (i will explain later) because it is not safe at all to use it at shared link/segment as it can result in loop because of misbehavior.

3-Port Types:

The Port Type is used by RSTP to define the type of the port participating in the RSTP process and it has two types:
1-Edge port: This type indicates that the switchport is connected to an Edge non-STP capable device, which means that this device is not generating BPDUs and is not supporting any protocol/modes of Spanning tree, at which this device maybe PC, Laptop, Server,… for this reason this port must be put in the Designated/Forwarding as no reason at all to put it in Discarding state as it will not affect in the RSTP election process, hence it will not affect the RSTP topology and it is safe to put it immediately in Designated/Forwarding without running any sort of processing or sending and waiting for any timers to determine the role/state of this port. This Edge port is considered as Host port which means that this port is connected to host and for sure it is not running any protocol/mode of Spanning Tree and it is exactly equivalent to the PortFast feature provide by the normal STP that immediately put this port in Designated/Forwarding.
2-Non-Edge port: This type indicates that the switchport is not connected to Edge device, hence it is connected to normal STP-capable switch, for this reason it must run the normal RSTP process on this port to determine the role/state of this port.

4-Link Types:

The link type is used by RSTP to define what is the type of the link participating in the RSTP process that is connecting this switch to the other switch(es), the RSTP determine the type of link based on the duplex settings of this port, RSTP define two link types:
1-Shared Link: This link indicates that the switch is connected to shared link/segment, which means that this switch is connected to multiple switches over the same link/segment, so they seem connected with each others using Hub that acts as Shared link/segment and as we know the Hub ca operate only with Half duplex, for this reason the switch know that this link should be treated as Shared because of the half duplex settings negotiated with the Hub, for this reason the RSTP set the link type to be Shared if the switch negotiates half duplex with the directly connected device. RSTP process can’t be run on this link as the normal RSTP process needs point-to-point link to be able to provide the improvements for the convergence speed and because this link is shared, they can’t rapidly negotiate which one has the better BPDU.
2-Point-to-Point link: This link indicates that the switch is connected to point-to-point link/segment, which means that this switch is connected to single switch over this link/segment, so the switch treat this link to be Point-to-Point because of the Full duplex settings negotiated with the directly connected switch, for this reason the RSTP set the link type to be Point-to-Point if the switch negotiates Full duplex with the directly connected device. RSTP process can be run normally on this link as the RSTP process can work only on point-to-point link for the negotiation process to work correctly, hence we can make use of the improvement of convergence speed provided by the RSTP at this link type.

As mentioned before at the STP explanation, there are two types of BPDUs (configuration and Topology change) at which the configuration BDPU is used normally for two purposes, exchanged between the directly connected switches to determine which one is the designated switch (i.e the switch that is closest to the Root bridge) that has the superior BPDU, as well used to maintain this superior BPDU on the port receiving this BPDU, while the topology change BPDU is used by the Root bridge to notify all the switches about changes happened in the STP domain. RSTP use only one type of BPDUs, which is called by Rapid  Spanning Tree BPDU “RST BPDU” and use it for the two purposes, the following figure shows the RST BPDU format and explain its fields/components:

rst bpdu

1-Protocol Identifier: This field indicates the identity of the STP protocol and has value of 0x0000.
2-Protocol Version: This fields indicates the version of the STP protocol, and at this case it indicates that the version of the Spanning Tree Protocol is Rapid Spanning Tree (RSTP) and has value of  02.
3-BPDU Type: This field indicates the type of this BPDU and at the case of RSTP it support only BPDU called by RST BPDU and has value of 02.
4-Flags: This field indicates certain option related to this BPDU and it has length of 8 bits, and at RSTP 802.1w, it uses 7 bits out of these 8 bits, at which it doesn’t use the TCA bit as no need for Acknowledging the topology change as used with STP 802.1d, the Flags field consists of the following bits:
a-Topology Change Acknowledge bit/flag: and as i mentioned, it is not used by the RSTP.
b-Agreement bit: This bit/flag is used by the Proposal/Agreement process that i will explain later.
c-Forwarding bit/flag: This bit/flag is used to give an indication about the frame forwarding state of the sending port, if this bit/flag is set to 1, this means that this port forward the frames normally on this sending port.
d-Learning bit/flag: This bit/flag is used to give an indication about the source MAC address learning state on the sending port, if this bit/flag is set to 1, this means that this port is learning source MAC addresses on this sending port.
e-Port role bits/flags: These two bits/flags are used to give an indication about the port role, Root, Designated,…
f-Topology Change bit/flag: This bit/flag is used to give an indication about the topology change.
5-Root Bridge ID: This field is used to carry the Root bridge ID.
6-Root Path Cost: This field indicates the cost of the path used to reach the Root Bridge by the sender of this message.
7-Sending Bridge ID: This field indicates the Bridge ID of the sender of this message.
8-Sending Port ID: This filed indicates the Port ID of the exit port that this sender send this message out, the Port ID consists of two parts (Port priority + Port number), the Port number is H/W value and can’t be changed.
9-Message Age: This filed indicates the age of the BPDU message in the STP domain starting from its generation from the Root bridge till this sender switch.
10-Max Age: This filed indicates the maximum age the switch can wait before it consider that the superior BPDU that is generated by the Root Bridge expired. (Superior BPDU means the best BPDU the switch see, which indicates the BPDU generated by the Root Bridge), its default value is 20 seconds.
11-Hello time: This field indicates the periodic interval for sending the BPDU message, this means that the Root Bridge send the BPDU message every this hello interval, its default value is 2 seconds.
12-Forward Delay: This field indicates certain transition timer that it use to transit from one state to another as mentioned in the previous posts.

At STP 802.1d, the non-root switches didn’t send their own configuration BPDU at the converged layer 2 switched network, instead once they received the superior configuration BPDU from the root bridge on their root ports, update some required fields then they forward/relay this superior configuration BPDU out their designated ports toward the downstream switches, while at the case of RSTP 802.1w, every switch (root and non-root) send its own RST BPDU out the designated ports, but the information carried inside these BPDUs must be get from the superior BPDU received from the root bridge on the root port so that these BPDUs are still superior. The RST BPDUs are sent ever hello interval (default 2 seconds) exactly as with STP 802.1d, but these BPDUs are used as hello mechanism exactly as the used with the well-known routing protocols, at which the designated switch send its own RST BPDU out its designated ports every 2 seconds, but if the non-designated switch didn’t receive 3 RST BPDUs in a row (i.e within 3×2 seconds = 6 seconds), it should consider that the designated switch has an issue, this means that this non-designated switch is 100% sure that the issue exits either at the designated switch itself or at the link between them, hence it immediately expires this RST BPDU as it is 100% sure about where the issue exists, while at the case of normal STP 802.1d, if non-designated switch didn’t receive the superior configuration BPDU within certain interval (Max Age – Message Age seconds),  so this BPDU is expired, and this non-designated switch know that there is an issue exist between this switch and the root bridge, but still can’t determine where exactly the issue exists either at the root bridge itself, link between root bridge and the designated switch or at the designated switch itself,.. and so on, so it is not 100% sure of any reason that can cause this issue.

Proposal/Agreement:

As mentioned before, RSTP provides some modifications regarding the convergence speed, and this can be handled  by the proposal/agreement mechanism, so let’s describe this mechanism.

For the RSTP to work correctly, it should be run on point-to-point link/segment and can’t be run on shared link/segment as mentioned before that the shared link/segment consists of multiple switches with each others via any form of shared connection (via Hub) and for this reason RSTP can’t run its rapid negotiation among multiple switches at the same link/segment. Proposal/Agreement mechanism is used by the RSTP for the purpose of rapidly put the point-to-point link between only two switches in stable/converged state with no loop as quick as possible as well with minimum outage as can as possible. Stable/converged means that it is either carrying traffic or not without forming loop, i mean that each point-to-point link consists of two switches, one of them is designated and the other is non-designated, at which the non-designated may put its port either on forwarding or blocking state (stable no transition state) and this is based on its calculations, at which this port maybe Alternate, Backup or Root port, so the link should carry traffic or not based on the port’s role/state of the non-designated switch, this means that if the role/state is Root/Forwarding, the link should carry traffic normally, while if the role/state is either Alternate/Discarding or Backup/Discarding, the link should block the traffic. Let’s see the following figure to show what i mean:

rstp-stable

In the previous figure we can see that there are 5 links in this layer 2 switched network, and all the 5 links are stable/converged with no loop, three of them are stable in forwarding state (as these three links are considered as the root path for the three switches Switch2, 3 and 4) and carrying traffic, while the other two are stable in blocking state to avoid forming loop in this Layer2 switched network and don’t carry traffic during stable condition.

Let’s talk about how the RSTP works ?

Assume the following figure that represents the layer2 switched network that we will use to explain the RSTP operation:

rstp1

In the previous figure we can see that there are 8 switches forming this layer 2 switched network and based on the physical connections we can deduce that if no STP is running in the network, this for sure results in layer 2 loop, so here we need to run RSTP to know how the RSTP works so that it can provide the improvements for the STP convergence. Switch1 is designed to be the Root bridge within this STP domain, for this reason we need to start the RSTP process explanation from Switch1 till the end of the topology to simplify the explanation and process as can as possible. Let’s see the following figure to explain what happen in sequence regarding the RSTP operation (step by step):

rstp2

 

1-(Switch1 and Switch2), (Switch1 and Switch3) and (Switch1 and Switch4) exchanged with each others RST BPDU with proposal flag is set to 1 at which each switch considers itself as the Root bridge and it is willing to put this sender port in designated/Forwarding , each switch put its on bridge ID at both Root Bridge and Sender Bridge ID fields, at the moment, all these ports are Designated/Discarding. The following figure shows the RST BPDU exchanged between Switch1 and Switch2 (RST BPDUs exchanged between Switch1 and Switch3, and Swicth1 and Switch4 are the same, so no need to mention them):

  • RST BPDU with proposal flag set to 1 originated by Switch1:rstp 1-2
  • RST BPDU with proposal flag set to 1 originated by Switch2:rstp 2-1

2-Switch2, Switch3 and Switch4 found that the RST BPDUs received from Switch1 (that is configured to act as Root Bridge) on their interfaces Eth0/1, Eth0/0 and Egth0/3 respectively are the superior RST BPDUs, hence they make these ports as Root Port as these ports have the best path to reach the Root bridge (Switch1), but still these ports are in Discarding state.
3-Because the three switches decided to make the ports connected to Switch1 to be Root Port, so these Root Port must be put in the Forwarding state, and before this happened, the switch must use certain method to avoid loop that can temporarily happen, so the three switches need to block or put all the non-designated ports in Discarding state to be sure that there is no loop can happen, this process/method is called by “Sync”.
4- It is safe now for Switche2, Switch3 and Switch4 to put their Root Ports into Forwarding state, as well they need to tell Switch1 that its safe as well to put its ports Eth0/1, Eth0/0 and Eth0/3 in Designated/Forwarding, so Switch2, Switch3 and Switch4 send the same RST BPDU with Agreement flag set to 1 to tell Switch1 that they agree about the proposed RST BPDU from Switch1 and tell it that it is safe to put its ports in Designated/Forwarding. The following figure shows the RST BPDU with Agreement flag set to 1 sent by Switch2 to Switch1 (RST BPDU sent by Switch2 and Switch3 are the same but no need to mention them here):

rstp 2-1 agreement

5-Once Switch1 received the RST BPDUs with Agreement flag set to 1 from the three switches, it put the three ports in Designated/Forwarding, hence the Proposal/Agreement process finished between the 4 switches.

Let’s continue the other part of the topology:

rstp3

 

1-(Switch2 and Switch3), (Switch3 and Switch4), (Switch2 and Switch5), (Switch2 and Switch6) and (Switch3 and Switch7) exchanged with each others RST BPDU with proposal flag is set to 1 at which Switch5, Switch6 and Switch7 consider themselves as the Root bridge and they are willing to put these sender ports in designated/Forwarding, while Switch2, Switch3 and Switch4 send the superior RST BPDU received from Switch1 , and each switch put its own bridge ID at both Root Bridge and Sender Bridge ID fields except for Switch2, Switch3 and Switch4, at the moment, all these ports are Designated/Discarding and this is the default behavior for the new ports become live in the network. The following figure shows the RST BPDU exchanged between Switch2 and Switch5 (RST BPDUs exchanged between other switches are the same, so no need to mention them):

  • RST BPDU with proposal flag set to 1 originated by Switch2:rstp 2-5
  • RST BPDU with proposal flag set to 1 originated by Switch5:rstp 5-2

2-Switch5, Switch6 and Switch7 found that the RST BPDUs received from Switch2 and Switch3 on their interfaces Eth0/0, Eth1/0 and Eth1/1 respectively are the superior RST BPDUs, hence they make these ports as Root Port as these ports have the best path to reach the Root bridge (Switch1), but still these ports are in Discarding state.
3-Because the three switches decided to make the ports connected to Switch2 and Switch3 to be Root Port, so these Root Port must be put in the Forwarding state, and before this happened, the switch must use certain method to avoid loop that can temporarily happen, so the three switches need to block or put all the non-designated ports in Discarding state to be sure that there is no loop can happen, this process/method is called by “Sync” as mentioned before.
4- It is safe now for Switche5, Switch6 and Switch7 to put their Root Ports into Forwarding state, as well they need to tell Switch2 and Switch3 that they are safe as well to put their ports Eth0/0, Eth1/0 and Eth1/1 in Designated/Forwarding, so Switch5, Switch6 and Switch7 send the same RST BPDU with Agreement flag set to 1 to tell Switch2 and Switch3 that they agree about the proposed RST BPDU and tell them that they are safe to put their ports in Designated/Forwarding. The following figure shows the RST BPDU with Agreement flag set to 1 sent by Switch5 to Switch2 (RST BPDU sent by Switch6 and Switch7 are the same but no need to mention them here):

rstp 5-2 agreement

5-Once Switch2 and Switch3 received the RST BPDUs with Agreement flag set to 1 from the three switches, they put the three ports in Designated/Forwarding, hence the Proposal/Agreement process finished between the 5 switches.
6-After the proposal/Agreement process finished, (Switch3 and Switch5), (Switch3 and Switch6), (Switch4 and Switch6), (Switch4 and Switch7) and (Switch6 and Switch8) exchanged with each others RST BPDU with proposal flag is set to 1  as in step 1, 1 at which Switch8 considers itself as the Root bridge and it is willing to put its sender port in designated/Forwarding, while Switch6 send the superior RST BPDU received from Switch2 , and each switch put its own bridge ID at both Root Bridge and Sender Bridge ID fields except for Switch2 at the moment, all these ports are Designated/Discarding and this is the default behavior for the new ports become live in the network. Once Switch5, Switch6 and Switch7 received the RST BPDU from Switch3 and Switch4 the found that they are better than the RST BPDUs sent by them toward Switch3 and Switch4, but still these RST BPDUs are not better than what they received from Switch2 and Switch3 on the other ports (current Root Ports), so simply put these ports in Alternate/Discarding and don’t respond with any message. The following figure shows the RST BPDU exchanged between Switch6 and Switch8 (RST BPDUs exchanged between other switches are the same, so no need to mention them):

  • RST BPDU with proposal flag set to 1 originated by Switch6:rstp 6-8
  • RST BPDU with proposal flag set to 1 originated by Switch8:rstp 8-6

7-As Switch8 has no any non-edge ports, so the “Sync” process is not run as the loop can’t result at this situation, so it is safe now for Switche8 to put its Root Port into Forwarding state, as well it needs to tell Switch6 that it is safe to put its port Eth0/0 in Designated/Forwarding, so Switch8 send the same RST BPDU with Agreement flag set to 1 to tell Switch6 that it agree about the proposed RST BPDU and tell it that it is safe to put its port in Designated/Forwarding. The following figure shows the RST BPDU with Agreement flag set to 1 sent by Switch8 to Switch6:

rstp 8-6 agreement

 

What about the changes happen in the RSTP domain ?

The RSTP should have certain criteria that handle/deal with the changes that can happen in its domain, so what is the meaning of changes from RSTP point of view ?
Actually RSTP has only one event that can be considered as change event, this happen when non-edge port transit from Discarding to Forwarding state, simple because when this non-edge port transit from Discarding to Forwarding, this means that another port transit from Forwarding to Discarding either lost connection to the Root bridge via this old Root port, or maybe this port has an issue from physical point of view, there are many MAC addresses are known via this old Root port, for this reason the switch must flush or age out all the MAC address leaned on this old Root port so that it can be learned via another port or this new Root port. While if one port transit from Discarding to Forwarding, this means that this port either to be Root port or Designated port, so if it is a Root port, this means that another Alternate/Discarding port become  Root/Forwarding (in case of the existence of another uplink port) so we return again to the first event (non-edge port transit from Discarding to Forwarding), but if this failed port is Designated, this means that the MAC addresses known via this port for sure no longer reachable anymore even if the RSTP hanlde this situation as well, so no need to cause or force the other switches to flush or age out the MAC addresses as this will result in many unknown unicast flooding to happen without any reachability and will utilize the links BWs without any progress, for this reason only one event is considered as a change event from RSTP point of view.

When there is a change happened and detected by a switch running STP, the switch send TCN BPDU and send it toward the Root bridge out the Root port, then the upstream switch reply by sending TCA BPDU to the sending switch, then forward/relay it toward its Root bridge out its Root port and so on, until the Root bridge received this TCN BPDU, it reply by sending TCA BPDU message to its downstream switch, then it will send TC BPDU message out all the designated port so that this change notification reach all the switches within this STP domain. RSTP use different criteria to notify the switches about the detected change, once a switch detect the change event i mentioned before, the switch will flush the MAC addresses learned on the non-edge ports from the CAM table, then send RST BPDUs with Topology Change (TC) flag set to 1 and send it out all its non-edge ports every 1 second for certain timer called by Topology Change (TC) while timer which is equal to Hello Timer + 1 second, this means that if the Hello Timer is 3 seconds, this means that the TC while timer = 3+1 = 4 seconds, so the switch will send the RST BPDU with TC flag set to 1 every 1 second for 4 seconds, this means that it will send 4 RST BPDU with TC flag set to 1, when switch receive this RTS BPDU (i.e RST BPDU with TC flag set to 1), it will flush the MAC addresses learned on all the non-edge ports from the CAM table  except for the port where the RST BPDU with TC flag set to 1 is received, then itself forward/relay the RST BPDU with TC flag set to 1 out all its non-edge ports (again except for the port where the BPDU is received), so why the switches that received the RST BPDU with TC flag set to 1 flush the MAC addresses learned from the other ports ?? as the port where the BPDU is received represents the new port that become in Forwarding state, for this reason the MAC addresses that was previously learned from another ports are now should be reachable through this port. The following figure shows the concept of how the RSTP switches handle the topology change:

rstp 5

1-Port Eth0/1 which is the current Root port at Switch5 failed and it is for sure detected by Switch5 but Switch2 didn’t detect it for some reason.
2-Port Eth1/0 is an Alternate port, so Switch5 failover on this port and it become the new Root port, previously this port was Alternate/Discarding but now it become Root/Forwarding, then it flush the MAC addresses known via this failed port in the CAM table.
3-Because the port transit from Discarding to Forwarding, this means that the change event is matched now, so Switch5 send RST BPDU with TC flag set to 1 out this new root port to Switch3. The following figure shows the RST BPDU with TC flags set to 1 sent by Switch5 to Switch3:

rstp tc3

4-Switch3 will forward this RST BPDU with TC flag set to 1 out Eth0/0 and Eth1/1 to Switch1 and Switch7 respectively, and flush the MAC addresses learned from the non-edge ports except for Eth1/0. The following figure shows the RST BPDU with TC flags set to 1 sent by Switch3 to Switch1 and Switch7:

rstp tc4

5-Switch1 will forward this RST BPDU with TC flag set to 1 out Eth0/1 and Eth0/3to Switch2 and Switch4 respectively, and flush the MAC addresses learned from the non-edge ports except for Eth0/0. The following figure shows the RST BPDU with TC flags set to 1 sent by Switch1 to Switch2 and Switch4:

rstp tc5

6-Switch2 will forward this RSt BPDU with TC flag set to 1 out Eth1/0, then flush the MAC addresses learned from the non-edge ports except for Eth0/1, as well Switch4 flush the MAC addresses learned from the non-edge ports. The following figure shows the RST BPDU with TC flags set to 1 sent by Switch2 to Switch6:

rstp tc6

So before the change, when Desktop1 need to communicate with either Desktop2, PC2 or Server2, the traffic take the path (Switch6 —> Switch2 —> Switch5 —> to Destination), but once the port Eth0/0 failed and detected by Switch2, then this topology change is flooded through the RSTP domain, then the Switches flush their CAM table as mentioned before, so the traffic will take the following path (Switch6 —> Switch2 —> Switch1 —> Switch3 —> Switch5 —> to Destination).

 

As mentioned with STP, it has PVST+ which represents Per VLAN Spanning Tree, this means that the switch create multiple STP instance/process (one instance/process per VLAN), RSTP exactly has the same concept as it has Rapid Per VLAN Spanning Tree Plus (RPVST+), which exactly has the same concept as PVST+, so no need to mention the same concept here.

Finally, we can say that the RSTP make huge modifications regarding the STP convergence speed, at which it improved the following:
1-The time required to detect the direct link failure, at which if the Switch no longer receive the RST BPDU  from the designated switch in this link/segment within 3XHello interval seconds, so it consider this RST BPDU to be expired, this means that if we are working with he default timers, the switch detect that there is direct link failure on the Designated switch after 3X2 seconds (i.e after 6 seconds).
2-The time required to detect indirect link failure, at which if the switch no longer receive the superior RST BPDU from the designated switch in this link/segment that was previously received from the same designated switch, and now start to receive inferior BPDU, and from this situation we can deduce that this designated switch no longer connected to the Root bridge, so it start to consider itself as the new Root bridge, so once the switch receive this inferior RST BPDU, it accept it and immediately expire the previously stored superior RST BPDU, and send immediately its superior RST BPDU to this designated switch so that it rapidly detect that the old Root bridge still reachable.
3-The time required to make the ports between switches or connected to hosts operational as fast as possible and this is done using the negotiation mechanism used between the switches that are connected with each others using point-to-point links, sos that the RSTP can do its magic using the Proposal/Agreement mechanism in addition to the “Sync” process that prevent forming the loop while the RSTP is doing its magic.

RSTP Basic Configurations:

You can configure RPVST+ as the RSTP mode using the following command:

Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#spanning-tree mode rapid-pvst

You can verify that the switch is running RSTP using the following command:

Switch#show spanning-tree

VLAN0001
 Spanning tree enabled protocol rstp
 Root ID Priority 32769
 Address aabb.cc00.1a00
 This bridge is the root
 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
 Address aabb.cc00.1a00
 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
 Aging Time 0 sec

Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0 Desg FWD 100 128.1 Shr 
Et0/2 Desg FWD 100 128.3 Shr 
Et1/0 Desg FWD 100 128.5 Shr

You can configure the link type to be either “shared” or “point-to-point” using the following commands:

Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#interface Ethernet0/1 
Switch(config-if)#spanning-tree link-type shared
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#interface Ethernet0/1 
Switch(config-if)#spanning-tree link-type point-to-point

You can verify that the link type is either “shared” or “point-to-point” using the following command:

Switch#show spanning-tree interface Ethernet0/0 detail 
 Port 1 (Ethernet0/0) of VLAN0001 is designated forwarding 
 Port path cost 100, Port priority 128, Port Identifier 128.1.
 Designated root has priority 32769, address aabb.cc00.1a00
 Designated bridge has priority 32769, address aabb.cc00.1a00
 Designated port id is 128.1, designated path cost 0
 Timers: message age 0, forward delay 0, hold 0
 Number of transitions to forwarding state: 1
 Link type is shared
 BPDU: sent 147, received 8
Switch#show spanning-tree interface Ethernet0/0 detail 
 Port 1 (Ethernet0/0) of VLAN0001 is designated forwarding 
 Port path cost 100, Port priority 128, Port Identifier 128.1.
 Designated root has priority 32769, address aabb.cc00.1a00
 Designated bridge has priority 32769, address aabb.cc00.1a00
 Designated port id is 128.1, designated path cost 0
 Timers: message age 0, forward delay 0, hold 0
 Number of transitions to forwarding state: 1
 Link type is point-to-point
 BPDU: sent 179, received 0

You can configure the port as Edge port by enabling the PortFast feature either per-interface or globally:

Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config-if)#interface Ethernet0/0
Switch(config-if)#spanning-tree portfast 
%Warning: portfast should only be enabled on ports connected to a single
 host. Connecting hubs, concentrators, switches, bridges, etc... to this
 interface when portfast is enabled, can cause temporary bridging loops.
 Use with CAUTION

%Portfast has been configured on Ethernet0/0 but will only
 have effect when the interface is in a non-trunking mode.
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#spanning-tree portfast default 
%Warning: this command enables portfast by default on all interfaces. You
 should now disable portfast explicitly on switched ports leading to hubs,
 switches and bridges as they may create temporary bridging loops.

 

I will talk about the MST in the next post.

Hope that the post is helpful.

Regards

Mostafa Hamza

2 thoughts on “3-R&S/Spanning Tree Protocol (STP), RSTP Part 3.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s