Keywords: DLDP Down, unidirectional link, neighbor
Abstract: The Device Link Detection Protocol (DLDP) can detect the link status of a fiber cable or twisted pair. Upon detecting a unidirectional link, DLDP shuts down the faulty port automatically or prompts the user to do so manually depending on the configuration to avoid forwarding problems. This document introduces the concepts, mechanism, and typical applications of DLDP.
Device Link Detection Protocol
Link Aggregation Control Protocol
Table of Contents
In actual networks, fibers may be cross connected, one fiber may be not connected, and a fiber or one cable of a twist pair may be disconnected. Whichever fault occurs, a unidirectional link will be created where one end on the link can receive packets from the other end but the other cannot.
As the physical connection of a unidirectional link is up, the detection mechanism (such as the auto-negotiation mechanism) of the physical layer cannot detect the communication failure on the link, resulting in traffic forwarding errors. To address the problem, the Device Link Detection Protocol (DLDP) was developed.
You can use DLDP to monitor fiber-optic or copper twisted pair links for unidirectional links. Depending on your configuration, upon detecting a unidirectional link, DLDP shuts down the faulty port automatically or prompt users to shut down the faulty ports manually to avoid forwarding problems.
l If both ends of a link are operating normally at the physical layer, DLDP detects whether the link is correctly connected at the link layer and whether the two ends can exchange packets properly. This is beyond the capability of the auto-negotiation mechanism at the physical layer.
Table 1 Description on DLDP states
Initial state before DLDP is enabled.
DLDP is enabled but the link is down.
DLDP is enabled, and the link is up or the neighbor entry or entries have been cleared.
All neighbors are bi-directionally reachable or the port has been in the Active state for more than five seconds. This is a relatively stable state where no unidirectional link has been detected.
The port enters this state when DLDP receives a packet from an unknown neighbor. In this state, DLDP sends Probe packets to check whether the link in-between is unidirectional.
A port enters this state when a unidirectional link is detected or the contact with the neighbor in enhanced mode gets lost. In this case, the port does not receive or send packets other than DLDPDUs.
When the port in the Active, Advertisement, or Probe state detects a port-down event, it transits to the DelayDown state rather than removes the corresponding neighbor entry. A port in the DelayDown state keeps DLDP neighbor information and responds to only port-up events.
Specifies the interval at which a port in the Active state sends RSY-tagged Advertisement packets, which is fixed to one second.
Specifies the interval at which a port in the Advertisement state sends common Advertisement packets, which defaults to five seconds. The Advertisement timer is configurable.
Specifies the interval at which a port in the Probe state sends two Probe packets. The Probe timer is fixed to one second.
The Echo timer is triggered when DLDP enters the Probe state or when enhanced detection is enabled. The Echo timer is fixed to 10 seconds.
If the port has not received any Echo packet from its neighbor before the Echo timer expires, the port enters the Disable state and sends Disable packets. Depending on the configured DLDP Down mode, DLDP shuts down the port automatically, or prompts you to shut down the port manually, and DLDP deletes the neighbor entry at the same time.
Neighbor aging timer
When DLDP creates an entry for a newly detected neighbor, a Neighbor aging timer starts.
When a DLDPDU is received from a neighbor, the device updates the corresponding neighbor entry and re-starts the Neighbor aging timer.
In normal mode, if no packet is received from a neighbor when the Neighbor aging timer expires, DLDP sends an RSY-tagged Advertisement packet, and deletes the neighbor entry.
In enhanced mode, if no packet is received from a neighbor when the Neighbor aging timer expires, DLDP starts the Enhanced timer.
The Neighbor aging timer is three times the Advertisement timer.
In Enhanced mode, if no packet is received from a neighbor when the Neighbor aging timer expires, DLDP starts the Enhanced timer. The Enhanced timer is one second.
After the Enhanced timer starts, the device sends up to eight Probe packets to the neighbor at the frequency of one packet per second. If no Echo packet is received from the neighbor when the Echo timer expires, the port transits to the Disable state and sends Disable packets. Depending on the user-defined DLDP Down mode, DLDP shuts down the port automatically or prompts you to shut down the port manually, and at the same time deletes the neighbor entry.
The DelayDown timer starts for a DLDP port when a port-down event is detected on the port.
If no port-up event is detected on the port when the DelayDown expires, the system deletes the DLDP entry and places the port in the Inactive state. If a port-up event is detected before the timer expires, the port resumes its previous DLDP state.
Specifies the interval at which a port in the Disable state sends RecoverProbe packets (used for detecting link recovery). The timer is fixed to two seconds.
If a local port can receive link layer packets from a remote port, the remote port is called the neighbor of the local port. Two ports that can exchange packets with each other are the neighbors of each other. There are three DLDP neighbor states, as shown in Table 3 .
A neighbor just detected is placed in unknown state. The state indicates that the neighbor is being probed and no reply has been received from it yet. After the probe finishes, the neighbor is placed in bidirectional (two-way) state or unidirectional state depending on the probe result.
Two way (bidirectional)
A neighbor is placed in this state after a probe reply is received from it. This state indicates that the link is a bidirectional one. A neighbor can be in this state for a long time stably.
One way (unidirectional)
A neighbor is placed in this state after the link connecting it is detected to be unidirectional. A neighbor in one-way state will be removed.
This section describes how unidirectional link detection is conducted on a port connected to a single neighbor in the following two cases:
l Unidirectional link appears before DLDP is enabled
l Unidirectional link appears after DLDP is enabled
1. Unidirectional link appears before DLDP is enabled
As shown in Figure 1 , fibers connecting Device A and Device B are cross-connected but the connected ports are in up state.
After DLDP is enabled, the four ports transit to the DLDP Active state and sends out RSY-tagged Advertisement messages to declare their existence and discover neighbors. The following describes how DLDP works, taking Port 1 for example.
(1) Upon receiving the RSY-tagged Advertisement from Port 4, Port 1 considers that it has discovered a new DLDP neighbor. It thus starts the Echo timer, creates an entry for the neighbor and at the same time starts the aging timer of the entry. Then, Port 1 enters the Probe state, and sends out Probe packets to explore for Port 4.
(2) As Port 4 cannot receive the Probe packets from Port 1, it does not send Echo packets to Port 1. After the Echo timer on Port 1 expires, Port 1 enters the Disable state.
The detection process on the other ports is the same as that on Port 1. At last, the four ports are all in the Disable state.
2. Unidirectional link appears after DLDP is enabled
As shown in Figure 2 , Device A and Device B are fiber-connected correctly.
Enable DLDP, assuming that both the Tx line and the Rx line are working normally and the four ports are in up state. DLDP works as follows:
(1) Port A transits to the Active state and sends out an RSY-tagged Advertisement message to declare its existence and discover neighbors.
(2) Upon receiving the RSY-tagged Advertisement from Port A, Port B considers that it has discovered a new neighbor. It thus starts the Echo timer, creates an entry for the neighbor, and at the same time starts the aging timer of the entry. Then, Port B enters the Probe state, and sends out a Probe packet.
(3) Upon receiving the Probe packet from Port B, Port A creates an entry for the neighbor, enters the Probe state, and returns an Echo packet to Device B.
(4) Upon receiving the Echo packet, Port B checks the Echo packet and finds that the entry for Port A already exists and the neighbor information in the Echo packet is the same as that saved locally. Thus, Port B regards Port A as a bidirectional neighbor. As a result, the DLDP state of Port B transits from Probe to Advertisement, and Port B sends out common Advertisement packets periodically. In Advertisement state, Port B restarts the aging timer of the Entry each time it receives an Advertisement packet from the neighbor.
(5) DLDP works in the same way on Port A.
(6) Finally Port A and Port B consider each other as its bidirectional neighbor and both enter the Advertisement state.
If the Rx line of Port B fails after that, as shown in Figure 3 , Port B goes down physically, and enters the Inactive state, not sending or receiving any packet. However, the Tx line of Port B can still send signals, and Port A can receive signals. Therefore, Port A is still up. When Port A fails to receive any DLDP packet from Port B before the Neighbor aging timer expires, Port A performs the subsequent unidirectional link detection process depending on the configured DLDP mode.
l In the normal DLDP mode, after the Neighbor aging timer expires, Port A deletes the neighbor entry, enters the Active state, and sends an RSY-tagged Advertisement packet to request for neighbor information. Port A stays in the Active state for five seconds and then enters the Advertisement state. Then Port A remains in the Advertisement state and has no neighbor. Port B remains in the Inactive state. In this case, DLDP in the normal mode cannot detect unidirectional links.
l In the enhanced DLDP mode, Port A starts the Enhanced timer and the Echo timer when the Neighbor aging timer expires, and sends Probe packets to its neighbor. As the Tx line of Port A has been broken, Port A cannot receive any Echo packet from Port B. Thus, when the Echo timer expires, Port A enters the Disable state and sends a Disable packet to the notify Port B of its state. At the same time, Port A deletes the neighbor entry and starts the Probe timer to detect link recovery. During this process, Port B remains in the Inactive state.
DLDP cannot detect the physically down event of a remote port. To enable DLDP to get aware of the connectivity problem with a remote end as fast as possible rather than when the Neighbor aging timer expires, the Link Down Alert mechanism was introduced to the enhanced DLDP mode. In this mechanism, upon detecting a psychically down event of the remote port, the physical layer sends a Link Down packet to the local port. Upon receiving the Link Down packet, the local port enters the Disable state directly.
DLDP supports detecting unidirectional links on a port connected to multiple devices through a hub. In this case, more than one neighbor can be detected for the port. Figure 4 shows a typical multi-neighbor network, where Device B, Device C, and Device D are either copper-wire connected or fiber connected to Device A through a hub.
To have DLDP detect unidirectional links properly in a multi-neighbor environment, you must enable it on all ports connected to the hub.
In a multi-neighbor environment, a port enters the Disable state immediately after it finds out that one of its neighbors is in the Disable state or receives a Disable packet. As shown in Figure 4 , when Device A, Device B, and Device C find that the connection to Device D fails, they set Port A, Port B, and Port C to the Disable state.
This implementation prevents the traffic forwarding error caused by delayed response of a neighbor to topology changes. As shown in Figure 4 , for example, if the Rx optical fiber connecting Device B to the hub fails when Device A is forwarding traffic to Device B, Device A will shut down Port A to stop forwarding traffic to Device B, and as a result, Device A stops forwarding traffic to Device C and Device D at the same time. If there is any redundant link between Device A and Device B, STP can switch traffic to the redundant link after Port A is shut down.
You can replace the hub shown in Figure 4 with a DLDP-disabled device capable of forwarding DLDPDUs. In this case, the network is still considered as a multi-neighbor network.
After DLDP detects a unidirectional link, it shuts down the port directly or notifies the user to do so depending on the configured shutdown mode.
l In manual mode, DLDP recommends the user to shut down the port by outputting log and trap message but does not shut down the port directly.
l In automatic mode, DLDP sets the state of the port to DLDP Down in addition to outputting log and trap messages. A port in DLDP Down state cannot receive or send any packets except DLDPDUs.
The automatic mode is recommended in a high-performance network. In a low-performance network, however, the manual mode is recommended because DLDPDUs may be delayed, which can cause some links to be mistaken as unidirectional links.
After a unidirectional link recovers, you can restore the port in one of the following ways:
l If the port was shut down manually, you need to use the undo shutdown command to enable the port to receive and send packets.
l If the port was set to the DLDP Down state by DLDP automatically, you can use the dldp reset command to re-enable the port or leave the work to DLDP.
The link auto-recovery mechanism of DLDP allows it to automatically bring up a port in DLDP Down state after the link is recovered.
The following describes how the link auto-recovery mechanism works:
1) A DLDP Down port sends out a RecoverProbe packet every two seconds. The RecoverProbe packets only carries the local port information.
2) Upon receiving a RecoverProbe packet, the remote end returns a RecoverEcho packet.
3) Upon receiving the RecoverEcho packet, the local port checks whether the neighbor information in the RecoverEcho packet is the same as the neighbor information of the local port. If they are the same, DLDP considers that the link between the local port and the neighbor port has restored the bidirectional state, and thus transits from the Disable state to the Active state and re-establishes the neighborship with the remote port.
Follow these guidelines when configuring DLDP:
l DLDP can detect unidirectional state only on links physically connected. Therefore, before enabling DLDP, make sure that devices are fiber-connected or copper-wire connected.
l To guard against network attacks and malicious probes, you can authenticate DLDPDUs with clear text authentication or MD5 authentication. To ensure unidirectional links can be detected, make sure the authentication mode and password are the same on both sides.
l To ensure unidirectional links can be detected, make sure that DLDP is enabled on both sides and the same interval is adopted on both sides for sending Advertisement packets.
l Reasonably adjust the interval for sending Advertisement packets depending on your network environment so that unidirectional links can be detected in time. If the interval is too long, unidirectional links cannot be terminated in time; if the interval is too short, network traffic will increase.
l LACP (the Link Aggregation Control Protocol) events have no effect on DLDP. Links in an aggregation group are treated individually by DLDP.
l You can connect DLDP-enabled devices by using transparent-transmission devices (hubs or DLDP-disabled devices for example). However, you are strongly recommended not to connect DLDP devices to a transparent-transmission device through aggregate links, because doing so may cause the DLDP state machine to become instable resulting in continual up/down of the DLDP ports.
Figure 5 shows a typical DLDP application scenario. Device A and Device B are connected through two fiber pairs. Because the Rx line of Port B is broken, Port B is physically down. However, as Port A cannot detect this problem, it still forwards data packets to Port B. As a result, packet loss occurs.
To detect such unidirectional links, you can enable DLDP on the two devices respectively. In this example, upon detecting the unidirectional link, DLDP shuts down the it automatically to avoid packet loss. After the administrator repairs the link, the unidirectional link recovers automatically and continues to forward packets.
Copyright ©2008 Hangzhou H3C Technologies Co., Ltd. All rights reserved.
No part of this manual may be reproduced or transmitted in any form or by any means without prior written consent of Hangzhou H3C Technologies Co., Ltd.
The information in this document is subject to change without notice.