02-Typical configuration example

HomeSupportRoutersCR16000-F SeriesConfigure & DeployConfiguration ExamplesH3C CR16000-F Routers Configuration Examples All-In-One-R838x-6W10002-Typical configuration example
Table of Contents
Related Documents
30-Samplers_and_IPv4_NetStream_Configuration_Examples

Introduction

This document provides configuration examples of collaborating samplers with IPv4 NetStream.

Prerequisites

The configuration examples in this document were created and verified in a lab environment, and all the devices were started with the factory default configuration. When you are working on a live network, make sure you understand the potential impact of every command on your network.

This document assumes that you have basic knowledge of samplers and IPv4 NetStream.

General restrictions and guidelines

·     Support for this feature varies by card. For more information, see the configuration guide for your product.

·     NetStream flow mirroring supports mirroring traffic only to the current interface module.

Example: Configuring Samplers and IPv4 NetStream

Network configuration

As shown in Figure 1, configure a sampler and IPv4 NetStream as follows:

·     Configure IPv4 NetStream on the router to collect statistics on incoming traffic.

·     Configure the router to send IPv4 NetStream data to port 5000 on the NetStream server.

·     Configure fixed sampling in the inbound direction to select the first packet out of 1001 packets on Ten-GigabitEthernet 3/1/1.

Figure 1 Network diagram

 

Procedures

1.     Configure a sampler:

# Create sampler samperin in fixed sampling mode, and set the rate to 1001. The first packet out of 1001 packets is selected.

<Device> system-view

[Device] sampler samplerin mode fixed packet-interval 1001

2.     Configure NetStream:

# Assign an IP address to Ten-GigabitEthernet 3/1/1.

[Device] interface ten-gigabitethernet 3/1/1

[Device-Ten-GigabitEthernet3/1/1] ip address 192.168.0.1 24

[Device-Ten-GigabitEthernet3/1/1] quit

# Assign an IP address to interface Ten-GigabitEthernet 3/1/2.

[Device] interface ten-gigabitethernet 3/1/2

[Device-Ten-GigabitEthernet3/1/2] ip address 10.0.0.1 24

[Device-Ten-GigabitEthernet3/1/2] quit

# Assign an IP address to interface Ten-GigabitEthernet 3/1/3.

[Device] interface ten-gigabitethernet 3/1/3

[Device-Ten-GigabitEthernet3/1/3] ip address 192.168.1.1 24

[Device-Ten-GigabitEthernet3/1/3] quit

# Enable NetStream globally.

<Device> system-view

[Device] ip netstream

# Configure QoS policy ns_ipv4_in with a flow mirroring action that uses sampler samperin.

[Device] acl advanced 3000

[Device-acl-ipv4-adv-3000] rule 0 permit ip

[Device-acl-ipv4-adv-3000] quit

[Device] traffic classifier ns_ipv4

[Device-classifier-ns_ipv4] if-match acl 3000

[Device-classifier-ns_ipv4] quit

[Device] traffic behavior ns_ipv4_in

[Device-behavior-ns_ipv4] mirror-to local sampler samplerin

[Device-behavior-ns_ipv4] quit

[Device] qos policy ns_ipv4_in

[Device-qospolicy-ns_ipv4] classifier ns_ipv4 behavior ns_ipv4_in

[Device-qospolicy-ns_ipv4] quit

# Apply QoS policy ns_ipv4_in to the inbound direction of Ten-GigabitEthernet 3/1/1.

[Device] interface Ten-GigabitEthernet 3/1/1

[Device-Ten-GigabitEthernet3/1/1] qos apply policy ns_ipv4_in inbound

[Device-Ten-GigabitEthernet3/1/1] quit

# Specify 192.168.1.2 as the IP address of the destination host and UDP port 5000 as the export destination port number.

[Device] ip netstream export host 192.168.1.2 5000

Verifying the configuration

1.     Display configuration information for sampler samperin.

[Device] display sampler

Sampler name: samplerin

  Mode: fixed;  Packet-interval: 1001;  IsNpower : N

2.     Display the statistics about NetStream data:

# Display NetStream entry information.

[Device] display ip netstream cache verbose

IP NetStream cache information:

  Active flow timeout               : 30 min

  Inactive flow timeout             : 30 sec

  Max number of entries             : 460800

  IP active flow entries            : 1

  MPLS active flow entries          : 0

  L2 active flow entries            : 0

  IPL2 active flow entries          : 0

  IP flow entries counted           : 22

  MPLS flow entries counted         : 0

  L2 flow entries counted           : 0

  IPL2 flow entries counted         : 0

  Last statistics resetting time    : Never

 

IP packet size distribution (300 packets in total):

 

 1-32   64   96  128  160  192  224  256  288  320  352  384  416  448  480

 .000 .000 1.00 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000

 

  512  544  576 1024 1536 2048 2560 3072 3584 4096 4608 >4608

 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000

 

 Protocol          Total  Packets    Flows  Packets Active(sec) Idle(sec)

                   Flows  /sec       /sec   /flow   /flow       /flow

---------------------------------------------------------------------------

 ICMP                 22        0        0       13           1        30

 

Type DstIP(Port)            SrcIP(Port)            Pro ToS If(Direct)  Pkts

     DstMAC(VLAN)           SrcMAC(VLAN)

     TopLblType(IP/MASK)    Lbl-Exp-S-List

---------------------------------------------------------------------------

IP   10.0.0.2(2048)         192.168.0.2(0)         1   0   XGE3/1/1(I) 5

     TCPFlag:       0

     DstMask:      32       SrcMask:      32       NextHop:          10.0.0.2

     DstAS:         0       SrcAS:         0       BGPNextHop:        0.0.0.0

     InVRF:         0

     SamplerMode:   1       SamplerInt: 1001

     Active:        0       Bytes/Pkt:    84

# Display information about the NetStream data export.

[Device] display ip netstream export

IP export information:

  Flow source interface                           : Not specified

  Flow destination VPN instance                   : Not specified

  Flow destination IP address (UDP)               : 192.168.1.2 (5000)

  Version 5 exported flow number                  : 0

  Version 5 exported UDP datagram number (failed) : 0 (0)

  Version 9 exported flow number                  : 1

  Version 9 exported UDP datagram number (failed) : 0 (0)

  Version 10 exported flow number                 : 0

  Version 10 exported UDP datagram number (failed): 0 (0)

 

IPL2 export information:

  Flow source interface                           : Not specified

  Flow destination VPN instance                   : Not specified

  Flow destination IP address (UDP)               : 192.168.1.2 (5000)

  Version 9 exported flow number                  : 0

  Version 9 exported UDP datagram number (failed) : 0 (0)

  Version 10 exported flow number                 : 0

  Version 10 exported UDP datagram number (failed): 0 (0)

Configuration files

#

 sampler samplerin mode fixed packet-interval 1001

#

ip netstream

ip netstream export host 192.168.1.2 5000

#

traffic classifier ns_ipv4 operator and

 if-match acl 3000

#

traffic behavior ns_ipv4_in

 mirror-to local sampler samplerin

#

qos policy ns_ipv4_in

 classifier ns_ipv4 behavior ns_ipv4_in

#

interface Ten-GigabitEthernet3/1/1

 port link-mode route

 ip address 192.168.0.1 255.255.255.0

 qos apply policy ns_ipv4_in inbound

#

interface Ten-GigabitEthernet3/1/2

 port link-mode route

 ip address 10.0.0.1 255.255.255.0

#

interface Ten-GigabitEthernet3/1/3

 port link-mode route

 ip address 192.168.1.1 255.255.255.0

#

acl advanced 3000

 rule 0 permit ip

#

Related documentation

·     H3C CR16000-F Routers Network Management and Monitoring Configuration Guide-R8385P09

·     H3C CR16000-F Routers Network Management and Monitoring Command Reference-R8385P09

·      

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become a Partner
  • Partner Resources
  • Partner Business Management
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网