While using optic fiber cables,when (transmit or receive) fails we'll have a unidirectional link failure and this can cause spanning tree loops.
One of the methods we can use to solve our unidirectional link failure is to configure LoopGuard. When a switch is sending but not receiving BPDUs on the interface, LoopGuard will place the interface in the loop-inconsistent state and block all traffic!
Switch(config)#Interface fa 0/10
Switch(config-if)#spanning-tree guard loop
Switch(config)#spanning-tree loopguard default
Use the spanning-tree loopguard default command to enable LoopGuard globally.