UDLD Configuration I Table of Contents Table of Contents Chapter 1 Unidirectional Link Detection (UDLD)........................................................................................1 1.1 UDLD Overview................................................................................................................................1 1.1.1 UDLD Mode...........................................................................................................................1 1.1.2 Running Mechanism.............................................................................................................2 1.1.3 Port state................................................................................................................................2 1.1.4 Maintaining the Cache of the Neighbor.............................................................................2 1.1.5 Echo Detection......................................................................................................................3 1.2 UDLD Configuration Task List........................................................................................................ 3 1.3 UDLD Configuration Tasks..............................................................................................................3 1.3.1 Globally Enabling or Disabling UDLD................................................................................3 1.3.2 Enabling or Disabling the UDLD Interface........................................................................4 1.3.3 Sets the message interval of the aggressive mode........................................................ 4 1.3.4 Restarts the interface shut down by UDLD...................................................................... 4 1.3.5 Displaying the UDLD State..................................................................................................5 1.4 Configuration Example.................................................................................................................... 7 1.4.1 Network Environment Requirements.................................................................................7 1.4.2 Network Topology................................................................................................................. 7 1.4.3 Configuration Procedure......................................................................................................7 II UDLD Configuration Chapter 1 Unidirectional Link Detection (UDLD) 1.1 UDLD Overview UDLD is a L2 protocol that monitors the physical location of the cable through the devices which are connected by optical cable or twisted-pair, and detects whether the unidirectional link exists. Only when the connected device supports UDLD can the unidirectional link be detected and shut down. The unidirectional link can cause a lot of problems, including the STP topology ring. Hence, when detecting a unidirectional link, UDLD will shut down the affected interface and notify users. UDLD works with the physical-layer protocol mechanism to judge the status if the physical link. On the physical layer, the physical signals and incorrect detections are automatically negotiated and processed, while UDLD processes other matters, such as detecting the ID of a neighbor and shutting down the incorrect connection port. If you enable automatic negotiation and UDLD, the detection at layer 1 and layer 2 can prevent physical/logical links and other protocols’ problems. 1.1.1 UDLD Mode UDLD supports two modes, the normal mode (default) and the aggressive mode. In normal mode, UDLD can detect the existence of a unidirectional link according to the unidirectional services of the link. In aggressive mode, UDLD can detect not only the existence of a unidirectional link as in the previous mode but also connection interruption which cannot be detected by L1 detection protocols. In normal mode, if UDLD determines that the connection is gone, UDLD will set the state of the port to undetermined, not to down. In aggressive mode, if UDLD determines that the link is gone and the link cannot be reconnected, it is thought that interrupted communication is a severe network problem and UDLD will set the state of the protocol to linkdown and the port is in errdisable state. No matter in what mode, if UDLD maintains it is a bidirectional link, the port will be set to bidirectional. In aggressive mode, UDLD can detect the following cases of the unidirectional link:  On the optical fiber or the twisted pair, an interface cannot receive or transmit services.  On the optical fiber or the twisted pair, the interface of one terminal is down and the interface of the other terminal is up.  One line in the optical cable is broken, and therefore the data can only be transmitted or only be received. In previous cases, UDLD will shut down the affected interface. 1 UDLD Configuration 1.1.2 Running Mechanism UDLD is a L2 protocol running on the LLC layer, which uses 01-00-0c-cc-cc-cc as its destination MAC address. SNAP HDLC is similar to 0x0111. When it runs with layer-1 FEFI and automatic negotiation, the completeness of a link in the physical layer and the logical link layer can be checked. UDLD can provide some functions that FEFI and automatic negotiation cannot conduct, such as checking and caching the neighbor information, shutting down any mis-configured port and checking the faults and invalidation on the logical ports except the point-to-point logical ports. UDLD adopts two basic mechanisms: learn the information about neighbors and save it in the local cache. When a new neighbor is detected or a neighbor applies for synchronizing the cache again, a series of UDLD probe/echo (hello) packets will be transmitted. UDLD transmits the probe/echo packets on all ports and, when a UDLD echo information is received on the ports, a detection phase and an authentication process are triggered. If all effective conditions are satisfied (port is connected in two directions and the cable is correctly connected), this port will be up. Otherwise, the port will be down. Once a link is established and labeled as bidirectional, UDLD will transmit a probe/echo message every 16 seconds. 1.1.3 Port state The UDLD interface may be in one of the following states: Port state Remark Detection Means that the interface is in detection state. Unknown Means that the interface is in unknown state, that is, it may be in detection state or it has not conducted detection. Unidirectional Means that the unidirectional connection has been detected. Bidirectional Means that the bidirectional connection has been detected. 1.1.4 Maintaining the Cache of the Neighbor UDLD transmits the Probe/Echo packets regularly on each active interface to maintain the completeness of the neighbor’s cache. Once a Hello message is received, it will be saved in the memory temporally and an interval that is defined by hold-time will also be saved. If the hold-time times out, the corresponding cache is 2 UDLD Configuration fully cleared. If a new Hello message is received in the hold-time, the new Hello message will replace the old one and the timer will be reset to zero. Once a UDLD-running interface is disabled or the device on the interface is restarted, all the caches on the interface will be removed to maintain the completeness of the UDLD cache. UDLD transmits at least one message to notify the neighbor to remove the corresponding cache items. 1.1.5 Echo Detection The echo mechanism is the basis of the detection algorithm. Once a UDLD device learns a new neighbor or another synchronization request from an asynchronous neighbor, it will start or restart the detection window of the local terminal and transmit an echo message for full agreement. Because all neighbors are demanded a corresponding action, the echo sender expects an echos message. If the checkup window is over before a legal echo is received, this link is thought to be a unidirectional one. In this case, link reconnection will be triggered or the link down process on the port is enabled. 1.2 UDLD Configuration Task List  Globally Enabling or Disabling UDLD  Enabling or Disabling the UDLD Interface  Setting the Message Interval of the Aggressive Mode  Restarts the interface shut down by UDLD.  Displaying the UDLD State 1.3 UDLD Configuration Tasks 1.3.1 Globally Enabling or Disabling UDLD In global configuration mode, run the following command to enable the UDLD function of all interfaces. Command Purpose udld [enable | aggressive] Enables the UDLD modules of all interfaces in some mode. In global configuration mode, run the following command to disable the UDLD function of all interfaces. Command Purpose no udld [enable | aggressive] Shuts down the UDLD modules of all interfaces. 3 UDLD Configuration Note: If you enable or disable the UDLD function in global configuration mode, the UDLD function will be performed on all interfaces. UDLD of the Aggressive mode is a variation of UDLD, which can provide extra benefits. When UDLD is in aggressive mode and the port stops transmitting the UDLD packets, UDLD will try to establish a link with its neighbor again. If the times of tries exceed a certain number, the state of the port is changed into the Error-Disable state and the link of the port is down. When UDLD is running, the ports at both terminals should run in the same mode, or the expecting result cannot be obtained. 1.3.2 Enabling or Disabling the UDLD Interface In interface configuration mode, run the following command to enable the UDLD function of an interface. Command Purpose udld port [aggressive] Enables the UDLD module of an interfaces in some mode. If the aggressive parameter is not entered, the UDLD function of the interface is enabled in normal mode; if the aggressive parameter is entered, the UDLD function of the interface is enabled in aggressive mode. In interface configuration mode, run the following command to disable the UDLD function of an interface. Command Purpose no udld port [aggressive] Disables the UDLD module of the interface by entering the corresponding command in some mode. Note: When UDLD is running, the ports at both terminals should run in the same mode, or the expecting result cannot be obtained. 1.3.3 Sets the message interval of the aggressive mode. In global configuration mode, run the following command to set the message interval of the aggressive mode. Command Purpose udld message time Sets the message interval of the aggressive mode. 1.3.4 Restarts the interface shut down by UDLD. In the EXEC mode, run the following command to restart the interface that is shut down by the UDLD module. 4 UDLD Configuration Command Purpose udld reset Restarts the interface shut down by UDLD. 1.3.5 Displaying the UDLD State Run the following command to display the states of the UDLD modules of all current interfaces. Command Purpose show udld Displays the states of the UDLD modules of all current interfaces. Run the following command to display the state of the UDLD module of the specified interface. Command Purpose show udld interface interface Run the following command to display the state of the UDLD module of the specified interface. The UDLD displaying command is used to browse the state and the mode of UDLD, the current detection state, the state of the current link and some information about the neighbors. It is used to display the running states of the UDLD modules of the current interfaces. Switch#show udld Interface GigaEthernet0/1 --- Port enable administrative configuration setting: Enabled interface UDLD configuration state Port enable operational state: Enabled interface UDLD starting state Current bidirectional state: Bidirectional or not Current operational state: Advertisment UDLD operating state Message interval: 15 information interval Time out interval: 5 timeout interval Entry 1 cache item --- Expiration time: 42 expiration aging time Cache Device index: 1 information index number Device ID: CAT0611Z0L9 neighbor device ID Port ID: GigaEthernet0/1 Connecting interface ID Neighbor echo 1 device: S35000202 Neighbor's neighor's device ID Neighbor echo 1 port: GigaEthernet0/1 Neighbor's neighor's interface ID Message interval: 15 neighbor's 5 UDLD Configuration information interval Time out interval: 5 neighbor's timeout interval UDLD Device name: Switch Interface GigaEthernet0/2 --- Port enable administrative configuration setting: Disabled Port enable operational state: Disabled Current bidirectional state: Unknown Interface GigaEthernet0/3 --- Port enable administrative configuration setting: Disabled Port enable operational state: Disabled Current bidirectional state: Unknown …………………… It is used to display the operational state of the UDLD module of the current interface. Switch#show udld interface g0/1 Interface GigaEthernet0/1 --- Port enable administrative configuration setting: Enabled interface UDLD configuration state Port enable operational state: Enabled interface UDLD starting state Current bidirectional state: Bidirectional or not Current operational state: Advertisment UDLD operating state Message interval: 15 information interval Time out interval: 5 timeout interval Entry 1 cache item --- Expiration time: 42 expiration aging time Cache Device index: 1 information index number Device ID: CAT0611Z0L9 neighbor device ID Port ID: GigaEthernet0/1 Connecting interface ID Neighbor echo 1 device: S35000202 Neighbor's neighor's ID Neighbor echo 1 port: GigaEthernet0/1 Neighbor's neighor's interface ID Message interval: 15 neighbor's information interval Time out interval: 5 neighbor's timeout interval UDLD Device name: Switch 6 UDLD Configuration 1.4 Configuration Example 1.4.1 Network Environment Requirements Configure LLDP protocol in the global configuration or on the port connecting two switches. 1.4.2 Network Topology Figure 2 Network Topology 1.4.3 Configuration Procedure Configuring Switch A: Switch_config#udld enable Switch_config#interface g0/1 Switch_config_g0/1#udld port Switch_config_g0/1#quit Configuring Switch B: Switch_config#udld enable Switch_config#interface g0/1 Switch_config_g0/1#udld port Switch_config_g0/1#quit Entering the show command on Switch A: Switch_config#show udld interface g0/1 Interface GigaEthernet0/1 7 UDLD Configuration --- Port enable administrative configuration setting: Enabled Port enable operational state: Enabled Current bidirectional state: Unknown Current operational state: Detection Message interval: 15 Time out interval: 1 Entry 1 --- Expiration time: 44 Cache Device index: 1 Device ID: S35043000 Port ID: GigaEthernet0/1 Neighbor echo 1 device: S32030079 Neighbor echo 1 port: GigaEthernet0/1 Message interval: 15 Time out interval: 1 UDLD Device name: SwitchB Switch_config# Switch_config#show udld interface g0/1 Interface GigaEthernet0/1 --- Port enable administrative configuration setting: Enabled Port enable operational state: Enabled Current bidirectional state: Unknown Current operational state: Advertisment Message interval: 15 8 UDLD Configuration Time out interval: 7 Entry 1 --- Expiration time: 43 Cache Device index: 1 Device ID: S35043000 Port ID: GigaEthernet0/1 Neighbor echo 1 device: S32030079 Neighbor echo 1 port: GigaEthernet0/1 Message interval: 15 Time out interval: 7 UDLD Device name: SwitchB Switch_config# Switch_config#show udld interface g0/1 Interface GigaEthernet0/1 --- Port enable administrative configuration setting: Enabled Port enable operational state: Enabled Current bidirectional state: Bidirectional Current operational state: Advertisment Message interval: 15 Time out interval: 15 Entry 1 --- Expiration time: 36 Cache Device index: 1 Device ID: S35043000 9 UDLD Configuration Port ID: GigaEthernet0/1 Neighbor echo 1 device: S32030079 Neighbor echo 1 port: GigaEthernet0/1 Message interval: 15 Time out interval: 15 UDLD Device name: SwitchB Switch_config# From the information above, you can find the three phases of the link state which UDLD detects: 1.Detection phase: In this phase, the UDLD packets are transmitted every other second. 2.Unknown phase: In this phase, the UDLD packets are transmitted every seven seconds. 3.Known bidirectional/unidirectional connection phase: Once a link is established and labeled as bidirectional, UDLD will transmit a probe/echo message every 16 seconds. 10