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

Configuring Traffic Statistics Collection

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).
Configuring Traffic Statistics Collection

Configuring Traffic Statistics Collection

Introduction

Traffic statistics collection allows a device to collect packets entering and leaving the device by category, and is used together with features such as interfaces, VPN, MPLS, and network management. When the network communication is abnormal or the network topology needs to be optimized, you can use traffic statistics collection to rapidly locate network faults or correctly deploy services.

The traffic statistics collection function can be implemented in either of the following ways:

  • Configure traffic statistics collection.

    Run the statistics enable command to enable the traffic statistics collection function in normal service deployment scenarios.

    For example, to enable the traffic statistics collection function for a VLAN, run the statistics enable command in the VLAN view. Statistics can be collected on packets that traverse a specified network, for example, packets traversing VLAN 2. The statistics include the total number of received and sent packets and the number of unicast, multicast, or discarded packets. The actual statistics depend on the command outputs of features.

  • Use the Modular QoS Command-Line Interface (MQC) to configure a traffic classifier and a traffic behavior, and bind them to a traffic policy.

    The MQC provides granular packet classification and traffic statistics collection. You can define various conditions to match packets. The conditions include the source IP address, port number, and ACL rule. The MQC collects statistics on all packets that match specified conditions. For example, if you specify conditions to match packets at the VXLAN or GRE tunnel level, the MQC collects statistics on packets traversing all VXLAN or GRE tunnels without distinguishing the tunnel ID. The statistics include the numbers of forwarded and discarded packets and bytes, and the number of packets and bytes discarded by filtering or CAR.

NOTE:

Traffic statistics collection only facilitates fault locating. According to the troubleshooting roadmap, select a proper traffic statistics collection method, and send collected information to Huawei technical support for further analysis.

Service Deployment

You can run the statistics enable command to enable the traffic statistics collection function. However, enabling the function will degrade the performance. For details, see CE Series Switches Forwarding Performance.

The following uses traffic statistics collection about a VLAN as an example to describe how to configure traffic statistics collection for a VLAN, and how to check and clear traffic statistics about a VLAN. Configuration examples in this document provide guidance for enabling the traffic statistics collection function after services are deployed properly.

# Enable traffic statistics collection in VLAN 10.

<HUAWEI> system-view
[~HUAWEI] vlan 10
[*HUAWEI-vlan10] statistics enable
[*HUAWEI-vlan10] commit

# Check traffic statistics.

<HUAWEI> display vlan 10 statistics
Slot: 1                                                                         
--------------------------------------------------------------------------      
Item                                   Packets                       Bytes      
--------------------------------------------------------------------------      
Inbound                                    0                           0         //No packet enters VLAN 10.
Outbound                                   1                          86        //One packet is sent out from VLAN 10.
--------------------------------------------------------------------------

# Clear traffic statistics.

Run the reset vlan vlan-id statistics command in the user view to clear traffic statistics in a specified VLAN.

Precautions

For traffic statistics collection in a VLAN, MQC-based traffic statistics collection, traffic statistics collection on a VLANIF interface, and traffic statistics collection on 5-tuple information of IP packets, their priorities are described as follows:

For versions earlier than V100R006C00: traffic statistics collection in a VLAN > MQC-based traffic statistics collection > traffic statistics collection on a VLANIF interface. If two or all of them are configured, only the traffic statistics collection function with the highest priority takes effect.

For V100R006C00 and later versions, Table 1-1 lists the priorities of the traffic statistics collection functions.

Table 1-1 Priority

Model

Priority

CE5880EI, CE6880EI, and CE12800E equipped with ED-E, EG-E, or EGA-E series cards

Traffic statistics collection in a VLAN takes precedence over traffic statistics collection on a VLANIF interface. Both of them can be used together with traffic statistics collection on 5-tuple information of IP packets or MQC-based traffic statistics collection.

CE6850EI, CE6810EI, CE6810LI, CE5855EI, and CE5810EI

CE12800E equipped with FD-X series cards

The traffic statistics collection functions are listed in descending order of priority as follows: traffic statistics collection on 5-tuple information of IP packets > traffic statistics collection in a VLAN > traffic statistics collection on a VLANIF interface. MQC-based traffic statistics collection can be used together with the preceding traffic statistics collection functions.

CE12800 series switches, CE6870EI, and CE6875EI

The traffic statistics collection functions are listed in descending order of priority as follows: traffic statistics collection on 5-tuple information of IP packets > MQC-based traffic statistics collection > traffic statistics collection on a VLANIF interface. Traffic statistics collection in a VLAN can be used together with the preceding traffic statistics collection functions.

Other models and cards

The traffic statistics collection functions are listed in descending order of priority as follows: traffic statistics collection on 5-tuple information of IP packets > traffic statistics collection on a VLANIF interface. MQC-based traffic statistics collection and traffic statistics collection in a VLAN can be used together with the preceding traffic statistics collection functions.

This method is easy to configure and is mainly used for normal service deployment. If traffic on the network is abnormal and fault locating is required, you can monitor specific flows, that is, MQC, to implement granular packet classification and traffic statistics collection.

Monitoring Specific Flows

Monitoring specific flows refers to the service of monitoring traffic based on the MQC to facilitate fault locating.

MQC-based traffic statistics collection involves the following scenarios:

  • Basic scenario: The if-match command is used to match common packets.
  • Tunnel encapsulation scenario: The if-match command is used to match inner packets after tunnel encapsulation, including packets encapsulated by MPLS, GRE, and VXLAN tunnels.
NOTE:

You are advised to use MQC-based traffic statistics collection in the inbound direction of an interface. To collect statistics on outgoing traffic of an interface, configure MQC-based traffic statistics collection in the inbound direction of an interface on a downstream device.

This section uses the VXLAN tunnel to describe how to configure MQC-based traffic statistics collection on tunnels.

On a VXLAN network, you can run the if-match vxlan command to match VXLAN packets based on VXLAN inner packet information (including VXLAN tags, source and destination IP addresses, and source and destination MAC addresses), and collect statistics on these packets. Therefore, network status can be checked and faults can be located. This function is applicable to V100R005C00 and later versions.

Figure 1-1 VXLAN networking diagram

# Collect statistics on original packets entering a leaf node. Apply a traffic policy on a physical interface, a Layer 2 sub-interface, or a BD of the leaf node in the inbound direction to match the source and destination IP addresses of the original packets. As shown in Figure 1-1, statistics on packets sent from Host1 to Host2 are collected on Leaf1. The configuration procedure is as follows:

<Leaf1> system-view 
[~Leaf1] acl 3001
[*Leaf1-acl4-advance-3001] rule 5 permit ip source 192.168.10.1 0 destination 192.168.20.1 0 
[*Leaf1-acl4-advance-3001] quit 
[*Leaf1] traffic classifier c1 
[*Leaf1-classifier-c1] if-match acl 3001 
[*Leaf1-classifier-c1] quit
[*Leaf1] traffic behavior b1
[*Leaf1-behavior-b1] statistics enable
[*Leaf1-behavior-b1] quit
[*Leaf1] traffic policy p1
[*Leaf1-trafficpolicy-p1] classifier c1 behavior b1
[*Leaf1-trafficpolicy-p1] quit
[*Leaf1] interface 10ge 1/0/2.1 mode l2
[*Leaf1-10GE1/0/2.1] traffic-policy p1 inbound    //Apply a traffic policy in the inbound direction of the Layer 2 sub-interface.
[*Leaf1-10GE1/0/2.1] quit
[*Leaf1] commit

# Collect statistics on VXLAN packets forwarded to the spine or leaf node.

  • If the switch only transparently transmits VXLAN packets (that is, it does not decapsulate VXLAN packets), apply a traffic policy in the inbound direction of the physical interface, and run the if-match vxlan transit command to match VXLAN inner packet information. This method is applicable only to CE12800, CE6870EI and CE6875 EI switches.
    Take the spine node in Figure 1-1 as an example. If the spine node only transparently transmits VXLAN packets, the configuration procedure is as follows:
    <Spine> system-view 
    [~Spine] traffic classifier c2 
    [*Spine-classifier-c2] if-match vxlan transit tag-format none inner-source-ip 192.168.10.1 mask 32 inner-destination-ip 192.168.20.1 mask 32    //If the VXLAN packet is untagged, the value of tag-format displays none; if the VXLAN packet carries one tag, the value displays single.
    [*Spine-classifier-c2] quit
    [*Spine] traffic behavior b2 
    [*Spine-behavior-b2] statistics enable 
    [*Spine-behavior-b2] quit 
    [*Spine] traffic policy p2 
    [*Spine-trafficpolicy-p2] classifier c2 behavior b2 
    [*Spine-trafficpolicy-p2] quit 
    [*Spine] interface 10ge 1/0/1 
    [*Spine-10GE1/0/1] traffic-policy p2 inbound //Apply a traffic policy in the inbound direction of the physical interface.
    [*Spine-10GE1/0/1] quit 
    [*Spine] commit
  • If the switch decapsulates VXLAN packets, apply a traffic policy in the inbound direction of the physical interface. For CE12800, CE6870EI, and CE6875EI switches, run the if-match vxlan command to match VXLAN inner packet information. For other switch models, due to VXLAN packet processing differences from the CE12800, CE6870EI and CE6875EI, run the if-match acl command to match inner packet information.

    For CE12800, CE6870EI, and CE6875EI switches, as shown in Figure 1-1, statistics on VXLAN packets forwarded from Spine to Leaf2 are collected on Leaf2. The configuration procedure is as follows:

    <Leaf2> system-view 
    [~Leaf2] traffic classifier c2 
    [*Leaf2-classifier-c2] if-match vxlan tag-format none inner-source-ip 192.168.10.1 mask 32 inner-destination-ip 192.168.20.1 mask 32    //If the VXLAN packet is untagged, the value of tag-format displays none; if the VXLAN packet carries one tag, the value displays single.
    [*Leaf2-classifier-c2] quit
    [*Leaf2] traffic behavior b2 
    [*Leaf2-behavior-b2] statistics enable 
    [*Leaf2-behavior-b2] quit 
    [*Leaf2] traffic policy p2 
    [*Leaf2-trafficpolicy-p2] classifier c2 behavior b2 
    [*Leaf2-trafficpolicy-p2] quit 
    [*Leaf2] interface 10ge 1/0/1 
    [*Leaf2-10GE1/0/1] traffic-policy p2 inbound    //Apply a traffic policy in the inbound direction of the physical interface.
    [*Leaf2-10GE1/0/1] quit 
    [*Leaf2] commit

    For other CE series switches excluding the CE12800, CE6870EI, and CE6875EI, as shown in Figure 1-1, statistics on VXLAN packets forwarded from Spine to Leaf2 are collected on Leaf2. The configuration procedure is as follows:

    <Leaf2> system-view 
    [~Leaf2] acl 3001
    [*Leaf2-acl4-advance-3001] rule 5 permit ip source 192.168.10.1 0 destination 192.168.20.1 0 
    [*Leaf2-acl4-advance-3001] quit 
    [*Leaf2] traffic classifier c2
    [*Leaf1-classifier-c2] if-match acl 3001 
    [*Leaf2-classifier-c2] quit
    [*Leaf2] traffic behavior b2 
    [*Leaf2-behavior-b2] statistics enable 
    [*Leaf2-behavior-b2] quit 
    [*Leaf2] traffic policy p2 
    [*Leaf2-trafficpolicy-p2] classifier c2 behavior b2 
    [*Leaf2-trafficpolicy-p2] quit 
    [*Leaf2] interface 10ge 1/0/1 
    [*Leaf2-10GE1/0/1] traffic-policy p2 inbound    //Apply a traffic policy in the inbound direction of the physical interface.
    [*Leaf2-10GE1/0/1] quit 
    [*Leaf2] commit

# Check traffic statistics. The command output on Leaf1 is used as an example.

<Leaf1> display traffic-policy statistics interface 10ge 1/0/2.1 rule-base 
Traffic policy: p1, inbound 
-------------------------------------------------------------------------------- 
Classifier: c1, Behavior: b1 
 Slot: 1 
----------------------------------------------------------------------------
ACL 3001, rule 5 permit ip source 192.168.10.1 0 destination 192.168.20.1 0 
Passed Packets             10, Passed Bytes                 1060 
Passed pps                   0, Passed bps                   0 
Dropped Packets              0, Dropped Bytes                0 
Dropped pps                  0, Dropped bps                  0 
----------------------------------------------------------------------------

# Clear traffic statistics.

Run the reset traffic-policy statistics interface interface-type interface-number inbound command in any view to clear traffic statistics on a specified interface.

Related Information

For details about how to configure traffic statistics collection, precautions for traffic statistics collection, and how to check and clear traffic statistics in service deployment and tunnel scenarios, see CloudEngine Series Switches Traffic Statistics Collection.

Translation
Download
Updated: 2019-07-01

Document ID: EDOC1100086950

Views: 389

Downloads: 21

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