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 V200R012C00 NETCONF YANG API Reference

This document describes the NETCONF YANG 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).
Real-Time Traffic Statistics

Real-Time Traffic Statistics

This section describes the configuration model of real-time traffic statistics and provides examples of XML packets.

Data Model for Real-Time Traffic Statistics

The file name of the configuration model for real-time traffic statistics is huawei-capture.yang.

Table 2-281  Real-time traffic statistics configuration objects
Object Description Value Range Remarks
/huawei-capture:trace-pkt/input/destination-ip-address Specifies the destination IPv4 address of packets. The value is in dotted decimal notation. N/A
/huawei-capture:trace-pkt/input/source-ip-address Specifies the source IPv4 address of packets. The value is in dotted decimal notation. N/A
Table 2-282  Real-time traffic statistics result query
Object Description Value Range Remarks
/huawei-capture:get-pkt-trace Displays real-time traffic statistics results. N/A Parameters under this object can be configured but do not take effect.
Table 2-283  Information returned by the switch after the real-time traffic statistics are queried
Object Description
/huawei-capture:get-pkt-trace/output/input-interface/packet-interface-list Displays the real-time traffic statistics result of the packets received by a port:
  • packet-interface: port name
  • packet-counter: total number of packets received by the port
/huawei-capture:get-pkt-trace/output/output-interface/packet-interface-list Indicates the real-time traffic statistics result of the packets sent by a port:
  • packet-interface: port name
  • packet-counter: total number of packets sent by the port

Example for Configuring Real-Time Traffic Statistics

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

Table 2-284  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>

Example for Viewing the Real-Time Traffic Statistics Result

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

Table 2-285  Viewing the real-time traffic statistics result

Operation

XPATH

rpc

/huawei-capture:get-pkt-trace
Request Example
<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
  <huawei-capture:get-pkt-trace xmlns:huawei-capture="urn:huawei:params:xml:ns:yang:huawei-capture"/>
</rpc>
Response Example
<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
  <data>
    <input-interface>
      <packet-interface-list>
        <packet-interface>GE0/0/4</packet-interface>
        <packet-counter>834258</packet-counter>
      </packet-interface-list>
      <packet-interface-list>
        <packet-interface>GE0/0/12</packet-interface>
        <packet-counter>27913</packet-counter>
      </packet-interface-list>
    </input-interface>
    <output-interface>
      <packet-interface-list>
        <packet-interface>GE0/0/4</packet-interface>
        <packet-counter>27953</packet-counter>
      </packet-interface-list>
      <packet-interface-list>
        <packet-interface>GE0/0/12</packet-interface>
        <packet-counter>833231</packet-counter>
      </packet-interface-list>
    </output-interface>
  </data>
</rpc-reply>
Translation
Download
Updated: 2018-09-01

Document ID: EDOC1100037962

Views: 6882

Downloads: 8

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