R3303-HP HSR6800 Routers Network Management and Monitoring Configuration Guide
110
Sampler configuration example
Network requirements
As shown in Figure 43, configure IPv4 NetStream on Router A to collect statistics on incoming and
outgoing traffic on GigabitEthernet 2/0/0. The NetStream data is sent to port 5000 on the NSC at
12.110.2.2/16. Do the following:
• Configure fixed sampling in the inbound direction to select the first packet from among 256
packets.
• Configure random sampling in the outbound direction to select one packet randomly from among
1024 packets.
Figure 43 Network diagram
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.
<RouterA> system-view
[RouterA] sampler 256 mode fixed packet-interval 8
# Create sampler 1024 in random sampling mode, and set the sampling rate to 10. One packet from
among 1024 (2 to the 10th power) packets is selected.
[RouterA] sampler 1024 mode random packet-interval 10
# Configure GigabitEthernet 2/0/0, enable IPv4 NetStream to collect statistics about the incoming
traffic, and then configure the interface to use sampler 256.
[RouterA] interface gigabitethernet 2/0/0
[RouterA-GigabitEthernet2/0/0] ip address 11.110.2.1 255.255.0.0
[RouterA-GigabitEthernet2/0/0] ip netstream inbound
[RouterA-GigabitEthernet2/0/0] ip netstream sampler 256 inbound
[RouterA-GigabitEthernet2/0/0] quit
# Configure interface GigabitEthernet 2/0/1, enable IPv4 NetStream to collect statistics about outgoing
traffic, and then configure the interface to use sampler 1024.
[RouterA] interface gigabitethernet 2/0/1
[RouterA-GigabitEthernet2/0/1] ip address 12.110.2.1 255.255.0.0
[RouterA-GigabitEthernet2/0/1] ip netstream outbound
[RouterA-GigabitEthernet2/0/1] ip netstream sampler 1024 outbound