< Home

Configuring an sFlow Sampling Mode

Context

An sFlow agent provides two sampling modes:

  • Flow sampling: An sFlow agent samples 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.

    On the S2720-EI, S5720I-SI, S5720-LI, S5735-L, S5735S-L, S5735S-L-M, S5720S-LI, S5720S-SI, S5720-SI, S5735-S, S5735S-S, S5735-S-I, S5730S-EI, S5730-SI, S6720-LI, S6720S-LI, S6720S-SI, and S6720-SI, packets are sampled in the ingress and egress on an interface and sFlow packets do not contain outbound/inbound interface information that was carried in sampled packets.

  • 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. It is recommended that both sampling modes be configured.

To ensure sampling performance, you are advised to configure no more than eight sFlow sampling interfaces.

Procedure

  • Configure flow sampling.
    1. Run system-view

      The system view is displayed.

    2. Run interface interface-type interface-number

      The interface view is displayed.

    3. Run sflow flow-sampling collector { collector-id | all }

      The target sFlow collector that receives sFlow packets is specified.

      By default, no target sFlow collector is specified.

      When the first target sFlow collector is configured on an interface using sflow flow-sampling collector, flow sampling is enabled on this interface.

      When the last target sFlow collector is deleted on an interface using undo sflow flow-sampling collector, flow sampling is disabled on this interface.

    4. (Optional) Run sflow flow-sampling { inbound | outbound }

      Flow sampling is configured in a specified direction on the interface.

      By default, flow sampling is enabled in both ingress and egress.

    5. (Optional) Run sflow flow-sampling rate rate

      A sampling rate is set.

      By default, the sampling rate on a 40GE interface is 1/20480 and on other types of interfaces is 1/2048.

    6. (Optional) Run sflow flow-sampling max-header length

      The maximum bytes of data that can be copied from a sampled packet is set.

      By default, this number is 64 bytes.

  • Configure counter sampling.
    1. Run system-view

      The system view is displayed.

    2. Run interface interface-type interface-number

      The interface view is displayed.

    3. Run sflow counter-sampling collector { collector-id | all }

      The sFlow collector that receives sFlow packets is specified.

      By default, no target sFlow collector is specified.

      When the first target sFlow collector is created on an interface using sflow counter-sampling collector, counter sampling is enabled on the interface.

      When the last target sFlow collector is deleted on an interface using undo sflow counter-sampling collector, counter sampling is disabled on the interface.

    4. (Optional) Run sflow counter-sampling interval interval

      The counter sampling interval is set.

      By default, the counter sampling interval on an interface is 10s.

      Flow sampling and counter sampling can only be used on Layer 2 physical interfaces, including member interfaces of an Eth-Trunk, but cannot be used on Eth-Trunk interfaces or Layer 3 interfaces.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >