< Home

Running the ping Command

This section describes how to run the ping command using the rpc method.

Table 1 Running the ping command

Operation

XPATH

rpc

  • /huawei-ping:ping/test-name
  • /huawei-ping:ping/ipv4-ping/destination
  • /huawei-ping:ping/ipv4-ping/source-ip-address
  • /huawei-ping:ping/ipv4-ping/count
  • /huawei-ping:ping/ipv4-ping/interval
  • /huawei-ping:ping/ipv4-ping/timeout
  • /huawei-ping:ping/ipv4-ping/packet-size
  • /huawei-ping:ping/ipv4-ping/ttl
  • /huawei-ping:ping/ipv4-ping/tos
  • /huawei-ping:ping/ipv4-ping/pattern
  • /huawei-ping:ping/ipv4-ping/do-not-frag

Data Requirements

Item

Data

Description

Instance name of the ping command

test1

Set the instance name of the ping command to test1.

Destination host

192.168.10.1

Set the IPv4 address of the destination host to 192.168.10.1.

Source IPv4 address of ICMP request packets

192.168.50.1

Set the source IPv4 address of ICMP request packets to 192.168.50.1.

Number of ICMP request packets to be sent

30

Set the number of ICMP request packets to 30.

Interval at which ICMP request packets are sent

600

Set the interval at which ICMP request packets are sent to 600 milliseconds.

Timeout interval for ICMP response packets

1800

Set the timeout interval for ICMP response packets is 1800 milliseconds.

Length of ICMP request packets excluding the IPv4 and ICMP headers

100

Set the length of ICMP request packets to 100 bytes.

TTL value of ICMP request packets

200

Set the TTL value of ICMP request packets to 200.

ToS value of ICMP request packets

100

Set the ToS value of ICMP request packets to 100.

Pad characters for ICMP request packets

1122aaee

Set the pad characters for ICMP request packets to 1122aaee.

Whether fragmentation is allowed in packet sending

true

Do not allow fragmentation in packet sending.

Request Example

<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
  <hw-ping:ping xmlns:hw-ping="urn:huawei:params:xml:ns:yang:huawei-ping">
    <hw-ping:test-name>test1</hw-ping:test-name>
    <hw-ping:ipv4-ping>
      <hw-ping:destination>192.168.10.1</hw-ping:destination>
      <hw-ping:source-ip-address>192.168.50.1</hw-ping:source-ip-address>
      <hw-ping:count>30</hw-ping:count>
      <hw-ping:interval>600</hw-ping:interval>
      <hw-ping:timeout>1800</hw-ping:timeout>
      <hw-ping:packet-size>100</hw-ping:packet-size>
      <hw-ping:ttl>200</hw-ping:ttl>
      <hw-ping:tos>100</hw-ping:tos>
      <hw-ping:pattern>1122aaee</hw-ping:pattern>
      <hw-ping:do-not-frag>true</hw-ping:do-not-frag>
    </hw-ping:ipv4-ping>
  </hw-ping:ping>
</rpc>

Response Example

# Sample of successful response
<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
  <ok/>
</rpc-reply>
# Sample of failed response
<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
  <error/>
</rpc-reply>

Notification Reporting Result

# The switch reports the execution result of the ping command to the controller through a notification message.

<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
  <eventTime>2017-06-09T16:48:24Z</eventTime>
  <ping-case-result xmlns="urn:huawei:params:xml:ns:yang:huawei-ping">
    <test-name>test1</test-name>
    <destination>192.168.10.1</destination>
    <total-count>30</total-count>
    <success-count>0</success-count>
    <loss-rate>100.00</loss-rate>
    <replys>
      <sequence>1</sequence>
      <data-byte>0</data-byte>
      <ttl-or-hoplimit>0</ttl-or-hoplimit>
      <rtt>0</rtt>
      <result>timeout</result>
    </replys>
    <complete>false</complete>
  </ping-case-result>
</notification>
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic