• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 新华三人才研学中心
  • 关于我们

12-网络管理和监控配置指导

目录

09-Sampler配置

本章节下载 09-Sampler配置  (118.74 KB)

docurl=/cn/Service/Document_Software/Document_Center/Switches/Catalog/S12500/S12500-S/Configure/Operation_Manual/H3C_S12500-S_CG-R7523P01-6W100/12/201608/947513_30005_0.htm

09-Sampler配置


1 Sampler

1.1  Sampler简介

Sampler即报文采样功能,用来从一组固定数量的报文中抽取一个报文,送交其他业务模块处理。Sampler支持固定采样和随机采样两种方式:

·     固定采样:每组报文中的第一个报文被抽取。

·     随机采样:每组报文中,任意一个报文都有可能被抽取。设备暂不支持随机采样方式。

目前Sampler可以和流量监控特性NetStream配合使用,达到以下目的:

·     对网络流量先进行采样,然后将采样后的流量发送给NetStream系统进行流量统计。通过设定适当的采样间隔,在减少统计的报文数量的前提下,使NetStream系统收集到的统计信息能基本反映整个网络的状况。

·     通过采样可以减少网络的流量,避免网络中的大流量对设备转发性能造成影响。

有关NetStream的详细介绍,请参见“网络管理和监控配置指导”中的“NetStream”。

1.2  创建采样器

表1-1 创建采样器

操作

命令

说明

进入系统视图

system-view

-

创建采样器

sampler sampler-name mode fixed packet-interval n-power rate

缺省情况下,不存在采样器

 

1.3  Sampler显示和维护

在完成上述配置后,在任意视图下执行display命令可以显示配置后Sampler的配置情况,通过查看显示信息验证配置的效果。

表1-2 Sampler显示和维护

操作

命令

查看采样器的配置信息(独立运行模式)

display sampler [ sampler-name ] [ slot slot-number ]

查看采样器的配置信息(IRF模式)

display sampler [ sampler-name ] [ chassis chassis-number slot slot-number ]

 

1.4  Sampler典型配置举例

1.4.1  Sampler与IPv4 NetStream配合使用

1. 组网需求

图1-1所示,在Device上配置IPv4 NetStream入统计和出统计,并将统计结果发送到NetStream服务器。NetStream的IP地址为12.110.2.2/16,UDP端口号为5000。具体要求如下:

·     在接口GigabitEthernet1/0/2的入方向上配置固定采样,每256个报文中抽取一个进行NetStream统计。

·     在接口GigabitEthernet1/0/2的出方向上配置固定采样,每1024个报文中抽取一个进行NetStream统计。

2. 组网图

图1-1 Sampler与IPv4 NetStream配合使用组网图

 

3. 配置步骤

# 创建一个名为256的采样器,采用固定采样方式,设置采样率为8,即256(2的8次方)个报文中采样1个报文。

<Device> system-view

[Device] sampler 256 mode fixed packet-interval n-power 8

# 创建一个名为1024的采样器,采用固定采样方式,设置采样率为10,即1024(2的10次方)个报文中采样1个报文。

[Device] sampler 1024 mode fixed packet-interval n-power 10

# 配置GigabitEthernet1/0/2,在此接口上启动IPv4 NetStream入统计并使用采样器256。

[Device] interface gigabitethernet 1/0/2

[Device-GigabitEthernet1/0/2] ip address 11.110.2.1 255.255.0.0

[Device-GigabitEthernet1/0/2] ip netstream inbound

[Device-GigabitEthernet1/0/2] ip netstream inbound sampler 256

# 配置GigabitEthernet1/0/2,在此接口上启动IPv4 NetStream出统计并使用采样器1024。

[Device-GigabitEthernet1/0/2] ip netstream outbound

[Device-GigabitEthernet1/0/2] ip netstream outbound sampler 1024

[Device-GigabitEthernet1/0/2] quit

# 配置IPv4 NetStream统计输出报文的目的IP地址和目的端口(即NSC的地址以及端口),源接口采用缺省配置。

[Device] ip netstream export host 12.110.2.2 5000

4. 验证配置

# 通过display sampler命令查看采样器256和采样器1024的配置信息。

[Device] display sampler 256

 Sampler name: 256

  Mode: Fixed;  Packet-interval: 8;  IsNpower : Y

[Device] display sampler 1024

 Sampler name: 1024

  Mode: Fixed;  Packet-interval: 10;  IsNpower : Y

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!

新华三官网
联系我们