Loop
Protection
4.1 Context
On the network shown in the preceding figure, SW1 is the root bridge. GE0/0/23
on SW3 is a non-designated port and listens to BPDUs sent from SW2 though the
port in Discarding state.
GE0/0/23 on SW3 cannot receive BPDUs from SW2 due to a unidirectional link
failure between SW2 and SW3. In this case, SW3 considers that SW2 is faulty and
performs STP recalculation. According to STP recalculation, GE0/0/23 becomes a
designated port and transitions to the Forwarding state. In this case, a loop
occurs since packets can be sent from SW3 to SW2.
4.2 Basic Concepts
Normally, the root port and the port in Discarding state receive BPDUs. When
the ports fail to receive BPDUs due to a unidirectional link failure, STP
recalculation is performed. The root port becomes a designated port and the
port in Discarding state transitions to the Forwarding state. As a result, a
loop occurs.
After loop protection is enabled on the root port, if the role of the root port
changes, for example, the root port becomes a designated port, the port is
blocked, that is, the port transitions to the Discarding state until it
receives new BPDUs.
After loop protection is enabled on a blocked port, the port remains in
Discarding state even if it is elected as a designated port.
In MSTP, this function can be configured only on the root port, alternate port,
and backup port.
4.3 Configuration Example 1
(Enable Loop Protection on the Root Port)
· Without loop protection enabled
After STP converges, GE0/0/22 on SW3 is elected as the root port and GE0/0/23
is elected as a designated port in Discarding state.
Disable STP on GE0/0/22 of SW1 to simulate a unidirectional link failure. As a
result, SW3 cannot receive BPDUs from GE0/0/22 of SW1.
After STP converges again, GE0/0/23 of SW3 becomes the root port and GE0/0/22
becomes a designated port. In this case, a loop occurs.
· With loop protection enabled
Enable loop protection on
GE0/0/22 of SW3.
SW3 performs STP recalculation. GE0/0/23 becomes the root port, and GE0/0/22
becomes a designated port. Since GE0/0/22 is enabled with loop protection, the
port remains in Discarding state even though it is a designated port. This
situation prevents a loop.
4.4 Configuration Example 2
(Enable Loop Protection on a Designated Port)
This example enables loop protection on a designated port, as shown in the
preceding figure.
If a unidirectional link failure occurs between SW2 and SW3, SW3 cannot receive
BPDUs from GE0/0/23. Therefore, SW3 performs STP recalculation. According to
STP recalculation, GE0/0/23 becomes a designated port but remains in Discarding
state since it is enabled with loop protection. This prevents a loop.
To learn more:
Enhancing STP and Configuring STP Protection Functions part 1
Enhancing STP and Configuring STP Protection Functions part 2
Enhancing STP and Configuring STP Protection Functions part 3