Tracert
This section describes the configuration model of the tracert command and provides examples of XML packets.
Data Model
The configuration model file matching the tracert command is huawei-traceroute.yang.
Object |
Description |
Value |
Remarks |
---|---|---|---|
/huawei-traceroute:tracert/test-name | Indicates the instance name of the tracert command. |
The value is a string of 1 to 32 case-sensitive characters. |
An instance uniquely identifies one tracert command. Since the tracert command is executed in asynchronous mode, this object is used by the controller to associate the tracert command with a notification message. |
/huawei-traceroute:tracert/ipv4-tracert/destination | Indicates the domain name or IPv4 address of a destination host. |
|
N/A |
/huawei-traceroute:tracert/ipv4-tracert/source-ip-address | Indicates the source IPv4 address of ICMP request packets. |
The value is in dotted decimal notation. It must be an existing IPv4 address on the switch. |
N/A |
/huawei-traceroute:tracert/ipv4-tracert/first-ttl | Indicates the initial TTL value of ICMP request packets. |
The value is an integer that ranges from 1 to 255. The default value is 1. |
N/A |
/huawei-traceroute:tracert/ipv4-tracert/max-ttl | Indicates the maximum TTL value of ICMP request packets. |
The value is an integer that ranges from 1 to 255. The default value is 30. |
N/A |
/huawei-traceroute:tracert/ipv4-tracert/probe-count | Indicates the number of ICMP request packets to be sent each time. |
The value is an integer that ranges from 1 to 5. The default value is 3. |
N/A |
/huawei-traceroute:tracert/ipv4-tracert/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-traceroute:tracert/ipv4-tracert/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-traceroute:tracert/ipv4-tracert/udp-port | Indicates the UDP port number of a destination host. |
The value is an integer that ranges from 0 to 65535. The default value is 33434. |
N/A |
/huawei-traceroute:tracert/ipv4-tracert/packet-size | Indicates the length of ICMP request packets excluding the IPv4 and ICMP headers. |
The value is an integer that ranges from 12 to 9600, in bytes. The default value is 12. |
N/A |
/huawei-traceroute:tracert/ipv6-tracert/destination | Indicates the domain name or IPv6 address of a destination host. |
|
N/A |
/huawei-traceroute:tracert/ipv6-tracert/udp-port | Indicates the UDP port number of a destination host. | The value is an integer that ranges from 1 to 65535. The default value is 33434. | N/A |
/huawei-traceroute:tracert/ipv6-tracert/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 20. | N/A |
Since running the tracert command takes time, the switch returns an RPC response first after receiving the RPC request for running the tracert command sent by the controller. After running the tracert command and obtaining the command output, the switch notifies the controller of the execution result by a notification message.
Item |
Description |
---|---|
test-name |
Indicates the instance name of the tracert command, which matches the /huawei-traceroute:tracert/test-name object. |
destination |
Indicates the domain name, IPv4 address, or IPv6 address of a destination host. |
max-hops |
Indicates the maximum number of hops for sending ICMP request packets. |
packet-size | Indicates the length of ICMP request packets. |
hop-index | Indicates the sequence number of the next hop. |
hop-address | Indicates the IPv4 or IPv6 address of the next hop. |
probe-index | Indicates the index of ICMP request packets. |
result | Indicates test results. |
delta-time | Indicates the test duration, in milliseconds. |
complete | Indicates whether the notification message is the last one:
|
Running the tracert Command
This section describes how to run the tracert command using the rpc method.
Operation |
XPATH |
---|---|
rpc |
|
Data Requirements
Item |
Data |
Description |
---|---|---|
Instance name of the tracert command |
aabb |
Set the instance name of the tracert command to aabb. |
Destination host |
192.168.20.1 |
Set the IPv4 address of the destination host to 192.168.20.1. |
Request Example
<?xml version="1.0" encoding="UTF-8"?> <rpc message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <hw-tracert:tracert xmlns:hw-tracert="urn:huawei:params:xml:ns:yang:huawei-traceroute"> <hw-tracert:test-name>aabb</hw-tracert:test-name> <hw-tracert:ipv4-tracert> <hw-tracert:destination>192.168.20.1</hw-tracert:destination> </hw-tracert:ipv4-tracert> </hw-tracert:tracert> </rpc>
Response Example
<?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>
<?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 tracert command to the controller through a notification message.
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0"> <eventTime>2017-06-12T16:54:03Z</eventTime> <tracert-case-result xmlns="urn:huawei:params:xml:ns:yang:huawei-traceroute"> <test-name>aabb</test-name> <destination>192.168.20.1</destination> <max-hops>30</max-hops> <packet-size>12</packet-size> <hops> <hop-index>1</hop-index> <hop-address>192.168.20.2</hop-address> <probes> <probe-index>1</probe-index> <result>succeed</result> <delta-time>5</delta-time> </probes> <probes> <probe-index>2</probe-index> <result>succeed</result> <delta-time>4</delta-time> </probes> <probes> <probe-index>3</probe-index> <result>succeed</result> <delta-time>4</delta-time> </probes> </hops> <complete>true</complete> </tracert-case-result> </notification>