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.
Object | Description | Value Range | Remarks |
---|---|---|---|
/huawei-capture:trace-pkt | Collects statistics on the traffic of a single packet flow in real time. | N/A | N/A |
/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/destination-port | Specifies the transport-layer destination port number of packets. | The value is an integer in the range from 0 to 65535. | N/A |
/huawei-capture:trace-pkt/input/destination-mac | Specifies the destination MAC address of packets. | The value is in the format of H:H:H:H:H:H, where H represents a hexadecimal number of 1 to 2 bits. | 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 |
/huawei-capture:trace-pkt/input/source-port | Specifies the transport-layer source port number of packets. | The value is an integer in the range from 0 to 65535. | N/A |
/huawei-capture:trace-pkt/input/source-mac | Specifies the source MAC address of packets. | The value is in the format of H:H:H:H:H:H, where H represents a hexadecimal number of 1 to 2 bits. | N/A |
/huawei-capture:trace-pkt/input/protocol | Specifies the protocol number of packets. | The value is an integer in the range from 1 to 255. | N/A |
/huawei-capture:trace-pkt/input/timeout | Specifies the timeout interval for real-time traffic statistics. | The value is an integer in the range from 1 to 300, in seconds. The default value is 60. | N/A |
/huawei-capture:trace-pkt/input/trace-cancel | Indicates whether to cancel the real-time traffic statistics collection. | The value is of the Boolean type:
|
N/A |
/huawei-capture:trace-multi-pkt | Collects statistics on the traffic of multiple packet flows in real time. | N/A | Currently, only collects statistics on the traffic of a single packet flow in real time is supported. |
/huawei-capture:trace-multi-pkt/input/trace-pkt-list/trace-pkt-id | Specifies the ID of the packet flow. | The value is an integer in the range from 0 to 65535. | N/A |
/huawei-capture:trace-multi-pkt/input/trace-pkt-list/destination-ip-address | Specifies the destination IPv4 address of packets. | The value is in dotted decimal notation. | N/A |
/huawei-capture:trace-multi-pkt/input/trace-pkt-list/destination-port | Specifies the transport-layer destination port number of packets. | The value is an integer in the range from 0 to 65535. | N/A |
/huawei-capture:trace-multi-pkt/input/trace-pkt-list/destination-mac | Specifies the destination MAC address of packets. | The value is in the format of H:H:H:H:H:H, where H represents a hexadecimal number of 1 to 2 bits. | N/A |
/huawei-capture:trace-multi-pkt/input/trace-pkt-list/source-ip-address | Specifies the source IPv4 address of packets. | The value is in dotted decimal notation. | N/A |
/huawei-capture:trace-multi-pkt/input/trace-pkt-list/source-port | Specifies the transport-layer source port number of packets. | The value is an integer in the range from 0 to 65535. | N/A |
/huawei-capture:trace-multi-pkt/input/trace-pkt-list/source-mac | Specifies the source MAC address of packets. | The value is in the format of H:H:H:H:H:H, where H represents a hexadecimal number of 1 to 2 bits. | N/A |
/huawei-capture:trace-multi-pkt/input/trace-pkt-list/protocol | Specifies the protocol number of packets. | The value is an integer in the range from 1 to 255. | N/A |
/huawei-capture:trace-multi-pkt/input/trace-pkt-list/timeout | Specifies the timeout interval for real-time traffic statistics. | The value is an integer in the range from 1 to 300, in seconds. The default value is 60. | N/A |
/huawei-capture:trace-multi-pkt/input/trace-pkt-list/trace-cancel | Indicates whether to cancel the real-time traffic statistics collection. | The value is of the Boolean type:
|
N/A |
Object | Description | Value Range | Remarks |
---|---|---|---|
/huawei-capture:get-pkt-trace | Displays the real-time traffic statistics of a single packet flow. | N/A | Parameters under this object can be configured but do not take effect. |
/huawei-capture:get-multi-pkt-trace | Displays the real-time traffic statistics of multiple packet flows. | N/A | Parameters under this object can be configured but only trace-pkt-id takes effect. |
/huawei-capture:get-multi-pkt-trace/input/trace-pkt-list/trace-pkt-id | Displays real-time traffic statistics of the packet flow with a specified ID. | The value is an integer in the range from 0 to 65535. | Currently, only one packet flow can be specified. |
Object | Description |
---|---|
/huawei-capture:get-multi-pkt-trace/output/trace-pkt-reply/trace-pkt-id | Indicates the ID of a packet flow. |
|
Displays the real-time traffic statistics result of the packets
received by a port:
|
|
Indicates the real-time traffic statistics result of the packets
sent by a port:
|
Item | Description |
---|---|
esn | Indicates the device ESN. |
trace-pkt-id | Indicates the ID of a packet flow. |
result | Indicates the result of real-time traffic statistics collection. |
input-interface | Indicates the interface that receives a packet flow. |
input-counter | Indicates the number of received packets. |
output-interface | Indicates the interface that sends a packet flow. |
output-counter | Indicates the number of sent packets. |
Example for Configuring Real-Time Traffic Statistics
This section provides a sample of configuring real-time traffic statistics using the rpc method.
Operation |
XPATH |
---|---|
rpc |
|
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
<?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>
<?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>
<?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.
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>GE1/0/4</packet-interface> <packet-counter>834258</packet-counter> </packet-interface-list> <packet-interface-list> <packet-interface>GE1/0/12</packet-interface> <packet-counter>27913</packet-counter> </packet-interface-list> </input-interface> <output-interface> <packet-interface-list> <packet-interface>GE1/0/4</packet-interface> <packet-counter>27953</packet-counter> </packet-interface-list> <packet-interface-list> <packet-interface>GE1/0/12</packet-interface> <packet-counter>833231</packet-counter> </packet-interface-list> </output-interface> </data> </rpc-reply>