Spanning-Tree LoopGuard and UDLD

Hello Matt

Loopguard will only kick in if a switch is able to send BPDUs on a link (i.e. the link appears up) but doesn’t receive any BPDUs (i.e. the incoming link from the neighboring switch is down). Now in classic STP, only the root bridge generates BPDUs. So how does a switch differentiate between a unidirectional link and a failed root bridge? Take a look at this topology.

If SW1 in the above topology failed (i.e. the root bridge), a new root bridge would be elected. So before SW3 can detect a lack of incoming BPDUs, a new root bridge would be selected, and BPDU generation would resume.

Now this is not an issue when we talk about RSTP since each switch generates its own BPDUs, so loopguard’s function is independent of the state of the root bridge. Does that make sense?

I hope this has been helpful!

Laz

Hello. I don’t quite understand this explanation:

If one of the cables (transmit or receive) fails we’ll have a unidirectional link failure and this can cause spanning tree loops.

If one of the cables goes down, shouldn’t both switches experience a link failure? This means that they would both be unable to either transmit or receive which wouldn’t cause loops. Or are we talking specifically about errors on the interfaces/SFP modules where the link state remains up/up?

David

Hello David

This is a good question, and leads us into a deeper understanding of how fiber links with SFPs work. A fiber connection using an SFP transceiver (or any type of transceiver for that matter), typically uses two fiber strands, one for Tx and one for Rx. This arrangement can increase the probability of a unidirectional link in the event that one of the two fiber strands is cut or fails in some way.

In the past, the operation of the Tx and Rx of such a link was quite independent, and if one fiber failed, the other would continue to function, greatly increasing the probability of a unidirectional link failure resulting in an L2 loop.

Now most modern transceivers have mechanisms in place that can detect such a failure and will consider the link down even if one of the two strands is still operational. But even such mechanisms may take several seconds to kick in due to the nature of fiber optics, and there may be a period of time where the link still appears to be up/up even though one fiber has failed.

It is for these types of scenarios that LoopGuard and UDLD are needed and should be in place, especially in high-speed mission-critical core networks. Does that make sense?

I hope this has been helpful!

Laz

Hello Team,

The UDLD frame is just like another L2 frame, unlike the BPDU. With UDLD frames, an alternate port can respond and send UDLD keepalive frames, isn’t it ?.

Hello Sathish

Yes, you’re correct. UDLD frames aren’t like BPDUs. UDLD is a Layer 2 protocol that works with the Layer 1 infrastructure to determine whether a link is bidirectional.

As for your question, yes, an alternate port can respond to and send UDLD frames. When UDLD is enabled on a port, the port transmits UDLD frames containing its device and port IDs to its neighboring device. These frames are echoed back to the port and if the port does not receive its own device and port IDs for a specific duration of time, the port can go into err-disable state or it can be considered as “undetermined”.

This mechanism helps in detecting unidirectional links to avoid loops in the network. It’s important to note that UDLD is not a replacement for STP, but a complementary technology.

I hope this has been helpful!

Laz