ping lsp [ -a source-ip | -c count | -exp exp-value | -h ttl-value | -m interval | -s packet-size | -t time-out | -v | -g ] * segment-routing ip destination-iphost mask-length [ flex-algo flex-algo-id ] [ version draft2 ] [ bypass ] [ remote remote-ip ]
ping lsp [ -a source-ip | -c count | -exp exp-value | -h ttl-value | -m interval | -s packet-size | -t time-out | -v | -g ] * sr-te policy { policy-name policyname | endpoint-ip endpoint-ip color colorid | binding-sid bsid }
ping lsp [ -a source-ip | -c count | -exp exp-value | -h ttl-value | -m interval | -s packet-size | -t time-out | -v | -g ] * segment-routing ip destination-iphost mask-length [ flex-algo flex-algo-id ] [ version draft2 ] [ bypass ] [ remote-fec { ldp remoteipaddr remotemasklen | nil } ]
Parameter | Description | Value |
---|---|---|
-a source-ip |
Specifies the source IP address of MPLS Echo Request packets to be sent. If the source IP address is not specified, the IP address of the outbound interface is used as the source IP address of the MPLS Echo Request packet. |
The value is in dotted decimal notation. |
-c count |
Specifies the number of MPLS Echo Request packets to be sent. When the network quality is poor, you can increase the number of sent packets to detect the network quality based on the packet loss rate. |
The value is an integer ranging from 1 to 4294967295. The default value is 5. |
-exp exp-value |
Specifies the EXP value of MPLS Echo Request packets to be sent. The value is an integer that ranges from 0 to 7. |
The value is an integer that ranges from 0 to 7. The default value is 0. |
-h ttl-value |
Specifies the TTL value. If the TTL value is reduced to 0 during packet forwarding, the router that the packet reaches sends a timeout packet to the source, indicating that the destination is unreachable. |
The value is an integer ranging from 1 to 255. The default value is 255. |
-m interval |
Specifies the time to wait before sending the next MPLS Echo Request packet. After sending an MPLS Echo Request packet, the device waits for a reply. By default, the device waits for 2000 ms before sending the next MPLS Echo Request packet. You can set the time to wait before sending the next ICMP Echo Request message using the parameter time. If the network quality is poor, you are advised to set this parameter to a value greater than or equal to 2000 ms. |
The value is an integer ranging from 1 to 10000. The default value is 200. |
-s packet-size |
Specifies a packet payload length, excluding the IP header and UDP header. |
The value is an integer ranging from 65 to 9600, in bytes. The default value is 100. |
-t time-out |
Specifies a timeout period for waiting for an MPLS echo reply packet after an MPLS echo request packet is sent. |
The value is an integer ranging from 0 to 65535, in milliseconds. The default value is 2000. |
-v |
Specifies the detailed output information. |
- |
-g |
Specifies MPLS packet fragmentation. |
- |
segment-routing |
Specifies a segment routing scenario. |
- |
ip destination-iphost |
Specifies the IPv4 address of the peer. |
The value is in dotted decimal notation. |
mask-length |
Specifies the mask of the destination IPv4 address. |
The value is an integer ranging from 0 to 32. |
flex-algo flex-algo-id |
Specifies the Flex-Algo ID. If a Flex-Algo SR-MPLS BE LSP is used, you need to specify flex-algo-id to initiate a test. |
The value is an integer that ranges from 128 to 255. |
version |
Specifies the version of the used protocol version. |
- |
draft2 |
Indicates that the command application version is draft2. In the SR MPLS scenario, to check LSP connectivity in compliance with the Draft-ietf-mpls-spring-lsp-ping-02 protocol draft, specify this parameter. |
- |
bypass |
Indicates the bypass flag. |
- |
remote remote-ip |
Specifies the IP address of a remote PE. It is mainly used in the SR-MPLS and LDP tunnel interworking scenario. |
The value is in dotted decimal notation. |
sr-te |
Specifies the LSP ping type as SR-MPLS TE Policy. |
- |
policy |
Specifies the LSP ping type as SR-MPLS TE Policy. |
- |
policy-name policyname |
Specifies the name of a policy. |
The value is a string of 1 to 31 case-sensitive characters. It cannot contain spaces. |
endpoint-ip endpoint-ip |
Specifies the destination IPv4 address of an SR-MPLS TE policy tunnel. |
The value is in dotted decimal notation. |
color colorid |
Specifies the color ID of an SR-MPLS TE policy. |
The value is an integer ranging from 0 to 4294967295. |
binding-sid bsid |
Specifies the ID of a segment bound to an SR-MPLS TE policy. |
The value is an integer ranging from 16 to 1048575. |
remote-fec |
Indicates the remote FEC type. This parameter is used in scenarios where a device running an earlier version interworks with a device running a later version. This parameter specifies the FEC that can be identified by a device running an earlier version to implement interworking with a device running a later version. |
- |
ldp remotemasklen |
Specifies the mask length for the IP address of a remote LDP FEC. |
The value is an integer ranging from 0 to 32. |
remoteipaddr |
Specifies the IP address of a remote LDP FEC. |
The value is in dotted decimal notation. |
nil |
Specifies the Nil FEC type. |
- |
Usage Scenario
If a fault occurs on an LSP on an MPLS network, run the ping lsp command to check the network connectivity, and then run the tracert lsp command to locate the fault.
The ping lsp command uses MPLS Echo Request packets and MPLS Echo Reply packets to detect the connectivity of LSPs. The packets are sent in UDP packets and the port number is 3503. The receiver distinguishes these two types of packets from other packets based on the port number. An MPLS Echo Request packet carries the FEC information to be checked and is sent along the same LSP as other packets that belong to this FEC. In this manner, the LSP is checked. MPLS Echo Request packets are forwarded to the destination using MPLS, whereas MPLS Echo Reply packets are forwarded to the source using IP. LSP ping can be used to check the following types of links:Prerequisites
Before using the ping lsp command, ensure that the MPLS module has been enabled and is working properly.
Configuration Impact
<HUAWEI> ping lsp sr-te policy policy-name test
LSP PING FEC: Nil FEC : 100 data bytes, press CTRL_C to break
sr-te policy's segment list:
Preference : 300; Path Type: main; Protocol-Origin : local; Originator: 0, 0.0.0.0; Discriminator: 300; Segment-List ID : 1; Xcindex : 1
Reply from 3.3.3.9: bytes=100 Sequence=1 time=13 ms Reply from 3.3.3.9: bytes=100 Sequence=2 time=9 ms
Reply from 3.3.3.9: bytes=100 Sequence=3 time=2 ms
Reply from 3.3.3.9: bytes=100 Sequence=4 time=3 ms
Reply from 3.3.3.9: bytes=100 Sequence=5 time=6 ms
--- FEC: Nil FEC ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 2/6/13 ms
sr-te policy's segment list:
Preference : 400; Path Type: backup; Protocol-Origin : local; Originator: 0, 0.0.0.0; Discriminator: 400; Segment-List ID : 2; Xcindex : 2
Reply from 3.3.3.9: bytes=100 Sequence=1 time=13 ms
Reply from 3.3.3.9: bytes=100 Sequence=2 time=9 ms
Reply from 3.3.3.9: bytes=100 Sequence=3 time=2 ms
Reply from 3.3.3.9: bytes=100 Sequence=4 time=3 ms
Reply from 3.3.3.9: bytes=100 Sequence=5 time=6 ms
--- FEC: Nil FEC ping statistics ---
5 packet(s) transmitted
5 packet(s) received 0.00% packet loss
<HUAWEI> ping lsp segment-routing ip 10.4.4.4 32 flex-algo 128
LSP PING FEC: SEGMENT ROUTING IPV4 PREFIX 10.4.4.4/32 FLEX-ALGO: 128 : 100 data bytes, press CTRL_C to break
Reply from 10.4.4.4: bytes=100 Sequence=1 time=3 ms
Reply from 10.4.4.4: bytes=100 Sequence=2 time=4 ms
Reply from 10.4.4.4: bytes=100 Sequence=3 time=3 ms
Reply from 10.4.4.4: bytes=100 Sequence=4 time=3 ms
Reply from 10.4.4.4: bytes=100 Sequence=5 time=3 ms
--- FEC: SEGMENT ROUTING IPV4 PREFIX 10.4.4.4/32 FLEX-ALGO: 128 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 3/3/4 ms
<HUAWEI> ping lsp segment-routing ip 3.3.3.9 32 version draft2
LSP PING FEC: SEGMENT ROUTING IPV4 PREFIX 3.3.3.9/32 : 100 data bytes, press CTRL_C to break
Reply from 3.3.3.9: bytes=100 Sequence=1 time=13 ms
Reply from 3.3.3.9: bytes=100 Sequence=2 time=9 ms
Reply from 3.3.3.9: bytes=100 Sequence=3 time=2 ms
Reply from 3.3.3.9: bytes=100 Sequence=4 time=3 ms
Reply from 3.3.3.9: bytes=100 Sequence=5 time=6 ms
--- FEC: SEGMENT ROUTING IPV4 PREFIX 3.3.3.9/32 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 2/6/13 ms
Item | Description |
---|---|
FEC: xxxx ping statistics | Ping statistics.
|
press CTRL_C to break | Instruction on how to stop the ongoing ping test. |
Reply from x.x.x.x | Response from the destination node to each MPLS echo request packet.
If no MPLS echo reply packet is received after the timeout period expires, "Request time out" is displayed. |
Preference | Path priority. |
Path Type | Path type, which can be primary or backup. |
Protocol-Origin | Protocol source:
|
Segment-List ID | Segment list·ID. |
xx data bytes | Length of a sent packet, in bytes. |
Originator | IP address of the. |
Discriminator | Identifier. |
XcIndex | XC index. |
Return Code | Return code. The meanings of different return values are as follows:
|
Subcode | Subcode, indicating the layer of the label. Generally, the value is 1. |