The MPLS control plane establishes label switched paths (LSPs) but it cannot detect data forwarding failures in LSPs, which causes network maintenance difficulties. To address this issue, MPLS ping and tracert have been introduced to detect LSP errors and locate faulty nodes. MPLS ping is used to check link connectivity and host reachability on an MPLS network.
MPLS ping includes P2P MPLS ping and Point-to-Multipoint (P2MP) MPLS ping. In this document, MPLS ping refers to P2P MPLS ping unless otherwise specified.
Similar to a common ping or tracert mechanism, MPLS ping or MPLS tracert checks the LSP status by sending MPLS Echo Request and Reply messages. Both types of packets are UDP packets transmitted using UDP port 3503. The receive end uses the UDP port number to identify MPLS Echo Request and Reply messages.
An MPLS Echo Request message carries information about the forwarding equivalence class (FEC) for an LSP to be monitored. The MPLS Echo Request message is forwarded with other service packets of the same FEC along the LSP. This procedure enables the LSP connectivity to be monitored. In addition, Echo Request messages are transmitted to the destination using MPLS, whereas MPLS Echo Reply messages are transmitted to the source using IP.
To prevent the egress from forwarding a received MPLS Echo Request message to other nodes, set the destination address to 127.0.0.0/8 (the local loopback address) and the time to live (TTL) value to 1 in the IP header of the message.
MPLS ping process
In Figure 1, an LSP destined for Device D is configured on Device A. The MPLS ping process on Device A is as follows:
Device A checks whether the LSP is established. If the LSP is a TE tunnel, Device A checks whether the tunnel interface is configured and the CR-LSP is established. If the LSP is not established, an error code is displayed, and the MPLS ping process ends. If the LSP has been established, the MPLS ping process continues.
Device A constructs an MPLS Echo Request message, with destination IP address 127.0.0.0/8 and TTL value 1 in the IP header. Then, Device A adds an LSP label to the MPLS Echo Request message and sends the message to Device B.
Transit nodes Device B and Device C forward this MPLS Echo Request message using MPLS.
If either transit node fails to forward the MPLS Echo Request message, this message is discarded.
If MPLS forwarding is successful, the MPLS Echo Request message reaches the egress Device D, and the Device D replies with an MPLS Echo Reply message to Device A.
MPLS tracert process
In Figure 1, the MPLS tracert process of 4.4.4.4/32 on Device A is as follows:
Device A checks whether the LSP exists. If it does not exist, an error code is returned and the MPLS tracert process ends. If it exists, the MPLS tracert process continues.
Device A constructs an MPLS Echo Request message, with destination IP address 127.0.0.0/8 and TTL value 1 in the IP header. Then, Device A adds an LSP label (TTL value of the label is 1) to the MPLS Echo Request message and sends the message to Device B. Upon receipt, Device B determines that the TTL of the LSP label in the message has timed out so that it replies with an MPLS Echo Reply message. The message carries the destination UDP port equal to the source UDP port in the MPLS Echo Request message, and destination IP address equal to the source IP address of the MPLS Echo Request packet, and the TTL value of 255.
Upon receipt, Device A sends an MPLS Echo Request message with the TTL value of 2. Device B then forwards the message using MPLS. Upon receipt, Device C determines that the TTL of the LSP label in the message has timed out so that it replies with an MPLS Echo Reply message.
After receiving the MPLS Echo Reply message sent by Device C, Device A sends an MPLS Echo Request message with the TTL value of 3. Device C then forwards the packet using MPLS. Upon receipt, if Device D is the egress node, Device D replies with an MPLS Echo Reply message. Then Device A obtains information about all nodes on the path.
P2MP ping process
On the network shown in Figure 2, a P2MP TE LSP is established on PE1. PE2, PE3, PE4, and P3-BUD are leaf nodes. The P2MP ping process from PE1 on the LSP is as follows:
PE1 checks whether the LSP exists.