< Home

Example for Configuring Real-Time Traffic Statistics

This section provides a sample of configuring real-time traffic statistics using the rpc method.

Table 1 Configuring real-time traffic statistics

Operation

XPATH

rpc

  • /huawei-capture:trace-pkt/input/destination-ip-address
  • /huawei-capture:trace-pkt/input/destination-port
  • /huawei-capture:trace-pkt/input/destination-mac
  • /huawei-capture:trace-pkt/input/source-ip-address
  • /huawei-capture:trace-pkt/input/source-port
  • /huawei-capture:trace-pkt/input/source-mac
  • /huawei-capture:trace-pkt/input/protocol
  • /huawei-capture:trace-pkt/input/timeout

Data Requirements

Item Data Description
Destination IPv4 address of packets 10.10.10.2 Perform real-time traffic statistics on the packets that meet the preceding conditions.
Transport-layer destination port number of packets 4
Destination MAC address of packets 12:34:12:34:12:34
Source IPv4 address of packets 10.10.10.1
Transport-layer source port number of packets 5
Source MAC address of packets 12:34:22:34:ff:ee
Protocol number of packets 6
Timeout interval for real-time traffic statistics 30

Request Example

<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
  <huawei-capture:trace-pkt xmlns:huawei-capture="urn:huawei:params:xml:ns:yang:huawei-capture">
    <huawei-capture:destination-ip-address>10.10.10.2</huawei-capture:destination-ip-address>
    <huawei-capture:destination-port>4</huawei-capture:destination-port>
    <huawei-capture:destination-mac>12:34:12:34:12:34</huawei-capture:destination-mac>
    <huawei-capture:source-ip-address>10.10.10.1</huawei-capture:source-ip-address>
    <huawei-capture:source-port>5</huawei-capture:source-port>
    <huawei-capture:source-mac>12:34:22:34:ff:ee</huawei-capture:source-mac>
    <huawei-capture:protocol>6</huawei-capture:protocol>
    <huawei-capture:timeout>30</huawei-capture:timeout>
  </huawei-capture:trace-pkt>
</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">
  <data>
    <result>respond</result>
  </data>
</rpc-reply>
# Sample of response when the last real-time traffic statistics collection task is still in progress or a packet capture task is being executed on the switch.
<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
  <data>
    <result>processing</result>
  </data>
</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">
  <rpc-error>
    <error-path>/huawei-capture:trace-pkt/timeout</error-path>
    <error-message>Value "301" does not satisfy the constraint "1..300" (range, length, or pattern).</error-message>
  </rpc-error>
</rpc-reply>
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >