- Table of Contents
-
- 12-Network Management and Monitoring Configuration Guide
- 00-Preface
- 01-System maintenance and debugging configuration
- 02-NQA configuration
- 03-NTP configuration
- 04-PoE configuration
- 05-SNMP configuration
- 06-RMON configuration
- 07-NETCONF configuration
- 08-EAA configuration
- 09-Process monitoring and maintenance configuration
- 10-Sampler configuration
- 11-Mirroring configuration
- 12-NetStream configuration
- 13-IPv6 NetStream configuration
- 14-sFlow configuration
- 15-Information center configuration
- 16-GOLD configuration
- 17-Packet capture configuration
- 18-VCF fabric configuration
- Related Documents
-
Title | Size | Download |
---|---|---|
10-Sampler configuration | 46.88 KB |
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 "Configuring NetStream."
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 Figure 1, 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.
Configuration procedure
# Create sampler 256 in fixed sampling mode, and set the rate to 8. The first packet of 256 (2 to the 8th power) packets is selected.
[Device] sampler 256 mode fixed packet-interval n-power 8
# Create sampler 1024 in fixed sampling mode, and set the rate to 10. The first packet of 1024 (2 to the 10th power) packets is selected.
[Device] sampler 1024 mode fixed packet-interval n-power 10
# Enable IPv4 NetStream to use sampler 256 to collect statistics about the incoming traffic on GigabitEthernet 1/0/2.
[Device] interface gigabitethernet 1/0/2
[Device-GigabitEthernet1/0/2] ip address 11.110.2.1 255.255.0.0
[Device-GigabitEthernet1/0/2] ip netstream inbound
[Device-GigabitEthernet1/0/2] ip netstream inbound sampler 256
# Enable IPv4 NetStream to use sampler 1024 to collect statistics about the outgoing traffic on GigabitEthernet 1/0/2.
[Device-GigabitEthernet1/0/2] ip netstream outbound
[Device-GigabitEthernet1/0/2] ip netstream outbound sampler 1024
[Device-GigabitEthernet1/0/2] quit
# Configure the address and port number of the NetStream server as the destination for the NetStream data export. Use the default source interface for the NetStream data export.
[Device] ip netstream export host 12.110.2.2 5000
Verifying the configuration
# Display configuration information for sampler 256 and sampler 1024.
Sampler name: 256
Mode: Fixed; Packet-interval: 8; IsNpower : Y
[Device] display sampler 1024
Sampler name: 1024
Mode: Fixed; Packet-interval: 10; IsNpower : Y