#

Sunday, December 17, 2017

How RSTP Reacts to Direct & Indirect Failures and Topology Changes

In Rapid Spanning-Tree (RSTP);

1. Direct link failures are handled by the best Alternate Port becoming a new Root Port
2. Indirect link failures are handled by accepting inferior BPDUs from Designated Switches
3. Adding a new Root Link is handled by the Sync Operation
4. Change over of a new Root Switch is handled by the combination of above..

Only a transition of a Non-Edge Port from Non-Forwarding state to Forwarding state is considered a topology change event in RSTP.

When a topology change is detected RSTP switches immediately flood BPDUs with TC flag set. Switches which detect a topology change on its port or learned about a topology change will;

1. Set a tcWhile Timer to the value of a Hello Time plus 1 second on all remaining Non-Edge Designated Ports & Root Port (if any) except the port which the topology change was detected or learned..
2. Immediately flush all MAC addresses learned on these ports..
3. Send BPDUs with the TC flag set on these ports every Hello seconds until the tcWhile Timer expires..

Direct Link Failures

Direct link failure is a failure of the Root Port of a switch which maintains an Alternate Port.

In the topology, you can see that SW-C is the switch we are talking about.

What happens when the e0/2 of SW-C goes down is that RSTP will simply compare the remaining BPDUs on Alternate Ports and choose the port with the superior BPDU as the new Root Port and will immediately become Root-Forwarding..

Indirect Link Failures

Indirect link failure is a failure of the Root Port of a switch which does not maintain an Alternate Port. In the topology, you can see that SW-B is the switch we are talking about.

What happens when the e0/1 of SW-B goes down is that the SW-B thinks that it is the Root Switch now and send inferior BPDUs towards SW-C and they will be accepted right away from SW-C expiring the old superior BPDU stored on his e0/3 port and recalculates the superiority for that segment. Once SW-C identifies its own BPDU as the superior BPDU on the segment, it will declare its port as a new Designated-Forwarding Port from Non-Designated-Discarding state..

Once SW-B receives the superior BPDU from SW-C it will change its e0/3 from Designated-Forwarding to Root-Designating state..

Here is a video for above 2 incidents..



Passive Link / Reachability Failure

In a very rare case, for some reason if a switch does not receive 3 sequential Hellos in a row, it will think the link with the neighbor is down.. Then what it sets the port to Designated-Discarding 1st and starts transmitting Proposals. Even though it does not receive any Agreement for 2 Forward Delay times (fdWhile) it will change the port state to Designated-Forwarding. This 2 times Forward Delay is the time it takes to go through regular Discarding > Learning > Forwarding process.

We can experience this by enabling BPDU Filter on e0/3 port of SW-2 on above diagram.

Before enabling BPDU Filter on SW-2, the show spanning-tree output of SW-3 will be like the following..












After enabling BPDU Filter on SW-2's e0/3 interface, output of the debug spanning-tree events will be like the following..

















Then you can see the final port roles and states on show spanning-tree output..













When the BPDU Filter is disabled, a superior BPDU will update the roles back immediately.


No comments:

Post a Comment