< Home

Running the tracert Command

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

Table 1 Running the tracert command

Operation

XPATH

rpc

  • /huawei-traceroute:tracert/test-name
  • /huawei-traceroute:tracert/ipv4-tracert/destination

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

# 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 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>
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic