13-Network Management and Monitoring Configuration Examples

HomeSupportRoutersCR16000-F SeriesConfigure & DeployConfiguration ExamplesH3C CR16000-F Routers Configuration Examples-R795x-6W10013-Network Management and Monitoring Configuration Examples
03-H3C_Samplers_and_IPv4_NetStream_Configuration_Examples

 

H3C Samplers and IPv4 NetStream Configuration Examples

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Software version: Release 7951P01

Document version: 6W100-20200625

 

Copyright © 2020 New H3C Technologies Co., Ltd. All rights reserved.

No part of this manual may be reproduced or transmitted in any form or by any means without prior written consent of New H3C Technologies Co., Ltd.

Except for the trademarks of New H3C Technologies Co., Ltd., any trademarks that may be mentioned in this document are the property of their respective owners.

The information in this document is subject to change without notice.



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

Sampling is supported only on CSPC-GE24L-E, CSPC-GP24GE8XP2L-E, CSPC-GE16XP4L-E, CSPEX, and CEPC cards.

To configure NetStream flow mirroring, follow the rules:

·     The device supports inbound, outbound, and sampled NetStream flow mirroring for interfaces on CSPC-GE24L-E cards, CSPC-GP24GE8XP2L-E cards, CSPC-GE16XP4L-E cards, CSPEX cards, and CEPC cards.

For NetStream sampling to operate correctly for NetStream flow mirroring on a device, the samplers used by NetStream flow mirroring must use the same sampling rate calculation method.

·     The device supports inbound NetStream flow mirroring but does not support outbound or sampled NetStream flow mirroring for interfaces on CSPC cards (except for CSPC-GE24L-E, CSPC-GP24GE8XP2L-E, and CSPC-GE16XP4L-E cards),  and CMPE-1104 cards.

·     To mirror inbound or outbound traffic on CSPC-GE24L-E cards, CSPC-GP24GE8XP2L-E cards, CSPC-GE16XP4L-E cards, CSPEX cards, and CEPC cards to a card, you must specify the sampler keyword in the mirror-to command.

·     NetStream cannot collect statistics of traffic on a subinterface of a Layer 3 aggregate interface that contains member ports on CSPC cards (except for CSPC-GE24L-E, CSPC-GP24GE8XP2L-E, and CSPC-GE16XP4L-E cards) and CMPE-1104 cards.

·     NetStream collects statistics of traffic on a subinterface of a Layer 2 aggregate interface that contains member ports on CSPC cards (except for CSPC-GE24L-E, CSPC-GP24GE8XP2L-E, and CSPC-GE16XP4L-E cards) and CMPE-1104 cards.

¡     If NetStream flow mirroring is enabled both on the inbound and oubound directions, NetStream only collects statistics of inbound traffic.

¡     If only outbound NetStream flow mirroring is enabled, NetStream collects statistics of outbound traffic.

·     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 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 GigabitEthernet 3/1/1.

[Device] interface gigabitethernet 3/1/1

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

[Device-GigabitEthernet3/1/1] quit

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

[Device] interface gigabitethernet 3/1/2

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

[Device-GigabitEthernet3/1/2] quit

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

[Device] interface gigabitethernet 3/1/3

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

[Device-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 slot 3 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 GigabitEthernet 3/1/1.

[Device] interface GigabitEthernet 3/1/1

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

[Device-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             : 819200

  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    : 06/30/2014 at 16:02:43

 

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   GE3/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 slot 3 sampler samplerin

#

qos policy ns_ipv4_in

 classifier ns_ipv4 behavior ns_ipv4_in

#

interface 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 GigabitEthernet3/1/2

 port link-mode route

 ip address 10.0.0.1 255.255.255.0

#

interface 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-R7951P01

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

  • 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
新华三官网