- Table of Contents
-
- 13-Network Management and Monitoring Configuration Guide
- 00-Preface
- 01-System Maintenance and Debugging Configuration
- 02-NQA Configuration
- 03-NTP Configuration
- 04-Clock Monitoring Configuration
- 05-IPC Configuration
- 06-SNMP Configuration
- 07-RMON Configuration
- 08-CWMP Configuration
- 09-Sampler Configuration
- 10-Mirroring Configuration
- 11-Protocol Packet Statistics Configuration
- 12-sFlow Configuration
- 13-Information Center Configuration
- Related Documents
-
Title | Size | Download |
---|---|---|
09-Sampler Configuration | 88.63 KB |
|
NOTE: The switch operates in IRF or standalone (the default) mode. For more information about the IRF mode, see IRF Configuration Guide. |
Sampler overview
A sampler provides the packet sampling function. It 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 switch does not support this sampling mode.
A sampler can be used for NetStream, local mirroring, or traffic mirroring. 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 switch.
Figure 1 shows the sampling function in port mirroring and NetStream. A NetStream card (LSR1NSM1A1) is installed on Device A. Configure port mirroring with sampling on Device A so that the packets are sampled. The sampled packets are sent to the destination monitor port, and then to the NetStream card for accounting purpose. On the NetStream card, configure NetStream sampling with the same sampling rate so that the NetTraffic Collector (NTC) device will be notified of the sampling rate, and can collect statistics for packets involved in all sampling on Device A.
Figure 1 Sampling function in port mirroring and NetStream
Creating a sampler
To create a sampler:
Step |
Command |
1. Enter system view. |
system-view |
2. Create a sampler. |
sampler sampler-name mode fixed packet-interval rate |
Displaying and maintaining sampler
Task |
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 |
Display configuration and running information about the sampler. |
display sampler [ sampler-name ] [ chassis chassis-number slot slot-number ] [ | { begin | exclude | include } regular-expression ] |
Available in any view |
Configuration example for port mirroring with sampling
|
NOTE: By default, Ethernet interfaces, VLAN interfaces, and aggregation ports are down. To configure these interfaces, first use the undo shutdown command to bring them up. |
Network requirements
As shown in Figure 2, configure a sampler in fixed mode, where the first packet out of every 256 packets is selected. Then configure port mirroring with the sampler referenced in the inbound direction of GigagbitEthernet 3/0/1 on Switch A and configure GigabitEthernet 3/0/2 as the monitor port. The sampled packets are sent to GigabitEthernet 3/0/2 and then to the NetStream card for accounting.
Figure 2 Network diagram for configuring port mirroring with sampling
Configuration procedure
# Create sampler test1 in fixed sampling mode. Set the sampling rate to 8. The first packet of 256 (2 to the power of 8) packets is selected.
<SwitchA> system-view
[SwitchA] sampler test1 mode fixed packet-interval 8
# Create a local source group numbered 1, referencing sampler test1.
[SwitchA] mirroring-group 1 local sampler test1
# Assign GigabitEthernet 3/0/1 to the local source group as a source port, and assign GigabitEthernet 3/0/2 to the local destination group as a monitor port.
[SwitchA] mirroring-group 1 mirroring-port GigabitEthernet 3/0/1 inbound
[SwitchA] mirroring-group 1 monitor-port GigabitEthernet 3/0/2
Verifying the configuration
After the devices are running for some time, execute the display sampler command on Switch A to view the configuration and running information about sampler test1. The output information shows that Switch A received and processed 256 packets, which reached the number of packets for one sampling; Switch A selected the first packet out of the 256 packets received on GigabitEthernet 3/0/1.
[SwitchA] display sampler test1
Sampler name: test1
Index: 1, Mode: Fixed, Packet-interval: 8