214
Configuring samplers
A sampler selects a packet from sequential packets and sends the packet to other service modules
for processing. Sampling is useful when you want to limit the volume of traffic to be analyzed. The
sampled data is statistically accurate and sampling decreases the impact on the forwarding capacity
of the device.
The following sampling modes are available:
•
Fixed mode
—The first packet is selected from sequential packets in each sampling.
•
Random mode
—Any packet might be selected from sequential packets in each sampling. This
sampling mode is not supported in the current software version.
A sampler can sample packets for NetStream. Then, only the sampled packets are sent to and
processed by the NetStream module. For more information about NetStream, see "
."
Creating a sampler
Step
Command
Remarks
1.
Enter system view.
system-view
N/A
2.
Create a sampler.
sampler sampler-name
mode fixed packet-interval
n-power
rate
By default, no samplers exist.
Displaying and maintaining a sampler
Execute
display
commands in any view.
Task
Command
Display configuration information about the sampler
(in standalone mode).
display sampler
[
sampler-name
] [
slot
slot-number
]
Display configuration information about the sampler
(in IRF mode).
display sampler
[
sampler-name
] [
chassis
chassis-number
slot
slot-number
]
Sampler configuration example for IPv4
NetStream
Network requirements
As shown in
, configure samplers and NetStream as follows:
•
Configure IPv4 NetStream on the device to collect statistics on incoming and outgoing traffic on
GigabitEthernet 1/0/2.
•
Send the NetStream data to port 5000 on the NetStream server.
•
Configure fixed sampling in the inbound direction to select the first packet from 256 packets.
•
Configure fixed sampling in the outbound direction to select the first packet from 1024 packets.