Skip to content

UDLD

UDLD (Unidirectional Link Detection) is a Layer 2 protocol that monitors the physical configuration of fiber optic and twisted-pair Ethernet links to detect unidirectional communication failures that can cause network loops, forwarding issues, and connectivity problems invisible to standard link-state mechanisms. It operates by exchanging periodic messages between directly connected devices to verify bidirectional connectivity, supporting both normal mode for detection and reporting, and aggressive mode for automatic recovery by error-disabling problematic ports. UDLD is essential for maintaining network stability in fiber optic deployments where physical layer failures can result in one-way communication, preventing spanning tree loops and ensuring reliable network operations in mission-critical environments.

Diagram
NameTypeConstraintMandatoryDefault Value
udldClass[udld]No

NameTypeConstraintMandatoryDefault Value
aggressiveBooleantrue, falseNo
enableBooleantrue, falseNo
message_timeIntegermin: 1, max: 90No
recovery_intervalIntegermin: 30, max: 86400No

By detecting unidirectional links, UDLD prevents network loops and forwarding issues, ensuring reliable bidirectional communication on Ethernet interfaces.

Key Components:

  • Global Enable/Disable (enable): Turns UDLD on or off globally for all supported interfaces.

  • Aggressive Mode (aggressive): Enables aggressive mode globally or per interface, allowing automatic error-disable and recovery for unidirectional links.

  • Message Interval (message_time): Sets the interval (in seconds) for UDLD messages exchanged between devices.

  • Recovery Interval (recovery_interval): Specifies the time (in seconds) after which error-disabled ports are re-enabled.

  • Interface-Specific Configuration (interface, port_aggressive, port_enable): Allows UDLD settings to be applied to individual interfaces.

Key Parameters Briefly Explained:

  • enable: Globally enables UDLD.
  • aggressive: Enables aggressive mode for automatic recovery.
  • message_time: Sets the UDLD message interval.
  • recovery_interval: Sets the recovery interval for error-disabled ports.
  • interface, port_aggressive, port_enable: Configures UDLD per interface.

You can use these UDLD parameters to detect and prevent unidirectional link failures in your network. Customize the mode, message interval, and recovery settings to fit your network’s stability requirements and operational needs, especially in fiber optic environments. Adjusting these parameters lets you tailor link monitoring and automatic recovery for enhanced network resilience.

The following configuration describes how to set up UDLD on a Cisco IOS-XE device. It includes global enabling, aggressive mode, message time, recovery interval, and per-interface configuration for robust unidirectional link detection.

udld enable
udld aggressive
udld message time 15
udld recovery interval 300
!
interface GigabitEthernet0/1
udld port aggressive
!
interface GigabitEthernet0/2
udld port enable

The following YAML code sets up UDLD on an IOS-XE device, specifying global aggressive mode, enabling UDLD, setting the message time, and configuring the recovery interval.

iosxe:
devices:
- name: Device1
configuration:
udld:
aggressive: true
enable: true
message_time: 15
recovery_interval: 300