163
Configuring a sampler
A sampler provides the packet sampling function. A sampler selects a packet out of sequential packets,
and sends it to the service module for processing.
The following sampling modes are available:
• Fixed mode—The first packet is selected out of a number of sequential packets in each sampling.
• Random mode—Any packet might be selected out of a number of sequential packets in each
sampling. The 5800 series do not support the random mode.
A sampler can be used to sample packets for NetStream. Only the sampled packets are sent and
processed by the traffic monitoring module. Sampling is useful if you have too much traffic and want to
limit the traffic of interest to be analyzed. The sampled data is statistically accurate and decreases the
impact on forwarding capacity of the device. For more information about NetStream, see “Configuring
Net
Stream.”
Creating a sampler
To do… Use the command… Remarks
1. Enter system view.
system-view —
2. Create a sampler.
sampler sampler-name mode
fixed packet-interval rate
Required.
The rate argument specifies the sampling
rate, which equals the 2 to the power of rate.
For example, if the rate is 8, one packet out
of 256 packets (2 to the power of 8) is
sampled in each sampling; if the rate is 10,
one packet out of 1024 packets (2 to the
power of 10) is sampled.
Displaying and maintaining sampler
To do… Use the command… Remarks
Display configuration and running
information about the sampler
display sampler [ sampler-name ]
[ slot slot-number ] [ | { begin |
exclude | include } regular-
expression ]
Available in any view
Clear running information about the
sampler
reset sampler statistics [ sampler-
name ]
Available in user view