Saturday 1 November 2014

Rapid Spanning Tree Protocol (RSTP), Rapid Per-VLAN Spanning Tree Plus (RPVST+)

IEEE 802.1w  Rapid Spanning Tree Protocol (RSTP) enhances the 802.1D standard with one goal in mind: improving STP convergence. 802.1w RSTP defines only Discarding, Learning, and Forwarding states.


Even a Discarding port, similarly to the Blocking state in legacy STP, continues to process received BPDUs; send BPDUs (depending on its role); and send and receive frames of inter-switch signaling protocols such as DTP, VTP, CDP, LLDP, PAgP, LACP, or LOOP.

RSTP decouples the state of the port from its purpose, or a  role , in a topology, and defines four separate port roles:
   -Root Port (maintains its usual meaning)  
   -Designated Port (maintains its usual meaning)  
   -Alternate Port (a prospective replacement for the switch’s own Root Port). Alternate Ports are ports receiving BPDUs from other switches but not meeting requirements to become Root or Designated. Such a port is attached to a neighboring switch and provides a possible alternate path toward the root. Upon the loss of the current
Root Port, the Alternate Port receiving the best resulting BPDUs will be rapidly promoted to the role of Root Port and moved to the Forwarding state.  
   -Backup Port (a prospective replacement for the switch’s own Designated Port into a shared segment).

Alternate Port concept offers protection against the loss of a switch’s Root Port, also called a  direct link failure.
Backup port is attached to the same link as another port on the same switch, but the other port is Designated for that segment. The Backup Port is ready to take over if the DP fails; however, this takeover is not rapid. Rather, it is driven by timers. As Proposals are not sent on ports connected to shared links, there is no way of safely moving a Backup Port to Designated rapidly. (proposals are sent only on point to point link)

In RSTP, ports have types : A port can be either an Edge(access port) or a Non-Edge port. An Edge Port immediately becomes Designated Forwarding after coming up. It still sends BPDUs but it expects not to receive any. Should a BPDU be received by an Edge port, this port will revert to the Non-Edge type and start operating as a common RSTP port.

RSTP recognizes two link types - (1)Point-to-point link: A link that connects an RSTP switch to at most one neighboring RSTP switch. (2)Shared link: A link that connects an RSTP switch to two or more neighboring switches (a bit rare nowadays).

In RSTP, the default port role and port state are Designated Discarding—this is the combination of roles and states applied to a port at the moment it becomes live. The default port type is Non-Edge. The default link type depends on the duplex mode of the port—for full-duplex, it is point-to-point; for half-duplex, it is shared.   

Some improvements of RSTP over STP

In RSTP, there is only a single type of BPDU used both for building a loop-free topology and for topology change notification purposes. TCN BPDUs are not used by RSTP.

In STP, Configuration BPDUs are originated by the root switch only. A nonroot switch does not originate its own Configuration BPDUs; rather, it waits for a BPDU to arrive on its Root Port(causes delay)to relay it farther out its own Designated Ports after updating its contents . In RSTP, each switch originates BPDUs on  its own, with their contents nevertheless based on the information from the BPDU stored on the switch’s Root Port. If a switch ceases to receive RSTP BPDUs on its port, it is certain that the problem is contained on the link between this switch and its neighbor. This allows RSTP switches to age out BPDUs much sooner—in a 3x Hello interval.

In STP, if a designated switch suddenly started sending BPDUs that are inferior to the BPDUs sent earlier, remaining switches on the segment would ignore them until the superior BPDU expired from their ports, which is after MessageAge-MaxAge seconds. In RSTP, an inferior BPDU originated by a designated switch on a segment is accepted right away, immediately replacing previously stored BPDUs on receiving ports of attached switches,and reevaluate their own port roles and states on the segment according to usual rules. This behavior allows a switch to rapidly react to a situation where the neighboring switch experiences a disruptive change in its own connectivity toward the root switch (this is called an  indirect link failure ). 

Proposal/Agreement Process in RSTP

A connectivity disruption can also be caused by adding a new link into the topology that causes one of the switches to reelect its Root Port and place it on the added link
RSTP uses the Proposal/Agreement process on a point-to-point link to rapidly put such a link into operation without causing a temporary switching loop or significant interruptions in the communication. The Proposal signifies the willingness of a port to become Designated Forwarding, while the Agreement stands for permission(from neighbor switch) to do so immediately.
  
Non-Edge Designated ports include those ports that have moved from old Root and Alternate roles to Designated after a superior resulting BPDU was received on the new 
Root Port and the switch reevaluated the roles of all ports.

After a new link point-to-point link is added between two switches, ports on both ends will come up as Designated Discarding. Any Designated Port in a Discarding or Learning state sends BPDUs with the Proposal bit set. When a switch receives a superior BPDU on its port(Designated discarding),its role changes to Root(discarding) and immediately put all its non-edge designated ports (expecting to be designated ports) into a discarding state. This operation is called Sync. A switch in Sync state is now isolated from the network, preventing any switching loop from passing through it: Its Root Port is still in the Discarding state and its own Designated Ports are intentionally moved to the Discarding state. Now it is safe to move the new Root Port to the Forwarding state and inform the upstream switch that it is now allowed to move its Designated Discarding or Learning port to the Forwarding state. This is accomplished by a switch sending a BPDU with the Agreement bit set (or simply an Agreement) through its Root Port after performing the Sync. 

During the Proposal/Agreement exchange, all Non-Edge Designated ports will be moved to Discarding state (the Sync operation). If ports toward end hosts are not explicitly configured as Edge ports(portfast), these ports will require twice the ForwardDelay interval to become Forwarding again, and the end hosts will experience major connectivity outages.

RSTP Reaction mechanisms for Outages in a Switched Network

Outages in a switched network can be caused by direct link failures (a switch losing its Root Port), indirect link failures (a neighbor losing its Root Port), adding a new root link, or a root switch changeover. RSTP has reaction mechanisms for each of these events: Direct link failures are handled by the best Alternate Port becoming a new Root Port, indirect link failures are handled by the concept of accepting inferior BPDUs from designated switches, adding a new root link is handled by the Proposal/Agreement mechanism, and the changeover of a root switch is handled by the combination of the mechanisms above.

Topology Change Handling in RSTP   

Only a transition of a Non-Edge port from a non-Forward-ing state to the Forwarding state is considered a topology change event in RSTP. 
Instead of forwarding the information about a topology change using TCN BPDUs in a hop-by-hop fashion to the root switch and causing the root switch to send BPDUs with the TC flag set, RSTP switches immediately flood BPDUs with TC flag set. More precisely, a switch that  detects  a topology change on a port (that is, one of its own Non-Edge ports transitions into the Forwarding state) or learns about a topology change on a port (a BPDU with the TC flag set is received on its Root or Designated Port) will
   -Set a so-called tcWhile timer to the value of the Hello time plus one second (older revisions of RSTP set this value to twice the Hello time) on all remaining Non-Edge 
Designated ports and Root Port if any, except the port on which the topology change was detected or learned.   
   -Immediately flush all MAC addresses learned on these ports.   
   -Send BPDUs with the TC flag set on these ports every Hello seconds until the tcWhile timer expires.    
It causes switches to immediately flush their CAM tables for all ports except those ports on which the topology change was detected or learned.

Rapid Per-VLAN Spanning Tree Plus (RPVST+)  

RPVST+ is a form of running RSTP on a per-VLAN basis, analogous to PVST+. In global configuration mode, issue the spanning-tree mode rapid-pvst command. Most RSTP improvements are applicable only on point-to-point links. show spanning-tree. If the link is truly point-to-point, the link type can be overridden using the  spanning-tree link-type point-to-point  interface level command.

For RSTP and consequently RPVST+ to provide rapid reaction to changes in the network topology, all switches must run RSTP or RPVST+, all inter-switch links must be properly installed and recognized as point-to-point links, and all ports toward end stations must be properly identified as edge ports.On shared links, RSTP and RPVST+ revert to timers.

No comments:

Post a Comment