- Table of Contents
-
- 14-Network Management and Monitoring Configuration Guide
- 00-Preface
- 01-System maintenance and debugging configuration
- 02-NQA configuration
- 03-NTP configuration
- 04-PTP configuration
- 05-Network synchronization configuration
- 06-SNMP configuration
- 07-RMON configuration
- 08-NETCONF configuration
- 09-CWMP configuration
- 10-EAA configuration
- 11-Process monitoring and maintenance configuration
- 12-Sampler configuration
- 13-Mirroring configuration
- 14-NetStream configuration
- 15-IPv6 NetStream configuration
- 16-Fast log output configuration
- 17-Flow log configuration
- 18-Information center configuration
- 19-GOLD configuration
- 20-Packet capture configuration
- 21-Flow monitor configuration
- Related Documents
-
Title | Size | Download |
---|---|---|
12-Sampler configuration | 46.21 KB |
Contents
Display and maintenance commands for a sampler
Samplers and IPv4 NetStream configuration examples
Example: Configuring samplers and IPv4 NetStream
Configuring samplers
About sampler
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.
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."
Restrictions and guidelines
Creating a sampler
1. Enter system view.
system-view
2. Create a sampler.
sampler sampler-name mode { fixed | random } packet-interval [ n-power ] rate
By default, no samplers exist.
Display and maintenance commands for 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 ] In IRF mode: display sampler [ sampler-name ] [ chassis chassis-number slot slot-number ] |
Samplers and IPv4 NetStream configuration examples
Example: Configuring samplers and IPv4 NetStream
Network configuration
As shown in Figure 1, configure samplers and NetStream as follows:
· Configure IPv4 NetStream on the router to collect statistics on incoming traffic.
· 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 on GigabitEthernet 3/1/1.
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.
<Router> system-view
[Router] sampler 256 mode fixed packet-interval n-power 8
# Configure QoS policy ns_ipv4 with a flow mirroring action that uses sampler 256.
[Router] acl advanced 3000
[Router-acl-ipv4-adv-3000] rule 0 permit ip
[Router-acl-ipv4-adv-3000] quit
[Router] traffic classifier ns_ipv4
[Router-classifier-ns_ipv4] if-match acl 3000
[Router-classifier-ns_ipv4] quit
[Router] traffic behavior ns_ipv4
[Router-behavior-ns_ipv4] mirror-to slot 1 sampler 256
[Router-behavior-ns_ipv4] quit
[Router] qos policy ns_ipv4
[Router-qospolicy-ns_ipv4] classifier ns_ipv4 behavior ns_ipv4
[Router-qospolicy-ns_ipv4] quit
# Apply QoS policy ns_ipv4 to the incoming traffic of GigabitEthernet 3/1/1.
[Router] interface GigabitEthernet 3/1/1
[Router-GigabitEthernet3/1/1] qos apply policy ns_ipv4 inbound
[Router-GigabitEthernet3/1/1] quit
# Enable IPv4 NetStream.
[Router] ip netstream
# 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.
[Router] ip netstream export host 12.110.2.2 5000
Verifying the configuration
# Display configuration information for sampler 256.
[Router] display sampler 256
Sampler name: 256
Mode: fixed; Packet-interval: 8; IsNpower: Y