No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

S600-E V200R011C10 NETCONF YANG API Reference

This document describes the NETCONF API functions supported by the switch, including the data model and samples.
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Ping

Ping

This section describes the configuration model of the ping command and provides examples of XML packets.

Data Model

The configuration model file matching the ping command is huawei-ping.yang.

Table 2-251  Configuration objects of the ping command

Object

Description

Value

Remarks

/huawei-ping:ping/test-name

Indicates the instance name of the ping command.

The value is a string of 1 to 32 case-sensitive characters.

An instance uniquely identifies one ping command. Since the ping command is executed in asynchronous mode, this object is used by the controller to associate the ping command with a notification message.

/huawei-ping:ping/ipv4-ping/destination

Indicates the domain name or IPv4 address of a destination host.

  • If the value is a domain name, it is a string of 1 to 255 case-sensitive characters without spaces. If the string is enclosed in double quotation marks (" "), the string can contain spaces.
  • If the value is an IPv4 address, it is in dotted decimal notation.

N/A

/huawei-ping:ping/ipv4-ping/source-ip-address

Indicates the source IPv4 address of ICMP request packets to be sent.

The value is in dotted decimal notation. It must be an existing IPv4 address on the switch.

N/A

/huawei-ping:ping/ipv4-ping/count

Indicates the number of ICMP request packets to be sent.

The value is an integer that ranges from 1 to 64. The default value is 5.

N/A

/huawei-ping:ping/ipv4-ping/interval

Indicates the interval at which ICMP request packets are sent.

The value is an integer that ranges from 1 to 3600, in milliseconds. The default value is 500.

N/A

/huawei-ping:ping/ipv4-ping/timeout

Indicates the timeout interval for ICMP response packets.

The value is an integer that ranges from 0 to 10000, in milliseconds. The default value is 2000.

N/A

/huawei-ping:ping/ipv4-ping/packet-size

Indicates the length of ICMP request packets excluding the IPv4 and ICMP headers.

The value is an integer that ranges from 20 to 9600, in bytes. The default value is 56.

N/A

/huawei-ping:ping/ipv4-ping/vpn-instance-name

Indicates the name of a VPN instance to which a destination host belongs.

The value is a string of 1 to 31 characters. It must be an existing VPN instance name on the switch.

N/A

/huawei-ping:ping/ipv4-ping/ttl

Indicates the TTL value of ICMP request packets.

The value is an integer that ranges from 1 to 255. The default value is 255.

N/A

/huawei-ping:ping/ipv4-ping/tos

Indicates the ToS value of ICMP request packets.

The value is an integer that ranges from 0 to 255. The default value is 0.

N/A

/huawei-ping:ping/ipv4-ping/pattern

Indicates pad characters for ICMP request packets.

The value is an integer that ranges from 0 to FFFFFFFF, in hexadecimal notation. By default, the pad character starts from 0x01 and increases in ascending order.

N/A

/huawei-ping:ping/ipv4-ping/do-not-frag

Indicates whether fragmentation is allowed in packet sending.

The value is of the Boolean type:
  • true: Fragmentation is not allowed.
  • false: Fragmentation is allowed.

The default value is false.

This object and ignore-mtu cannot be set to true simultaneously.

/huawei-ping:ping/ipv4-ping/ignore-mtu

Indicates whether to ignore the interface MTU.

The value is of the Boolean type:
  • true: The interface MTU is ignored.
  • false: The interface MTU is not ignored.

The default value is false.

This object and do-not-frag cannot be set to true simultaneously.

/huawei-ping:ping/ipv4-ping/nexthop-address

Indicates the next-hop IPv4 address.

The value is in dotted decimal notation. It must be a reachable next-hop IPv4 address.

The next-hop IPv4 address and vpn-instance-name cannot be specified simultaneously.
/huawei-ping:ping/ipv6-ping/destination Indicates the domain name or IPv6 address of a destination host.
  • If the value is a domain name, it is a string of 1 to 255 case-sensitive characters without spaces. If the string is enclosed in double quotation marks (" "), the string can contain spaces.
  • If the value is an IPv6 address, it contains 128 bits, which are divided into eight groups. Each group contains four hexadecimal digits. The value is in the format of X:X:X:X:X:X:X:X.

N/A

/huawei-ping:ping/ipv6-ping/source-ip-address Indicates the source IPv6 address of ICMPv6 request packets to be sent. The total length of the value is 128 bits, which are divided into eight groups. Each group contains four hexadecimal digits. The value is in the format of X:X:X:X:X:X:X:X. It must be an existing IPv6 address on the switch.

N/A

/huawei-ping:ping/ipv6-ping/count Indicates the number of ICMPv6 request packets to be sent. The value is an integer that ranges from 1 to 64. The default value is 5.

N/A

/huawei-ping:ping/ipv6-ping/interval Indicates the interval at which ICMPv6 request packets are sent. The value is an integer that ranges from 1 to 3600, in milliseconds. The default value is 500.

N/A

/huawei-ping:ping/ipv6-ping/timeout Indicates the timeout interval for ICMPv6 response packets. The value is an integer that ranges from 0 to 10000, in milliseconds. The default value is 2000.

N/A

/huawei-ping:ping/ipv6-ping/packet-size Indicates the length of ICMPv6 request packets excluding the IPv6 and ICMPv6 headers. The value is an integer that ranges from 20 to 9600, in bytes. The default value is 56.

N/A

/huawei-ping:ping/ipv6-ping/vpn-instance-name Indicates the name of a VPN instance to which a destination host belongs. The value is a string of 1 to 31 characters. It must be an existing VPN instance name on the switch.

N/A

/huawei-ping:ping/ipv6-ping/hop-limit Indicates the maximum number of hops for sending ICMPv6 request packets. The value is an integer that ranges from 1 to 255. The default value is 255.

N/A

/huawei-ping:ping/ipv6-ping/traffic-class Indicates the traffic classification of ICMPv6 request packets. The value is an integer that ranges from 0 to 255. The default value is 0.

N/A

NOTE:

Since running the ping command takes time, the switch returns an RPC response first after receiving the RPC request for running the ping command sent by the controller. After running the ping command and obtaining the command output, the switch notifies the controller of the execution result by a notification message.

Table 2-252  Notification message

Item

Description

test-name

Indicates the instance name of the ping command, which matches the /huawei-ping:ping/test-name object.

destination

Indicates the domain name, IPv4 address, or IPv6 address of a destination host.

total-count

Indicates the total number of the sent ICMP or ICMPv6 request packets.

success-count

Indicates the number of received ICMP or ICMPv6 response packets.

loss-rate

Indicates the percentage of ICMP or ICMPv6 request packets with no response to the total number of ICMP or ICMPv6 request packets that have been sent.

rtt-min

Indicates the minimum response time, in milliseconds.

rtt-avg

Indicates the average response time, in milliseconds.

rtt-max

Indicates the maximum response time, in milliseconds.

sequence

Indicates the sequence number of ICMP or ICMPv6 response packets.

data-byte

Indicates the length of ICMP or ICMPv6 response packets, in bytes.

ttl-or-hoplimit

  • Indicates the TTL value of ICMP response packets.
  • Indicates the maximum number of hops for sending ICMPv6 response packets.

rtt

Indicates the response time, in milliseconds.

result

  • The value is succeed when response packets are received.
  • The value is timeout when no response packet is received.
  • The value is a failure cause if the command fails to be executed.

complete

Indicates whether the notification message is the last one:
  • true: The notification message is the last one.
  • false: The notification message is not the last one.

Running the ping Command

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

Table 2-253  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>
Translation
Download
Updated: 2019-10-18

Document ID: EDOC1000178028

Views: 5049

Downloads: 0

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next