How to configure sFlow sampling on a CE series switch

5

An sFlow agent provides two sampling modes: flow sampling and counter sampling.
1. Flow sampling: An sFlow agent samples and analyzes packets in a direction on a specified interface based on a sampling rate, encapsulates the analysis result into sFlow packets, and then sends the sFlow packets to an sFlow collector.
2. Counter sampling: An sFlow agent periodically collects traffic statistics on interfaces, processor, and memory, encapsulates collected information into sFlow packets, and sends the sFlow packets to an sFlow collector.
Flow sampling and counter sampling are independent of each other. Flow sampling obtains information about flows of a specified service, whereas counter sampling obtains traffic statistics on an interface.

# Set the flow sampling rate on 10GE1/0/1 to 32768.
system-view
[~HUAWEI] interface 10ge/0/1
[~HUAWEI-10GE1/0/1] sflow sampling collector 1 rate 32768 inbound outbound
[*HUAWEI-10GE1/0/1] commit
# Set the counter sampling interval on 10GE1/0/1 to 20s.
system-view
[~HUAWEI] interface 10ge/0/1
[~HUAWEI-10GE1/0/1] sflow counter collector 1
[*HUAWEI-10GE1/0/1] commit

Other related questions:
How to configure sFlow agent and sFlow collector on a CE series switch
The Sampled Flow (sFlow) system involves an sFlow agent embedded in a Huawei switch and a remote sFlow collector. The sFlow agent obtains traffic statistics from an interface using sampling and encapsulates them into sFlow packets. The collector analyzes the sFlow packets received from the agent and displays traffic statistics in a report. # Set the IP addresses of an sFlow agent and collector to 10.1.1.1 and 10.1.2.1 respectively, and set the sFlow packet sending mode to enhanced. Retain the default packet length 1400. system-view [~HUAWEI] sflow agent ip 10.1.1.1 [*HUAWEI] sflow collector 1 ip 10.1.2.1 enhanced [*HUAWEI] commit Note: 1. The enhanced mode is supported by only CE12800 series switches. In V100R500C10 and V100R500C00, the enhanced mode is recommended when the collector is located on the network connected to a service port. In the enhanced mode, the switch sends sFlow packets to the collector through service cards. In V100R006C00 and later versions, you do not need to configure the enhanced mode. The switch will determine to send sFlow packets through the management port or service cards based on the routing information on the collector. 2. In the enhanced mode, the switch cannot send sFlow packets through the management port.

How to configure sFlow on S series switches
For S series switches (except S1700), two sampling modes are provided, including flow sampling and counter sampling. 1. Flow sampling is based on data packets. An sFlow agent samples and analyzes packets in a direction on a specified interface based on the sampling ratio. Then the sFlow agent encapsulates the original packets and parsing result into sFlow packets, and sends the sFlow packets to an sFlow collector. 2. Counter sampling is based on time. An sFlow agent periodically collects traffic statistics, processor statistics, and memory usage on an interface, encapsulates collected information in sFlow packets, and sends the sFlow packets to an sFlow collector. Flow sampling and counter sampling are independent of each other. Flow sampling obtains information about flows of a specified service, whereas counter sampling obtains traffic statistics on an interface. Counter sampling is applicable for entire network status monitoring. It is recommended that you configure both the sampling modes. The following is a configuration example: 1. Configure sFlow agent and sFlow collector information. [HUAWEI] sflow agent ip 10.1.10.1 //Configure an IP address for the sFlow agent. [HUAWEI] sflow collector 2 ip 10.1.10.2 description netserver //Configure sFlow collector information: ID 2, IP address 10.1.10.2, and description netserver for the sFlow collector. 2. Configure flow sampling. [HUAWEI] interface gigabitethernet 1/0/2 [HUAWEI-GigabitEthernet1/0/2] sflow flow-sampling rate 4000 //Set the flow sampling ratio. [HUAWEI-GigabitEthernet1/0/2] sflow flow-sampling collector 2 //Specify sFlow collector 2 as the target collector to receive sFlow packets sent by the sFlow agent. 3. Configure counter sampling. [HUAWEI-GigabitEthernet1/0/2] sflow counter-sampling interval 120 //Set the counter sampling interval to 120s. [HUAWEI-GigabitEthernet1/0/2] sflow counter-sampling collector 2 //Specify sFlow collector 2 as the target collector to receive sFlow packets sent by the sFlow agent. [HUAWEI-GigabitEthernet1/0/2] quit [HUAWEI] quit

If you have more questions, you can seek help from following ways:
To iKnow To Live Chat
Scroll to top