Verifying and Troubleshooting MPLS Connectivity
In IP networks, the ping and traceroute commands enable you to verify network connectivity and find broken links or loops. In MPLS-enabled networks, you can use the ping command to determine whether IP connectivity exists to a destination even when the ping packets must traverse multiple LSPs. You can use the traceroute command to determine the labels that data packets use when traversing LSPs to the destination.
In an MPLS-enabled network, however, you cannot use these IP commands to determine MPLS connectivity to a destination. Instead, you can use the MPLS ping and trace features to detect data plane failures in LSPs. Specific mpls ping and trace mpls commands enable you to target different types of MPLS applications and network topologies. The various ping mpls and trace mpls commands send UDP packets, known as MPLS echo requests, to the egress LSR of MPLS packets in a given FEC. Each echo request is forwarded along the same data path as the MPLS packets in that FEC.
The echo request packets use a destination address in the 127.0.0.0/8 range and port 3503. The default address is 127.0.0.1. This address range prevents IP from forwarding the packet, so that the echo request must follow the MPLS data path. This behavior is different from that of the IP ping and traceroute commands, which send ICMP packets to the actual destination.
Each MPLS echo request packet contains information about the FEC stack that is being validated. LSRs that receive an MPLS echo request respond with MPLS echo reply packets.
The ping mpls commands perform a basic connectivity check. When the echo request exits the tunnel at the egress LSR, the LSR sends the packet to the control plane. The egress router validates the FEC stack to determine whether that LSR is the actual egress for the FEC. The egress router sends an echo reply packet back to the source address of the echo request packet. The egress router can send the packet back by means of either the IP path or the MPLS path.
The trace mpls commands isolate faults in the LSP. For these commands, successive echo request packets are sent along the path. The first packet has a TTL of one; the TTL value is incremented by one for each successive packet. The first packet therefore reaches only the next hop on the path; the second packet reaches the next router after that. Echo request packets are sent until either an echo reply is received from the egress router for the FEC or a TTL of 32 is reached.
When a TTL expires on an LSR, that LSR sends an echo reply packet back to the source. For transit routers, the echo reply indicates that downstream mapping exists for the FEC, meaning that the packet would have been forwarded if the TTL had not expired. The egress router sends an echo reply packet verifying that it is the egress.
Although you cannot send IPv6 UDP packets for MPLS ping, you can use the ping mpls l3vpn command with an IPv6 prefix to investigate IPv6 VPNs.
MPLS Echo Reply Generation
Echo reply packets are sent by E-series routers that receive an echo request packet, even when MPLS is not enabled on that router. This situation is a transient condition when the router is receiving labeled packets. A return code in the echo replies indicates to the sending router that no label mapping exists on the receiving router.
MPLS Connectivity and ECMP
When an MPLS ECMP is part of the tunnel being explored by an MPLS echo request, the request packet takes one of the available ECMP paths. Probing FECs with different label stacks can yield different ECMP paths. However, you cannot guarantee complete coverage of all the ECMP paths.
You can use MPLS trace to determine which paths are present on an MPLS LSR. When the TTL expires on an MPLS LSR, the echo reply that is returned includes a downstream mapping TLV. This TLV contains all the downstream mappings of the LSR on which the TTL expired, if that feature is supported by the LSR. You can use the detail version of the trace mpls commands to display these downstream mappings.
Supported TLVs
Table 27 lists the TLVs supported by the MPLS LSP ping feature. Table 28 lists the sub-TLVs supported for the Target FEC Stack TLV.
ping mpls ip
- Use to send an MPLS echo request packet to the specified IP or IPv6 address.
- The MPLS echo request packets and echo reply packets created by this command use the LDP IPv4 LSP sub-TLV described in RFC 4379Detecting Multi-Protocol Label Switched (MPLS) Data Plane Failures (February 2006).
- When you specify a VRF name, the LSP to the specified prefix must originate from the VRF because the ping is generated from the specified VRF.
- Example
host1:pe1#ping mpls ip 10.2.2.2/32There is no no version. ping mpls l2transport
- Use to send an MPLS echo request packet to the specified layer 2 cross-connect virtual (Martini) circuit.
- This command is not supported for local cross-connects because local cross-connects do not employ an LSP.
- The echo request packet generated by this command contains the FEC 128 Pseudowire (Current) sub-TLV described in RFC 4379Detecting Multi-Protocol Label Switched (MPLS) Data Plane Failures (February 2006).
- If you specify a VRF name, the ping is generated from the specified VRF. For that reason the MPLS shim interface must exist in the VRF.
- By default, the TTL on the inner (stacked) label is set to 1 when transmitting echo request packets. This value causes the packet to be exceptioned to the SRP module when the stacked label is exposed.
- Example
host1:pe1#ping mpls l2transport FastEthernet1/0.1 detailThere is no no version. ping mpls l3vpn
- Use to send an MPLS echo request packet to the specified L3VPN IP or IPv6 prefix.
- The echo request packet generated by this command contains either the VPN IPv4 sub-TLV or VPN IPv6 sub-TLV described in RFC 4379Detecting Multi-Protocol Label Switched (MPLS) Data Plane Failures (February 2006). Which sub-TLV is included depends on whether the ping is intended for an IPv4 prefix or an IPv6 prefix.
- You can use this command to send a request to a VPNv4 prefix in the specified VRF. If you do not specify a VRF, then you must issue the command from the VRF context. In any case, the ping originates from the parent router.
- Example
host1:pe1#ping mpls l3vpn vrf pe11 10.32.45.21/32There is no no version. ping mpls rsvp tunnel
- Use to send an MPLS echo request packet to the specified RSVP-TE tunnel.
- The MPLS echo request packets and echo reply packets created by this command use the RSVP IPv4 sub-TLV described in RFC 4379Detecting Multi-Protocol Label Switched (MPLS) Data Plane Failures (February 2006).
- Specify the VRF only when the RSVP-TE tunnel originates in the VRF because the ping is generated from the specified VRF.
- The tunnel specified with the tunnel keyword can be a bypass tunnel.
- Example
host1:pe1#ping mpls rsvp tunnel west1There is no no version. ping mpls vpls
- Use to send an MPLS echo request packet to the specified VPLS instance.
- The echo request packet generated by this command contains the layer 2 VPN endpoint sub-TLV described in RFC 4379Detecting Multi-Protocol Label Switched (MPLS) Data Plane Failures (February 2006).
- You can specify a VRF context to generate the ping from the specified VRF.
- By default, the TTL on the inner (stacked) label is set to 1 while transmitting the echo request packet. This value causes the packet to be exceptioned to the SRP module when the stacked label is exposed.
- Example
host1:pe1#ping mpls vpls vrf pe11 vplsA remote-site-id 2There is no no version. trace mpls ip
- Use to send MPLS echo request packets to discover and examine the path MPLS packets follow to the specified IP or IPv6 address.
- The MPLS echo request packets and echo reply packets created by this command use the LDP IPv4 sub-TLV described in RFC 4379Detecting Multi-Protocol Label Switched (MPLS) Data Plane Failures (February 2006).
- When you specify a VRF name, the LSP to the specified prefix must originate from the VRF because the ping is generated from the specified VRF.
- Example
host1:pe1#trace mpls ip 192.168.25.1/32There is no no version. trace mpls l2transport
- Use to send MPLS echo request packets to discover and examine the path MPLS packets follow to the specified layer 2 cross-connect virtual (Martini pseudowire) circuit.
- This command is not supported for local cross-connects because local cross-connects do not employ an LSP.
- The echo request packet generated by this command contains the FEC 128 Pseudowire (Current) sub-TLV described in RFC 4379Detecting Multi-Protocol Label Switched (MPLS) Data Plane Failures (February 2006).
- By default, the TTL on the inner (stacked) label is set to 1 when transmitting echo request packets. This value causes the packet to be exceptioned to the SRP module when the stacked label is exposed.
- Example
host1:pe1#trace mpls l2transport FastEthernet1/0.1 detailThere is no no version. trace mpls l3vpn
- Use to send MPLS echo request packets to discover and examine the path MPLS packets follow to the L3VPN IP or IPv6 prefix.
- The echo request packet generated by this command contains either the VPN IPv4 sub-TLV or VPN IPv6 sub-TLV described in RFC 4379Detecting Multi-Protocol Label Switched (MPLS) Data Plane Failures (February 2006). Which sub-TLV is included depends on whether the trace is intended for an IPv4 prefix or an IPv6 prefix.
- You can use this command to send a request to a VPNv4 prefix in the specified VRF. If you do not specify a VRF, then you must issue the command from the VRF context. In either case, the trace originates from the parent router.
- Example
host1:pe1#trace mpls l3vpn vrf pe11 10.2.3.21/32There is no no version. trace mpls rsvp tunnel
- Use to send MPLS echo request packets to discover and examine the path MPLS packets follow to the specified RSVP-TE tunnel.
- The MPLS echo request packets and echo reply packets created by this command use the RSVP IPv4 sub-TLV described in RFC 4379Detecting Multi-Protocol Label Switched (MPLS) Data Plane Failures (February 2006).
- Specify the VRF only when the RSVP-TE tunnel originates in the VRF because the ping is generated from the specified VRF.
- The tunnel specified with the tunnel keyword can be a bypass tunnel.
- Example
host1:pe1:pe11#trace mpls rsvp tunnel west1 detailThere is no no version. trace mpls vpls
- Use to send MPLS echo request packets to discover and examine the path MPLS packets follow to the specified VPLS instance.
- The MPLS echo request packets and echo reply packets created by this command use the L2 endpoint sub-TLV described in RFC 4379Detecting Multi-Protocol Label Switched (MPLS) Data Plane Failures (February 2006).
- When you specify a VRF name, the LSP to the specified prefix must originate from the VRF because the ping is generated from the specified VRF.
- By default, the TTL on the inner (stacked) label is set to 1 while transmitting the echo request packet. This value causes the packet to be exceptioned to the SRP module when the stacked label is exposed.
- Example
host1:pe1#trace mpls vpls vrf pe11 vplsA remote-site-id 2 detailThere is no no version. Sample Network Topology
Figure 61 shows a sample IPv4/IPv6 L3VPN topology with LDP or RSVP-TE base tunnels. Two base tunnels (one in each direction) are present between 10.1.1.1 and 10.2.2.2. The packet flow examples that follow refer to this sample topology.
![]()
MPLS LSPs to an IP prefix
Use the ping mpls ip and trace mpls ip commands for MPLS LSPs that are configured to use LDP; labeled BGP; or a combination of LDP, BGP, and RSVP-TE (as for inter-AS and carrier-of-carriers topologies). When you specify a VRF name, the LSP to the specified prefix must originate from the VRF because the ping is generated from the specified VRF.
Packet Flow Example for the ping mpls Command
The following example illustrates the packet flow that results when you issue the ping mpls ip command from router PE 1 (10.1.1.1) to router PE 2 (10.2.2.2) over an LDP base tunnel.
host1:pe1#ping mpls ip 10.2.2.2/32
- PE 1 sends an MPLS echo request UDP packet that contains an LDP IPv4 sub-TLV. The packet is sent as a labeled packet over the target LSP. The packet has the following attributes:
- Router P 1 label-switches the packet to P 2.
- Router P 2 label-switches the packet to PE 2 (assuming PHP is not configured).
- Router PE 2 pops the label and determines that the destination address is in the 127.0.0.0/8 subnet. PE 2 sends the packet up to the control plane. The MPLS ping application on the control plane then creates an MPLS echo reply to the received echo request. The echo reply packet has a return code of 3, which means that the replying router is an egress for the FEC at stack depth. The echo reply packet includes the Interface and Label Stack TLV to indicate both the interface on which the request packet was received and the incoming label stack. The MPLS echo reply packet is sent back as a (labeled) UDP packet with the following attributes:
- When the MPLS echo reply reaches router PE 1, the router matches the sender's handle and the sequence number to the echo request packet that PE 1 sent out. If the values match, the CLI displays an exclamation point (!).
The following sample output represents what you might see when you issue the ping mpls ip and ping mpls ip detail commands for the topology shown in Figure 61.
host1:pe1#ping mpls ip 10.2.2.2/32Sending 5 UDP echo requests for LDP IPv4 prefix, timeout = 2 sec!!!!!Success rate = 100% (5/5), round-trip min/avg/max = 4294967295/4/0 mshost1:pe1#ping mpls ip 10.2.2.2/32 detailSending 5 UDP echo requests for LDP IPv4 prefix, timeout = 2 secMplsNextHopIndex 32 handle 8073311'!' - success, 'Q' - request not transmitted,'.' - timeout, 'U' - unreachable,'R' - downstream router but not destination'M' - malformed request, 'N' - downstream router has no mappingSending MPLS ping echo request, handle 8073311 seq 21241! 10.2.2.2 Replying router is an egress for the FEC at stack depth/0 seq 21241Sending MPLS ping echo request, handle 8073311 seq 21242! 10.2.2.2 Replying router is an egress for the FEC at stack depth/0 seq 21242Sending MPLS ping echo request, handle 8073311 seq 21243! 10.2.2.2 Replying router is an egress for the FEC at stack depth/0 seq 21243Sending MPLS ping echo request, handle 8073311 seq 21244! 10.2.2.2 Replying router is an egress for the FEC at stack depth/0 seq 21244Sending MPLS ping echo request, handle 8073311 seq 21245! 10.2.2.2 Replying router is an egress for the FEC at stack depth/0 seq 21245Success rate = 100% (5/5), round-trip min/avg/max = 4/4/0 msPacket Flow Example for the trace mpls Command
The following example illustrates the packet flow that results when you issue the trace mpls ip command from router PE 1 (10.1.1.1) to router PE 2 (10.2.2.2) over an LDP base tunnel.
host1:pe1#trace mpls ip 10.2.2.2/32
- PE 1 sends an MPLS echo request UDP packet that contains an LDP IPv4 sub-TLV and a Downstream Mapping TLV. The packet has the following attributes:
- The TTL expires on router P 1. P 1 exceptions the packet up to the control plane. Router P 1 then creates an MPLS echo reply packet in reply to the received MPLS echo request. The MPLS echo reply packet has a return code of 8, which means that the packet would have been label-switched at the outermost label (label-stack depth 1). The Downstream Mapping TLV is set to indicate the path that the packet would have taken from the router. The Interface and Label Stack TLV is included in the echo reply packet. The MPLS echo reply packet is sent back as a labeled UDP packet with the following attributes:
- When the MPLS echo reply reaches router PE 1, the router matches the sender's handle and the sequence number to the echo request packet that PE 1 sent. The CLI displays the router ID of the router that sent the echo reply. The detail version of the command displays the downstream mapping TLV contained in the MPLS echo reply.
- Steps 13 are repeated with a TTL of 2 and the destination address set to router P 2's router ID, 10.4.4.4.
- Router PE 1 next sends an MPLS echo request with a TTL of 3. This packet's TTL expires on router PE 2. PE 2 exceptions the packet up to the control plane. The MPLS trace application on the control plane then creates an MPLS echo reply to the received echo request. The echo reply packet has a return code of 3, which means that the replying router is an egress for the FEC at stack depth. The echo reply packet includes the Interface and Label Stack TLV to indicate both the interface on which the request packet was received and the incoming label stack. The Downstream Mapping TLV is not included in the echo reply packet.
- When PE 2's echo reply packet reaches router PE 1, the router matches PE 2's handle and the sequence number to the echo request packet that PE 1 sent. The CLI displays the router ID for PE 2, indicating that PE 2 is the target router.
The following sample output represents what you might see when you issue the trace mpls ip command for the topology shown in Figure 61.
host1:pe2#trace mpls ip 10.1.1.1/32Tracing LDP IPv4 prefix, timeout = 2 sec, Max TTL 32MplsNextHopIndex 60, handle 80733121 2ms 10.44.44.44 Label switched at stack-depth/12 1ms 10.33.33.33 Label switched at stack-depth/13 2ms 10.1.1.1 Replying router is an egress for the FEC at stack depth/0Packet Flows for ping and trace to L3VPN IPv4 Prefixes
This example describes packet flow for an MPLS ping is sent from VRF PE 11 on router PE 1 to the IPv4 prefix 10.99.99.21/32. For validation at the remote end, the source address of the echo request packet must be the same as the update-source address of BGP peer.
host1:pe1#ping mpls l3vpn vrf pe11 10.99.99.21/32
- An MPLS echo request packet containing a single VPN IPv4 sub-TLV is sent from PE 1 with the following attributes:
The VPN IPv4 sub-TLV has the route distinguisher set to that of the VRF and the IPv4 prefix set to 10.99.99.21/32. The packet exits PE 1 with two labels.
- Router P 1 switches labels based on the outer label of the packet and forwards the packet to P 2.
- Router P 2 switches labels based on the outer label of the packet and forwards the packet to PE 2.
- Router PE 2 pops both labels and determines that the destination address is in the 127.0.0.0/8 subnet. PE 2 sends the packet up to the control plane. The MPLS ping application on the control plane then creates an MPLS echo reply to the received echo request. The echo reply packet has a return code of 3, which means that the replying router is an egress for the FEC at stack depth. The echo reply packet includes the Interface and Label Stack TLV to indicate both the interface on which the request packet was received and the incoming label stack. The MPLS echo reply packet is sent back as a (labeled) UDP packet with the following attributes:
- When the MPLS echo reply reaches router PE 1, the router matches the sender's handle and the sequence number to the echo request packet that PE 1 sent. The CLI displays an exclamation point (!).
Packet flow for an MPLS trace to an L3VPN IPv4 prefix is the same as for an IPv4 prefix except that the echo request packets and echo reply packets contain the VPN IPv4 sub-TLV instead of the LDP IPv4 sub-TLV. The following sample output represents what you might see when you issue the trace mpls l3vpn and trace mpls l3vpn vrf commands for the topology shown in Figure 61.
host1:pe1:pe11#ip8:pe1#trace mpls l3vpn 10.99.99.21/32 detailTracing VPN IPv4 prefix, timeout = 2 sec, Max TTL 32MplsNextHopIndex 73 handle 80733221 0ms 10.33.33.33 Label switched at stack-depth/2TLV Interface and Label stack 20 bytesRouter 10.33.33.33 Intf 10.10.10.2[L34 EXP 0 TTL 1] [L68 EXP 0 S TTL 1]TLV Downstream mapping 24 bytesRouter 10.31.31.2 Intf 10.31.31.1 mtu 9180[L56 EXP 0 LDP] [L68 EXP 0 S Unknown]TLV Downstream mapping 24 bytesRouter 10.34.34.2 Intf 10.34.34.1 mtu 1500[L79 EXP 0 LDP] [L68 EXP 0 S Unknown]2 2ms 10.55.55.55 Label switched at stack-depth/2TLV Interface and Label stack 20 bytesRouter 10.55.55.55 Intf 10.34.34.2[L79 EXP 0 TTL 1] [L68 EXP 0 S TTL 2]TLV Downstream mapping 24 bytesRouter 10.120.120.2 Intf 10.120.120.1 mtu 1500[L43 EXP 0 LDP] [L68 EXP 0 S Unknown]3 3ms 10.2.2.2 Replying router is an egress for the FEC at stack depthTLV Pad 20 bytesTLV Interface and Label stack 20 bytesRouter 10.2.2.2 Intf 10.120.120.2[L43 EXP 0 TTL 1] [L68 EXP 0 S TTL 3]host1:pe1#trace mpls l3vpn vrf pe11 10.99.98.21/32 reply pad-tlv exp-bits 5 detailTracing VPN IPv4 prefix, timeout = 2 sec, Max TTL 32Handle 1921136 MplsNextHopIndex 78 [L68,L34]1 0ms 10.33.33.33 Label switched at stack-depth/2TLV Pad 20 bytesTLV Interface and Label stack 20 bytesRouter 10.33.33.33 Intf 10.10.10.2[L34 EXP 5 TTL 1] [L68 EXP 0 S TTL 1]TLV Downstream mapping 24 bytesRouter 10.31.31.2 Intf 10.31.31.1 mtu 9180[L56 EXP 5 LDP] [L68 EXP 0 S Unknown]TLV Downstream mapping 24 bytesRouter 10.34.34.2 Intf 10.34.34.1 mtu 1500[L79 EXP 5 LDP] [L68 EXP 0 S Unknown]2 2ms 10.55.55.55 Label switched at stack-depth/2TLV Pad 20 bytesTLV Interface and Label stack 20 bytesRouter 10.55.55.55 Intf 10.34.34.2[L79 EXP 5 TTL 1] [L68 EXP 0 S TTL 2]TLV Downstream mapping 24 bytesRouter 10.120.120.2 Intf 10.120.120.1 mtu 1500[L43 EXP 5 LDP] [L68 EXP 0 S Unknown]3 3ms 10.2.2.2 Replying router is an egress for the FEC at stack depthTLV Pad 20 bytesTLV Interface and Label stack 20 bytesRouter 10.2.2.2 Intf 10.120.120.2[L43 EXP 5 TTL 1] [L68 EXP 0 S TTL 3]Inter-AS Topology
When an L3VPN ping or trace is transmitted, the TTL value on the inner (VPN) label is set to 1 by default. This value causes the TTL to expire on the egress PE of the L3VPN LSP and an echo reply can be sent back to the source. However, in an inter-AS topology, this behavior might result in premature termination of the ping or trace. You can use the bottom-label-ttl keyword to avoid this problem.
Packet Flows to L3VPN IPv6 Prefixes
Packet flow for an MPLS ping and trace to an L3VPN IPv6 prefix is the same as for an IPv4 prefix except that the echo request packets and echo reply packets contain the VPN IPv6 sub-TLV instead of the VPN IPv4 sub-TLV.