17-NetStream命令
本章节下载: 17-NetStream命令 (401.48 KB)
目 录
1.1.1 display ip netstream cache
1.1.2 display ip netstream cache archive
1.1.3 display ip netstream export
1.1.4 display ip netstream template
1.1.6 flow standard-mode enable
1.1.7 ip netstream (interface view)
1.1.8 ip netstream (system view)
1.1.9 ip netstream aggregation
1.1.11 ip netstream cache archive enable
1.1.12 ip netstream export host (aggregation view)
1.1.13 ip netstream export host (system view)
1.1.14 ip netstream export rate
1.1.15 ip netstream export source
1.1.16 ip netstream export template refresh-rate
1.1.17 ip netstream export version
1.1.21 ip netstream outbound sampler srv6-policy
1.1.22 ip netstream outbound srv6-policy
1.1.23 ip netstream template rfc7011
1.1.24 ip netstream timeout active
1.1.25 ip netstream timeout inactive
1.1.26 reset ip netstream statistics
display ip netstream cache命令用来查看NetStream流表项信息。
【命令】
(独立运行模式)
display ip netstream cache [ verbose ] [ type { ip | ipl2 | l2 | mpls [ label-position1 label-value1 [ label-position2 label-value2 [ label-position3 label-value3 ] ] ] } ] [ destination destination-ip | destination-port destination-port | interface interface-type interface-number | protocol protocol | source source-ip | source-port source-port ] * [ arrived-time start-date start-time end-date end-time ] [ slot slot-number [ cpu cpu-number ] ]
(IRF模式)
display ip netstream cache [ verbose ] [ type { ip | ipl2 | l2 | mpls [ label-position1 label-value1 [ label-position2 label-value2 [ label-position3 label-value3 ] ] ] } ] [ destination destination-ip | destination-port destination-port | interface interface-type interface-number | protocol protocol | source source-ip | source-port source-port ] * [ arrived-time start-date start-time end-date end-time ] [ chassis chassis-number slot slot-number [ cpu cpu-number ] ]
【视图】
任意视图
【缺省用户角色】
network-admin
network-operator
【参数】
verbose:显示NetStream流表项的详细信息。如果未指定本参数,将显示概要信息。
type:显示的流表项类型。如果未指定本参数,则显示所有类型的流表项。
ip:显示IP流表项。
ipl2:显示二三层混合流表项。
l2:显示二层流表项。
mpls:显示MPLS流表项。
label-position1 label-value1:显示标签为指定值的MPLS流表项。label-position1表示标签位置,取值范围为1~10,其中1表示最外层标签,10表示最内层标签,以此类推。label-value1表示标签值,取值范围为0~1048575。
label-position2 label-value2:显示标签为指定值的MPLS流表项。label-position2表示标签位置,取值范围为1~10中除了已被指定过的标签位置,其中1表示最外层标签,10表示最内层标签,以此类推。label-value2表示标签值,取值范围为0~1048575。
label-position3 label-value3:显示标签为指定值的MPLS流表项。label-position3表示标签位置,取值范围为1~10中除了已被指定过的标签位置,其中1表示最外层标签,10表示最内层标签,以此类推。label-value3表示标签值,取值范围为0~1048575。
destination destination-ip:显示指定目的IP地址的所有NetStream流表项信息,destination-ip用于指定IP地址,格式为点分十进制。该参数不支持显示二层流表项。
destination-port destination-port:显示指定目的端口的所有NetStream流表项信息,destination-port用于指定目的端口,取值范围为0~65535。该参数不支持显示二层流表项。
interface interface-type interface-number:显示指定接口的所有流表项信息,interface-type interface-number用来指定接口的类型和编号。
protocol protocol:显示指定协议的所有NetStream流表项信息,protocol用于指定协议号或者常见协议的名称,协议号的取值范围为0~255,常见协议的名称包括GRE、OSPF、TCP、UDP等。该参数不支持显示二层流表项。
source source-ip:显示指定源IP地址的所有NetStream流表项信息,source-ip用于指定IP地址,格式为点分十进制。该参数不支持二层流表项。该参数不支持显示二层流表项。
source-port source-port:显示指定源端口的所有流表项信息,source-port用于指定源端口,取值范围为0~65535。该参数不支持显示二层流表项。
arrived-time:显示指定时间内到达的所有NetStream流表项信息。不指定该参数时,表示对流的到达时间没有限制。
start-date:指定开始日期,格式为MM/DD/YYYY(月/日/年)或者YYYY/MM/DD(年/月/日),MM的取值范围为1~12,DD的取值范围与月份有关,YYYY的取值范围为2000~2035。
start-time:指定开始时间,格式为HH:MM:SS(小时:分钟:秒),HH取值范围为0~23,MM和SS取值范围为0~59。如果要配置成整分,则可以不输入秒;如果要配置成整点,则可以不输入分和秒。比如将start-time配置为0表示零点。
end-date:指定结束日期,格式为MM/DD/YYYY(月/日/年)或者YYYY/MM/DD(年/月/日),MM的取值范围为1~12,DD的取值范围与月份有关,YYYY的取值范围为2000~2035。
end-time:指定结束时间,格式为HH:MM:SS(小时:分钟:秒),HH取值范围为0~23,MM和SS取值范围为0~59。如果要配置成整分,则可以不输入秒;如果要配置成整点,则可以不输入分和秒。比如将end-time配置为0表示零点。
slot slot-number:指定单板。slot-number为单板所在的槽位号。如果不指定本参数,则表示指定所有单板。(独立运行模式)
chassis chassis-number slot slot-number:指定单板。chassis-number表示设备在IRF中的成员编号,slot-number表示单板所在的槽位号。如果不指定本参数,则表示指定所有单板。(IRF模式)
cpu cpu-number:指定CPU。cpu-number表示单板上CPU的编号。只有指定的slot支持多CPU时,才能配置该参数。
【举例】
# 查看NetStream流表项的详细信息。
<Sysname> display ip netstream cache verbose
IP NetStream cache information:
Active flow timeout : 60 min
Inactive flow timeout : 10 sec
Max number of entries : 1000
IP active flow entries : 1
MPLS active flow entries : 1
L2 active flow entries : 0
IPL2 active flow entries : 0
IP flow entries counted : 10
MPLS flow entries counted : 20
L2 flow entries counted : 10
IPL2 flow entries counted : 20
Last statistics resetting time : 01/01/2000 at 00:01:02
IP packet size distribution (1103746 packets in total):
1-32 64 96 128 160 192 224 256 288 320 352 384 416 448 480
.249 .694 .000 .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 .027 .000 .027 .000 .000 .000 .000 .000 .000 .000
Protocol Total Packets Flows Packets Active(sec) Idle(sec)
Flows /sec /sec /flow /flow /flow
--------------------------------------------------------------------------
TCP-Telnet 2656855 372 4 86 49 27
TCP-FTP 5900082 86 9 9 11 33
TCP-FTPD 3200453 1006 5 193 45 33
TCP-WWW 546778274 11170 887 12 8 32
TCP-other 49148540 3752 79 47 30 32
UDP-DNS 117240379 570 190 3 7 34
UDP-other 45502422 2272 73 30 8 37
ICMP 14837957 125 24 5 12 34
IP-other 77406 5 0 47 52 27
Type DstIP(Port) SrcIP(Port) Pro ToS VNI If(Direct) Pkts
DstMAC(VLAN) SrcMAC(VLAN)
TopLblType(IP/Mask) Lbl-Exp-S-List
--------------------------------------------------------------------------
IP 11.1.1.1(1024) 11.1.1.2(21) 6 128 10 XGE3/1/1(I) 42996
TCPFlag: 27 TTL: 64
DstMask: 24 SrcMask: 24 NextHop: 0.0.0.0
DstAS: 0 SrcAS: 0 BGPNextHop: 0.0.0.0
InVRF: mvpn
Bgp-community1: 0
Bgp-community2: 0
Bgp-community3: 0
Bgp-community4: 0
SamplerMode:Random SamplerInt: 256
Active: 120.600 Bytes/Pkt: 152
First packet arrived: 10/28/2013, 14:10:03
Last packet arrived: 10/28/2013, 14:21:03
SRv6 policy NID: 2150629378
IP& 172.16.1.1(68) 172.16.2.1(67) 17 64 N/A XGE3/1/3(I) 1848
MPLS LDP(4.4.4.4/24) 1:55-6-0
2:16-6-1
TCPFlag: 0
DstMask: 24 SrcMask: 24 NextHop: 172.16.2.10
DstAS: 0 SrcAS: 0 BGPNextHop: 0.0.0.0
InVRF: vpn1
Bgp-community1: 0
Bgp-community2: 0
Bgp-community3: 0
Bgp-community4: 0
SamplerMode:N/A SamplerInt: 0
Active: 5.542 Bytes/Pkt: 1426
First packet arrived: 10/28/2013, 14:12:03
Last packet arrived: 10/28/2013, 14:23:03
SRv6 policy NID: 2150629378
表1-1 display ip netstream cache命令显示信息描述表
字段 |
描述 |
IP NetStream information |
NetStream流表项信息 |
Active flow timeout |
活跃流的老化时间,单位为分钟 |
Inactive flow timeout |
不活跃流的老化时间,单位为秒 |
Max number of entries |
NetStream流缓存区中允许的最大流数 |
IP active flow entries |
NetStream流缓存区中活跃的IP流数 |
MPLS active flow entries |
NetStream流缓存区中活跃的MPLS流数 |
L2 active flow entries |
NetStream流缓存区中活跃的二层流数 |
IPL2 active flow entries |
NetStream流缓存区中活跃的二层和三层流数 |
IP flow entries counted |
已经被统计的IP流数 |
MPLS flow entries counted |
已经被统计的MPLS流数 |
L2 flow entries counted |
已经被统计的二层流数 |
IPL2 flow entries counted |
已经被统计的二层和三层流数 |
Last statistics resetting time |
上次清除统计的时间 该字段只在执行了reset ip netstream statistics命令后才会显示为时间,否则显示为Never |
IP packet size distribution (1103746 packets in total) |
IP报文按大小分布情况,括号中为IP报文总数。 分布值按占IP报文总数的比率显示,只显示3位小数,如“.027”表示占IP报文总数的0.027 |
1-32 64 96 128 160 192 224 256 288 320 352 384 416 448 480 512 544 576 1024 1536 2048 2560 3072 3584 4096 4608 |
IP报文尺寸区间(报文长度不包括二层链路层的头)。长度不超过576字节时,以32字节为单位递增,例如:“1-32”是长度为1~32个字节的报文数目,“64”是长度为33~64字节的报文数。长度超过1024字节时,以512字节为单位递增,例如“1536”是长度为1025~1536字节的报文数。长度在577~1024间的报文记录在1024项中 |
Protocol Total Flows Packets /sec Flows/sec Packets/flow Active(sec)/flow Idle(sec)/flow |
按协议分类的报文统计信息:协议类型、总流数、每秒的报文数、每秒的流数、平均每条流的报文数、平均每条流的活跃时间、平均每条流的非活跃时间 |
Type DstIP(Port) SrcIP(Port) Pro ToS VNI If(Direct) Pkts |
当前流缓存区中活跃流的IP层信息:流的类型、目的IP地址(目的端口号)、源IP地址(源端口号)、协议号、服务类型、VXLAN ID、接口名(方向)、包数 其中流的类型有五种:IP流(IP)、二层流(L2)、二三层混合流(IP&L2)、不带IP选项的MPLS流(MPLS)、带IP选项的MPLS流(IP&MPLS) 需要注意的是,对于ICMP报文只有Type和Code字段,因此用目的端口号的高8位为Type字段、低8位为Code字段,源端口号为0 对非VXLAN报文和不支持VXLAN的设备上,VNI字段显示为N/A 对于SRv6 TE Policy组网中,通过SRv6 TE Policy报文的NetStream采样功能统计到SRv6 TE Policy报文的如下字段为内层原始报文的信息:DstIP(Port)、SrcIP(Port)、Pro、ToS和VNI |
DstMAC(VLAN) SrcMAC(VLAN) |
当前流缓存区中活跃流的二层信息:目的MAC地址(目的VLAN ID)、源MAC地址(源VLAN ID) |
TopLblType(IP/Mask) : Lbl-Exp-S-List |
当前流缓存区中活跃流的MPLS信息,其中: · TopLblType:表示栈顶标签的类型 · IP/Mask:表示栈顶标签对应的IP地址及掩码长度 · Lbl:表示标签值,为1~20比特的字符串 · EXP:表示报文优先级,用来实现QoS,1~3比特的字符串 · S:栈底标识。取值为1时表示为栈底,取值为0时表示非栈底 · List:标签列表,标签列表中至多列出三层标签,mpls-position指定标签位置 |
TCPFlag: TTL: DstMask: SrcMask: NextHop: DstAS: SrcAS: BGPNextHop: OutVRF: InVRF: Bgp-community1: Bgp-community2: Bgp-community3: Bgp-community4: SamplerMode: SamplerInt: Active: Bytes/Pkt: First packet arrived: Last packet arrived: SRv6 policy NID: |
当前流缓存区中活跃流的其他信息: · TCPFlag:TCP标记 · TTL:生存时间 · DstMask:目的掩码 · SrcMask:源掩码 · NextHop:路由下一跳 · DstAS:目的自治系统 · SrcAS:源自治系统 · BGPNextHop:BGP下一跳 · OutVRF:出方向报文转发使用的VPN · InVRF:入方向报文转发使用的VPN · SamplerMode:NetStream采样模式,目前支持三种: ¡ N/A:表示不采样,统计所有报文 ¡ Fixed:表示固定采样 ¡ Random:表示随机采样 · Bgp-community:BGP团体属性值 · SamplerInt:采样间隔 · Active:流活跃时间 · Bytes/Pkt:平均每个包的字节数 · First packet arrived:该流首个报文到达时间 · Last packet arrived:该流最后一个报文到达时间 · SRv6 policy NID:SRv6 TE Policy的NHLFE表项索引值 对于SRv6 TE Policy组网中,通过SRv6 TE Policy报文的NetStream采样功能统计到SRv6 TE Policy L3VPN业务报文的TCPFlag、Bytes/Pkt为内层原始报文的信息,TTL、DstMask、SrcMask、DstAS、SrcAS为外层报文的信息;BGPNextHop、NextHop字段不支持,显示为0.0.0.0;Bgp-community字段不支持,显示为0 对于SRv6 TE Policy组网中,通过SRv6 TE Policy报文的NetStream采样功能统计到SRv6 TE Policy L2VPN业务报文,除了TTL之外的其他字段均不支持 对于SRv6 TE Policy组网中,通过接口下的NetStream采样功能统计到SRv6 TE Policy报文的TCPFlag、Bytes/Pkt为内层原始报文的信息,TTL、DstAS、SrcAS为外层报文的信息;DstMask、SrcMask、BGPNextHop、NextHop字段不支持,显示为0.0.0.0;Bgp-community字段不支持,显示为0 |
display ip netstream cache archive命令用来查看保存到本地的Netstream流表项信息。
【命令】
(独立运行模式)
display ip netstream cache archive [ verbose ] [ type { ip | ipl2 | l2 | mpls [ label-position1 label-value1 [ label-position2 label-value2 [ label-position3 label-value3 ] ] ] } ] [ destination destination-ip | destination-port destination-port | interface interface-type interface-number | protocol protocol | source source-ip | source-port source-port ] * [ arrived-time start-date start-time end-date end-time ] [ slot slot-number [ cpu cpu-number ] ]
(IRF模式)
display ip netstream cache archive [ verbose ] [ type { ip | ipl2 | l2 | mpls [ label-position1 label-value1 [ label-position2 label-value2 [ label-position3 label-value3 ] ] ] } ] [ destination destination-ip | destination-port destination-port | interface interface-type interface-number | protocol protocol | source source-ip | source-port source-port ] * [ arrived-time start-date start-time end-date end-time ] [ chassis chassis-number slot slot-number [ cpu cpu-number ] ]
【视图】
任意视图
【缺省用户角色】
network-admin
network-operator
【参数】
verbose:显示保存到本地的Netstream流表项的详细信息。如果未指定本参数,将显示概要信息。
type:显示的流表项类型。如果未指定本参数,则显示所有类型的流表项。
ip:显示IP流表项。
ipl2:显示二三层混合流表项。
l2:显示二层流表项。
mpls:显示MPLS流表项。
label-position1 label-value1:显示标签为指定值的MPLS流表项。label-position1表示标签位置,取值范围为1~10,其中1表示最外层标签,10表示最内层标签,以此类推。label-value1表示标签值,取值范围为0~1048575。
label-position2 label-value2:显示标签为指定值的MPLS流表项。label-position2表示标签位置,取值范围为1~10,其中1表示最外层标签,10表示最内层标签,以此类推。label-value2表示标签值,取值范围为0~1048575。
label-position3 label-value3:显示标签为指定值的MPLS流表项。label-position3表示标签位置,取值范围为1~10,其中1表示最外层标签,10表示最内层标签,以此类推。label-value3表示标签值,取值范围为0~1048575。
destination destination-ip:显示指定目的IP地址的保存到本地的Netstream流表项信息,destination-ip用于指定IP地址,格式为点分十进制。该参数不支持显示二层流表项。
interface interface-type interface-number:显示指定接口的保存到本地的Netstream流表项信息,interface-type interface-number表示接口的类型和编号。
source source-ip:显示指定源IP地址的保存到本地的Netstream流表项信息,source-ip用于指定IP地址,格式为点分十进制。该参数不支持显示二层流表项。
protocol protocol:显示指定协议的保存到本地的Netstream流表项信息,protocol用于指定协议号或者常见协议的名称,协议号的取值范围为0~255,常见协议的名称包括GRE、OSPF、TCP、UDP等。该参数不支持显示二层流表项。
destination-port destination-port:显示指定目的端口的保存到本地的Netstream流表项信息,destination-port用于指定目的端口,取值范围为0~65535。该参数不支持显示二层流表项。
source-port source-port:显示指定源端口的保存到本地的Netstream流表项信息,source-port用于指定源端口,取值范围为0~65535。该参数不支持显示二层流表项。
arrived-time:显示指定报文到达时间范围内的保存到本地的Netstream流表项信息。
start-date:指定时间的开始日期,格式为MM/DD/YYYY(月/日/年)或者YYYY/MM/DD(年/月/日),MM的取值范围为1~12,DD的取值范围与月份有关,YYYY的取值范围为2000~2035。
start-time:指定时间的开始时间,格式为HH:MM:SS(小时:分钟:秒),HH取值范围为0~23,MM和SS取值范围为0~59。如果要配置成整分,则可以不输入秒;如果要配置成整点,则可以不输入分和秒。比如将start-time配置为0表示零点。不指定该参数时,表示对流的到达时间没有限制。
end-date:指定时间的结束日期,格式为MM/DD/YYYY(月/日/年)或者YYYY/MM/DD(年/月/日),MM的取值范围为1~12,DD的取值范围与月份有关,YYYY的取值范围为2000~2035。
end-time:指定时间的结束时间,格式为HH:MM:SS(小时:分钟:秒),HH取值范围为0~23,MM和SS取值范围为0~59。如果要配置成整分,则可以不输入秒;如果要配置成整点,则可以不输入分和秒。比如将end-time配置为0表示零点。
slot slot-number:指定单板。slot-number为单板所在的槽位号。如果不指定本参数,则表示指定所有单板。(独立运行模式)
chassis chassis-number slot slot-number:指定单板。chassis-number表示设备在IRF中的成员编号,slot-number表示单板所在的槽位号。如果不指定本参数,则表示指定所有单板。(IRF模式)
cpu cpu-number:指定CPU。cpu-number表示单板上CPU的编号。只有指定的slot支持多CPU时,才能配置该参数。
【举例】
# 查看2017年7月28日14:10:03到2017年7月28日14:23:03的保存到本地的Netstream流表项信息。
<Sysname> display ip netstream cache archive arrived-time 7/28/2017 14:10:03 7/28/2017 14:23:03
Type DstIP(Port) SrcIP(Port) Pro ToS VNI APPID If(Direct) Pkts
DstMAC(VLAN) SrcMAC(VLAN)
TopLblType(IP/Mask) Lbl-Exp-S-List
--------------------------------------------------------------------------
IP 11.1.1.1(1024) 11.1.1.2(21) 6 128 10 0xe XGE3/1/1(I) 42996
First packet arrived: 7/28/2017, 14:20:03
Last packet arrived: 7/28/2017, 14:21:03
【相关命令】
· ip netstream cache archive enable
display ip netstream export命令用来查看NetStream统计输出报文的相关信息。
【命令】
(独立运行模式)
display ip netstream export [ slot slot-number [ cpu cpu-number ] ]
(IRF模式)
display ip netstream export [ chassis chassis-number slot slot-number [ cpu cpu-number ] ]
【视图】
任意视图
【缺省用户角色】
network-admin
network-operator
【参数】
slot slot-number:指定单板。slot-number为单板所在的槽位号。如果不指定本参数,则表示指定所有单板。(独立运行模式)
chassis chassis-number slot slot-number:指定单板。chassis-number表示设备在IRF中的成员编号,slot-number表示单板所在的槽位号。如果不指定本参数,则表示指定所有单板。(IRF模式)
cpu cpu-number:指定CPU。cpu-number表示单板上CPU的编号。只有指定的slot支持多CPU时,才能配置该参数。
【使用指导】
不同的聚合方式使用不同的模板,使用该命令显示当前配置的所有聚合方式的统计输出报文的信息。
【举例】
# 查看NetStream统计输出信息。
<Sysname> display ip netstream export
IP export information:
Flow source interface : Ten-GigabitEthernet3/1/1
Flow destination VPN instance : VPN1
Flow destination IP address (UDP) : 10.10.0.10 (30000)
Version 5 exported flow number : 0
Version 5 exported UDP datagram number (failed) : 0 (0)
Version 9 exported flow number : 20
Version 9 exported UDP datagram number (failed) : 2 (0)
Version 10 exported flow number : 0
Version 10 exported UDP datagram number (failed) : 0 (0)
IPL2 export information:
Flow source interface : Ten-GigabitEthernet3/1/1
Flow destination VPN instance : VPN1
Flow destination IP address (UDP) : 10.10.0.10 (30000)
Version 9 exported flow number : 20
Version 9 exported UDP datagram number (failed) : 2 (0)
Version 10 exported flow number : 0
Version 10 exported UDP datagram number (failed) : 0 (0)
表1-2 display ip netstream export命令显示信息描述表
字段 |
描述 |
type export information |
对应类型的NetStream统计输出信息,type表示NetStream统计类型 |
Flow source interface |
输出信息的源接口 |
Flow destination VPN instance |
输出信息的目的地址所在的VPN |
Flow destination IP address (UDP) |
输出信息的目的IPv4地址(UDP端口号) |
Flow destination IPv6 address (UDP) |
输出信息的目的IPv6地址(UDP端口号) |
Version 5 exported flow number |
使用版本5格式发送的流信息数 |
Version 5 exported UDP datagram number (failed) |
使用版本5格式发送的UDP报文数(发送失败的报文数) |
Version 9 exported flow number |
使用版本9格式发送的流信息数 |
Version 9 exported UDP datagram number (failed) |
使用版本9格式发送的UDP报文数(发送失败的报文数) |
protocol-port aggregation export information |
协议-端口聚合的版本8统计输出信息 |
Version 8 exported flow number |
使用版本8格式发送的流信息数 |
Version 8 exported UDP datagram number (failed) |
使用版本8格式发送的UDP报文数(发送失败的报文数) |
Version 10 exported flow number |
使用版本10格式发送的流信息数 |
Version 10 exported UDP datagram number (failed) |
使用版本10格式发送的UDP报文数(发送失败的报文数) |
【相关命令】
· ip netstream export host (system view)
· ip netstream export host (aggregation view)
display ip netstream template命令用来查看NetStream模板的配置和状态信息。
【命令】
(独立运行模式)
display ip netstream template [ slot slot-number [ cpu cpu-number ] ]
(IRF模式)
display ip netstream template [ chassis chassis-number slot slot-number [ cpu cpu-number ] ]
【视图】
任意视图
【缺省用户角色】
network-admin
network-operator
【参数】
slot slot-number:指定单板。slot-number为单板所在的槽位号。如果不指定本参数,则表示指定主用主控板。(独立运行模式)
chassis chassis-number slot slot-number:指定单板。chassis-number表示设备在IRF中的成员编号,slot-number表示单板所在的槽位号。如果不指定本参数,则表示指定Master设备主用主控板。(IRF模式)
cpu cpu-number:指定CPU。cpu-number表示单板上CPU的编号。只有指定的slot支持多CPU时,才能配置该参数。
【使用指导】
不同的聚合方式使用不同的模板,使用该命令显示当前配置的所有聚合方式的模板信息。
【举例】
# 未配置ip netstream template rfc7011,查看NetStream模板信息(以版本10为例)。
<Sysname> display ip netstream template
Flow template refresh frequency : 20
Flow template refresh interval : 30 min
Active flow templates : 4
Created flow templates : 4
L2L3 outbound template:
Template ID : 3286
Packets : 0
Last template export time : Never
Field count : 25
Field type Field length (bytes)
------------------------------------------------------------------------------
Out packets 8
Out bytes 8
First forwarded 4
Last forwarded 4
Input interface index 4
Output interface index 4
Source IPv4 address 4
Destination IPv4 address 4
Source VLAN 2
Destination VLAN 2
L4 source port 2
L4 destination port 2
IP protocol version 1
TCP flags 1
Protocol 1
Source ToS 1
Direction 1
Sampling algorithm 1
PAD 1
PAD 1
Sampling interval 4
Bgp-community1 4
Bgp-community2 4
Bgp-community3 4
Bgp-community4 4
L2L3 inbound template:
Template ID : 3285
Packets : 0
Last template export time : Never
Field count : 25
Field type Field length (bytes)
------------------------------------------------------------------------------
In packets 8
In bytes 8
First forwarded 4
Last forwarded 4
Input interface index 4
Output interface index 4
Source IPv4 address 4
Destination IPv4 address 4
Source VLAN 2
Destination VLAN 2
L4 source port 2
L4 destination port 2
IP protocol version 1
TCP flags 1
Protocol 1
Source ToS 1
Direction 1
Sampling algorithm 1
PAD 1
PAD 1
Sampling interval 4
Bgp-community1 4
Bgp-community2 4
Bgp-community3 4
Bgp-community4 4
L3 outbound template:
Template ID : 3282
Packets : 0
Last template export time : 12/18/2017 at 14:51:15
Field count : 29
Field type Field length (bytes)
------------------------------------------------------------------------------
Out packets 8
Out bytes 8
First forwarded 4
Last forwarded 4
Input interface index 4
Output interface index 4
Source IPv4 address 4
Destination IPv4 address 4
Next hop IPv4 address 4
Source AS 4
Destination AS 4
L4 source port 2
L4 destination port 2
IP protocol version 1
TCP flags 1
Protocol 1
Source ToS 1
Source address mask 1
Destination address mask 1
Direction 1
Forwarding status 1
Out VPN ID 2
Sampling algorithm 1
PAD 1
Sampling interval 4
VXLAN ID 4
App ID 4
Bgp-community1 4
Bgp-community2 4
Bgp-community3 4
Bgp-community4 4
VPN instance name 65535
Serial number 65535
L3 inbound template:
Template ID : 3281
Packets : 0
Last template export time : 12/18/2017 at 14:51:15
Field count : 29
Field type Field length (bytes)
------------------------------------------------------------------------------
In packets 8
In bytes 8
First forwarded 4
Last forwarded 4
Input interface index 4
Output interface index 4
Source IPv4 address 4
Destination IPv4 address 4
Next hop IPv4 address 4
Source AS 4
Destination AS 4
L4 source port 2
L4 destination port 2
IP protocol version 1
TCP flags 1
Protocol 1
Source ToS 1
Source address mask 1
Destination address mask 1
Direction 1
Forwarding status 1
In VPN ID 2
Sampling algorithm 1
PAD 1
Sampling interval 4
VXLAN ID 4
App ID 4
Bgp-community1 4
Bgp-community2 4
Bgp-community3 4
Bgp-community4 4
VPN instance name 65535
Serial number 65535
# 配置ip netstream template rfc7011后,查看NetStream模板信息(以版本10为例)。
<Sysname> display ip netstream template
Flow template refresh frequency : 20
Flow template refresh interval : 30 min
Active flow templates : 4
Created flow templates : 4
L2L3 outbound template:
Template ID : 3286
Packets : 0
Last template export time : Never
Field count : 22
Field type Field length (bytes)
------------------------------------------------------------------------------
Out packets 8
Out bytes 8
First forwarded 4
Last forwarded 4
Input interface index 4
Output interface index 4
Source IPv4 address 4
Destination IPv4 address 4
Source VLAN 2
Destination VLAN 2
L4 source port 2
L4 destination port 2
IP protocol version 1
TCP flags 1
Protocol 1
Source ToS 1
Direction 1
Sampling algorithm 1
PAD 1
PAD 1
Sampling interval 4
Bgp-community 65535
L2L3 inbound template:
Template ID : 3285
Packets : 0
Last template export time : Never
Field count : 22
Field type Field length (bytes)
------------------------------------------------------------------------------
In packets 8
In bytes 8
First forwarded 4
Last forwarded 4
Input interface index 4
Output interface index 4
Source IPv4 address 4
Destination IPv4 address 4
Source VLAN 2
Destination VLAN 2
L4 source port 2
L4 destination port 2
IP protocol version 1
TCP flags 1
Protocol 1
Source ToS 1
Direction 1
Sampling algorithm 1
PAD 1
PAD 1
Sampling interval 4
Bgp-community 65535
L3 outbound template:
Template ID : 3282
Packets : 0
Last template export time : Never
Field count : 29
Field type Field length (bytes)
------------------------------------------------------------------------------
Out packets 8
Out bytes 8
First forwarded 4
Last forwarded 4
Input interface index 4
Output interface index 4
Source IPv4 address 4
Destination IPv4 address 4
Next hop IPv4 address 4
Source AS 4
Destination AS 4
L4 source port 2
L4 destination port 2
IP protocol version 1
TCP flags 1
Protocol 1
Source ToS 1
Source address mask 1
Destination address mask 1
Direction 1
Forwarding status 1
Out VPN ID 2
Sampling algorithm 1
PAD 1
Sampling interval 4
VXLAN ID 4
App ID 4
Bgp-community 65535
VPN instance name 65535
L3 inbound template:
Template ID : 3281
Packets : 0
Last template export time : Never
Field count : 29
Field type Field length (bytes)
------------------------------------------------------------------------------
In packets 8
In bytes 8
First forwarded 4
Last forwarded 4
Input interface index 4
Output interface index 4
Source IPv4 address 4
Destination IPv4 address 4
Next hop IPv4 address 4
Source AS 4
Destination AS 4
L4 source port 2
L4 destination port 2
IP protocol version 1
TCP flags 1
Protocol 1
Source ToS 1
Source address mask 1
Destination address mask 1
Direction 1
Forwarding status 1
In VPN ID 2
Sampling algorithm 1
PAD 1
Sampling interval 4
VXLAN ID 4
App ID 4
Bgp-community 65535
VPN instance name 65535
表1-3 display ip netstream template命令显示信息描述表
字段 |
描述 |
Flow template refresh frequency |
模板的包刷新率 |
Flow template refresh interval |
模板的时间刷新率,单位为分钟 |
Active flow templates |
当前激活的模板数 |
Created flow templates |
创建的模板总数 |
MPLS outbound template |
MPLS出方向模板信息(仅在通过ip netstream mpls命令开启了MPLS报文统计功能的情况下才显示该模块信息) |
MPLS inbound template |
MPLS入方向模板信息(仅在通过ip netstream mpls命令开启了MPLS报文统计功能的情况下才显示该模块信息) |
L2L3 outbound template |
L2L3出方向模板信息 |
L2L3 inbound template |
L2L3入方向模板信息 |
L3 outbound template |
L3出方向模板信息 |
L3 inbound template |
L3入方向模板信息 |
Template ID |
模板ID |
Packets |
使用该模板的发送报文数 |
Last template export time |
该模板最近的一次输出时间 |
Field count |
模板的域总数 |
Field type |
域类型 |
Field length (bytes) |
域长度,单位为字节 |
Out packets |
输出的数据包个数 |
In packets |
输入的数据包个数 |
Out bytes |
输出的数据个数,单位为字节 |
In bytes |
输入的数据个数,单位为字节 |
First forwarded |
记录转发第一个报文时的系统时间,时间精确到毫秒 |
Last forwarded |
记录转发最后一个报文时的系统时间,时间精确到毫秒 |
Source IPv4 address |
源IP地址 |
Destination IPv4 address |
目的IP地址 |
Next hop IPv4 address |
下一跳地址 |
BGP next hop IPv4 address |
BGP下一跳地址,若流量没有按照BGP的路由表进行转发,则系统无法统计出BGP下一跳地址,该字段不显示 |
Input interface index |
输入接口的索引 |
Output interface index |
输出接口的索引 |
Source IPv4 address |
源IP地址 |
Destination IPv4 address |
目的IP地址 |
Next hop IPv4 address |
下一跳地址 |
Source VLAN |
源VLAN |
Destination VLAN |
目的VLAN |
Source AS |
源AS号 |
Destination AS |
目的AS号 |
L4 source port |
源端口号 |
L4 destination port |
目的端口号 |
IP protocol version |
IP协议版本号 |
TCP flags |
TCP Flag |
Input interface index |
输入接口的索引 |
Output interface index |
输出接口的索引 |
MPLS top label type |
MPLS栈顶标签类型 |
MPLS top label IPv6 address |
MPLS栈顶标签IPv6地址 |
MPLS top label IPv6 prefix |
MPLS栈顶标签IPv6地址前缀长度 |
Protocol |
四层协议类型 |
Source ToS |
源服务类型 |
Source address mask |
源地址掩码 |
Destination address mask |
目的地址掩码 |
Direction |
方向字段 |
Forwarding status |
转发状态 |
Out VPN ID |
出方向VPN索引 |
In VPN ID |
入方向VPN索引(仅版本10支持) |
Sampling algorithm |
采样算法 |
PAD |
空白占位符 |
MPLS label n |
MPLS标签位置,n取值范围为1~10,其中1表示栈顶标签,10表示第10层标签 |
Sampling interval |
采样率 |
VXLAN ID |
VXLAN ID(仅版本10支持) |
App ID |
应用类型 |
Bgp-community |
BGP团体属性值(仅版本10支持) 未配置ip netstream template rfc7011时,该字段显示为Bgp-community1、Bgp-community2、Bgp-community3、Bgp-community4,字段取值长度固定为4字节;配置ip netstream template rfc7011后,该字段显示为Bgp-community,为可变长字段,最大可取65535字节 |
VPN instance name |
VPN实例名称,公网实例显示为N/A |
SRv6 policy color |
SRv6 TE Policy的Color属性(仅版本9支持) |
SRv6 policy endpoint |
SRv6 TE Policy目的节点的IPv6地址(仅版本9支持) |
SRv6 policy name |
SRv6 TE Policy名称(仅版本9支持) |
Serial number |
设备序列号(仅版本9和10支持) |
enable命令用来开启聚合视图对应的聚合功能。
undo enable命令用来关闭聚合视图对应的聚合功能。
【缺省情况】
NetStream聚合功能处于关闭状态。
【缺省用户角色】
network-admin
[Sysname] ip netstream aggregation as
[Sysname-ns-aggregation-as] enable
【相关命令】
flow standard-mode enable命令用来将NetStream采样的高性能模式切换成标准模式。
undo flow standard-mode enable命令用来恢复缺省情况。
【命令】
flow standard-mode enable
undo flow standard-mode enable
【视图】
系统视图
【缺省情况】
NetStream采样模式为高性能模式。
【缺省用户角色】
network-admin
【使用指导】
配置本命令后,会释放高性能模式下NetStream采样占用的CPU资源,减轻设备负担。
本命令对IPv4 NetStream和IPv6 NetStream同时生效。
【举例】
# 将NetStream采样的高性能模式切换成标准模式。
<Sysname> system-view
[Sysname] flow standard-mode enable
ip netstream命令用来在接口视图下开启NetStream功能。
undo ip netstream命令用来在接口视图下关闭NetStream功能。
【命令】
ip netstream { inbound | outbound }
undo ip netstream { inbound | outbound }
【视图】
二层以太网接口视图
三层以太网接口视图
【缺省情况】
NetStream功能处于关闭状态。
【缺省用户角色】
network-admin
【参数】
inbound:对入方向的流量进行NetStream统计。
outbound:对出方向的流量进行NetStream统计。
【举例】
# 在接口Ten-GigabitEthernet3/1/1的入方向上开启NetStream功能。
<Sysname> system-view
[Sysname] interface ten-gigabitethernet 3/1/1
[Sysname-Ten-GigabitEthernet3/1/1] ip netstream inbound
ip netstream命令用来在系统视图下开启NetStream功能。
undo ip netstream命令用来在系统视图下关闭NetStream功能。
【命令】
ip netstream
undo ip netstream
【视图】
系统视图
【缺省情况】
NetStream功能处于关闭状态。
【缺省用户角色】
network-admin
【使用指导】
开启NetStream功能后,将开启所有接口入方向及出方向的NetStream功能。此时需要配置NetStream镜像功能才能使NetStream功能生效。
【举例】
# 在系统视图下开启NetStream功能。
<Sysname> system-view
[Sysname] ip netstream
ip netstream aggregation命令用来进入NetStream聚合视图。
undo ip netstream aggregation命令用来删除流聚合方式相应的配置。
【命令】
ip netstream aggregation { as | bgp-community | destination-prefix | prefix | prefix-port | protocol-port | source-prefix | tos-as | tos-bgp-nexthop | tos-destination-prefix | tos-prefix | tos-protocol-port | tos-source-prefix }
undo ip netstream aggregation { as | bgp-community | destination-prefix | prefix | prefix-port | protocol-port | source-prefix | tos-as | tos-bgp-nexthop | tos-destination-prefix | tos-prefix | tos-protocol-port | tos-source-prefix }
【缺省情况】
未配置NetStream流聚合方式。
【视图】
系统视图
【缺省用户角色】
network-admin
【参数】
as:自治系统聚合,根据NetStream流的源自治系统号、目的自治系统号、输入接口索引和输出接口索引4个关键项对流分类。
bgp-community:BGP团体属性聚合,根据NetStream流的输入、输出接口索引和BGP团体属性3个关键项对流分类。
destination-prefix:目的前缀聚合,根据NetStream流的目的自治系统号、目的掩码长度、目的前缀和输出接口索引4个关键项对流分类。
prefix:源和目的前缀聚合,根据NetStream流的源自治系统号、目的自治系统号、源掩码长度、目的掩码长度、源前缀、目的前缀、输入接口索引和输出接口索引8个关键项对流分类。
prefix-port:前缀端口聚合,根据NetStream流的源前缀、目的前缀、源掩码长度、目的掩码长度、ToS、协议号、源端口、目的端口、输入接口索引、输出接口索引10个关键项对流分类。
protocol-port:协议-端口聚合,根据NetStream流的协议号、源端口和目的端口3个关键项对流分类。
source-prefix:源前缀聚合,根据NetStream流的源自治系统号、源掩码长度、源前缀和输入接口索引4个关键项对流分类。
tos-as:服务类型-自治系统聚合,根据NetStream流的ToS、源自治系统号、目的自治系统号、输入接口索引和输出接口索引5个关键项对流分类。
tos-bgp-nexthop:服务类型-BGP下一跳聚合,根据NetStream流的服务类型、BGP下一跳IP地址、输出接口索引3个关键项对流分类。服务类型-BGP下一跳聚合只在V9模板下生效。
tos-destination-prefix:服务类型-目的前缀聚合,根据NetStream流的ToS、目的自治系统号、目的掩码长度、目的前缀和输出接口索引5个关键项对流分类。
tos-prefix:服务类型-前缀聚合,根据NetStream流的ToS、源自治系统号、源前缀、源掩码长度、目的自治系统号、目的掩码长度、目的前缀、输入接口索引和输出接口索引9个关键项对流分类。
tos-protocol-port:服务类型-协议-端口聚合,根据NetStream流的ToS、协议号、源端口、目的端口、输入接口索引和输出接口索引6个关键项对流分类。
tos-source-prefix:服务类型-源前缀聚合,根据NetStream流的ToS、源自治系统号、源前缀、源掩码长度和输入接口索引5个关键项对流分类。
【使用指导】
在聚合视图下,可以开启或关闭聚合功能,以及设置NetStream统计输出报文源接口、目的IP地址以及目的端口号。
如果一条流同时满足多个聚合方式,则该流会被统计到多个聚合流中。
【举例】
# 设置NetStream流聚合方式为自治系统聚合,并进入NetStream自治系统聚合视图。
<Sysname> system-view
[Sysname] ip netstream aggregation as
[Sysname-ns-aggregation-as]
【相关命令】
· enable
· ip netstream export host
· ip netstream export source
ip netstream aging命令用来开启定时老化和TCP的FIN或RST报文触发老化功能。
undo ip netstream aging命令用来关闭定时老化和TCP的FIN或RST报文触发老化功能。
【命令】
ip netstream aging
undo ip netstream aging
【缺省情况】
定时老化和TCP的FIN或RST报文触发老化功能处于开启状态。
【视图】
系统视图
【缺省用户角色】
network-admin
【举例】
# 关闭定时老化和TCP的FIN或RST报文触发老化功能。
<Sysname> system-view
[Sysname] undo ip netstream aging
ip netstream cache archive enable命令用来开启NetStream流表项信息存档功能。
undo ip netstream cache archive enable命令用来关闭NetStream流表项信息存档功能。
【命令】
ip netstream cache archive enable
undo ip netstream cache archive enable
【缺省情况】
NetStream流表项信息存档功能处于关闭状态。
【视图】
系统视图
【缺省用户角色】
network-admin
【使用指导】
开启本功能后,Netstream将统计到的流表项信息保存到本地。
本功能适用于少量NetStream流表项且无日志服务器的场景,对于大量NetStream流表项的场景,开启本功能后会影响设备性能,不建议启用。
【举例】
# 开启NetStream流表项信息存档功能。
<Sysname> system-view
[Sysname] ip netstream cache archive enable
【相关命令】
· display ip netstream cache archive
ip netstream export host命令用来配置NetStream统计输出报文的目的地址和目的UDP端口号。
undo ip netstream export host命令用来删除指定NetStream统计输出报文的目的地址或配置的所有地址。
【命令】
ip netstream export host { ipv4-address | ipv6-address } udp-port [ vpn-instance vpn-instance-name ]
undo ip netstream export host [ { ipv4-address | ipv6-address } [ vpn-instance vpn-instance-name ] ]
【缺省情况】
未配置NetStream统计输出报文的目的地址和目的UDP端口号。
【视图】
NetStream聚合视图
【缺省用户角色】
network-admin
【参数】
ipv4-address:NetStream统计输出报文的IPv4目的地址。
ipv6-address:NetStream统计输出报文的IPv6目的地址。
udp-port:NetStream统计输出报文的目的UDP端口号,取值范围为0~65535。
vpn-instance vpn-instance-name:指定NetStream统计输出报文的目的地址所属的VPN。vpn-instance-name表示MPLS L3VPN的VPN实例名称,为1~31个字符的字符串,区分大小写。如果未指定本参数,则表示NetStream统计输出报文的目的地址位于公网中。
【使用指导】
若没有使能某类聚合功能,则无法通过display ip netstream export命令查看它的相关信息(包括目的地址的目的UDP端口号)。
若聚合视图下未通过本命令配置目的地址和目的UDP端口号,则使用系统视图下的配置;若聚合视图下通过本命令配置了目的地址和目的UDP端口号,则优先使用聚合视图下的配置。
不同聚合视图下可以配置相同的目的地址和目的UDP端口号。同一个聚合视图下最多可以配置4组目的地址,设备会同时向多个已配置的目的地址发送NetStream报文,实现目的主机的备份。当多次执行本命令时:
· 如果指定的VPN参数不同,则不管IP地址和UDP端口号是否相同,均会配置成功,表示配置了不同组的目的地址。
· 如果指定的VPN参数相同或均未指定VPN参数,但IP地址不同,则均会配置成功,表示配置了不同组的目的地址。如果IP地址相同,但UDP端口号不同,则后配置的UDP端口号生效。
聚合流统计输出报文会发给聚合类型对应的聚合视图下配置的所有目的地址。
【举例】
# 配置自治系统聚合流的输出报文的目的IP地址为172.16.105.48,UDP端口号为5000。
<Sysname> system-view
[Sysname] ip netstream aggregation as
[Sysname-ns-aggregation-as] ip netstream export host 172.16.105.48 5000
【相关命令】
· ip netstream aggregation
· ip netstream export source
· ip netstream export host (system view)
· display ip netstream export
ip netstream export host命令用来配置NetStream统计输出报文的目的地址和目的UDP端口号。
undo ip netstream export host命令用来删除指定NetStream统计输出报文的目的地址或配置的所有地址。
【命令】
(独立运行模式)
ip netstream export host { ipv4-address | ipv6-address } udp-port [ vpn-instance vpn-instance-name ] [ slot slot-number [ cpu cpu-number ] ]
undo ip netstream export host [ { ipv4-address | ipv6-address } [ vpn-instance vpn-instance-name ] ] [ slot slot-number [ cpu cpu-number ] ]
(IRF模式)
ip netstream export host { ipv4-address | ipv6-address } udp-port [ vpn-instance vpn-instance-name ] [ chassis chassis-number slot slot-number [ cpu cpu-number ] ]
undo ip netstream export host [ { ipv4-address | ipv6-address } [ vpn-instance vpn-instance-name ] ] [ chassis chassis-number slot slot-number [ cpu cpu-number ] ]
【缺省情况】
未配置NetStream统计输出报文的目的地址和目的UDP端口号。
【视图】
系统视图
【缺省用户角色】
network-admin
【参数】
ipv4-address:NetStream统计输出报文的目的IPv4地址。
ipv6-address:NetStream统计输出报文的目的IPv6地址。
udp-port:NetStream统计输出报文的目的UDP端口号,取值范围为0~65535。
vpn-instance vpn-instance-name:指定NetStream统计输出报文的目的地址所属的VPN。vpn-instance-name表示MPLS L3VPN的VPN实例名称,为1~31个字符的字符串,区分大小写。如果未指定本参数,则表示NetStream统计输出报文的目的地址位于公网中。
slot slot-number:指定单板。slot-number为单板所在的槽位号。如果不指定本参数,则表示指定所有单板。(独立运行模式)
chassis chassis-number slot slot-number:指定单板。chassis-number表示设备在IRF中的成员编号,slot-number表示单板所在的槽位号。如果不指定本参数,则表示指定所有单板。(IRF模式)
cpu cpu-number:指定CPU。cpu-number表示单板上CPU的编号。只有指定的slot支持多CPU时,才能配置该参数。
【使用指导】
若聚合视图下未配置目的地址和目的UDP端口号,则使用系统视图下的配置;若聚合视图下配置了目的地址和目的UDP端口号,则优先使用聚合视图下的配置。
多次执行本命令(无论指定的IP地址和UDP端口号是否一样),带slot参数的配置和不带slot参数的配置都可以同时存在。对于同一单板,设备会优先采用带slot参数的配置。对于没有单独配置的单板,设备会采用不带slot参数的配置。
系统视图下最多配置4组目的地址,设备会同时向多个已配置的目的地址发送NetStream报文,实现目的主机的备份。当多次执行本命令时:
· 如果指定的VPN参数不同,则不管IP地址和UDP端口号是否相同,均会配置成功,表示配置了不同组的目的地址。
· 如果指定的VPN参数相同或均未指定VPN参数,而IP地址不同,则均会配置成功,表示配置了不同组的目的地址。如果IP地址相同,但UDP端口号不同,则后配置的UDP端口号生效。
相同slot最多指定四组目的地址。
【举例】
# 配置全局NetStream统计输出报文的目的IP地址为172.16.105.48,UDP端口号为5000。
<Sysname> system-view
[Sysname] ip netstream export host 172.16.105.48 5000
【相关命令】
· ip netstream aggregation
· ip netstream export source
· ip netstream export host (aggregation view)
· display ip netstream export
ip netstream export rate命令用来配置输出速率限制。
undo ip netstream export rate命令用来恢复缺省情况。
【命令】
ip netstream export rate rate
undo ip netstream export rate
【缺省情况】
NetStream统计输出报文的输出速率不受限制。
【视图】
系统视图
【缺省用户角色】
network-admin
【参数】
rate:NetStream统计输出报文的输出速率限制,取值范围为1~1000,单位为每秒最多允许输出的报文个数。
【使用指导】
配置输出速率限制,即限制每秒钟输出的最多报文数。
当设备每秒生成的NetStream报文数量超过限制,设备会将这些报文保存到缓冲区稍候发送。如果设备生成NetStream报文速率过快,会导致缓冲区被占满。此时,为避免NetStream报文丢失,该命令将暂时失效,设备会尽力发送NetStream报文,直到缓冲区能正常工作为止。
【举例】
# 设置每秒最多允许10个报文被输出。
<Sysname> system-view
[Sysname] ip netstream export rate 10
ip netstream export source命令用来配置NetStream统计输出报文的源接口。
undo ip netstream export source命令用来恢复缺省情况。
【命令】
ip netstream export source interface interface-type interface-number
undo ip netstream export source
【缺省情况】
采用统计输出报文的出接口IP地址作为源接口的IP地址。
【视图】
系统视图
NetStream聚合视图
【缺省用户角色】
network-admin
【参数】
interface-type interface-number:NetStream统计输出报文的源接口,由接口类型和接口编号组成。
【使用指导】
通过本命令配置源接口后,会将NetStream统计输出报文的源IP地址设置为该接口的IP地址。
不同聚合视图下可以配置不同的源接口。
聚合视图下若未配置源接口,则使用系统视图下的配置。
【举例】
# 将NetStream统计输出报文源接口设置为Ten-GigabitEthernet3/1/1。
<Sysname> system-view
[Sysname] ip netstream export source interface ten-gigabitethernet 3/1/1
# 将NetStream自治系统聚合统计输出报文源接口设置为Ten-GigabitEthernet3/1/2。
<Sysname> system-view
[Sysname] ip netstream aggregation as
[Sysname-ns-aggregation-as] ip netstream export source interface ten-gigabitethernet 3/1/2
【相关命令】
· ip netstream aggregation
ip netstream export template refresh-rate 命令用来配置NetStream统计输出报文版本9或版本10模板的刷新率。
undo ip netstream export template refresh-rate 命令用来恢复缺省情况。
【命令】
ip netstream export template refresh-rate { packet packets | time minutes }
undo ip netstream export template refresh-rate { packet | time }
【缺省情况】
每隔20个包设备刷新一次版本9或版本10模板。
每隔30分钟设备刷新一次版本9或版本10模板。
【视图】
系统视图
【缺省用户角色】
network-admin
【参数】
packet packets:NetStream统计输出报文版本9或版本10模板的包刷新率,取值范围为1~600,单位为包数,即每隔多少个包刷新一次模板,并通知NetStream服务器最新的模板格式。
time minutes:NetStream统计输出报文版本9或版本10模板的时间刷新率,取值范围为1~3600,单位为分钟,即每隔多少分钟刷新一次模板,并通知NetStream服务器最新的模板格式。
【使用指导】
版本9和版本10是基于模板方式的、支持自定义格式,由于NetStream服务器不会永久保存模板,所以设备需要定期通知NetStream服务器最新版本9或版本10模板格式。用户可以根据实际情况,配置版本9或版本10模板的包刷新率和时间刷新率,及时更新模板。
可以同时配置包刷新率和时间刷新率,只要满足任意一个刷新条件,设备就会将符合条件的模板发送给NetStream服务器。
【举例】
# 将NetStream统计输出报文版本9或版本10模板的包刷新率设为100。
<Sysname> system-view
[Sysname] ip netstream export template refresh-rate packet 100
ip netstream export version 5命令用来配置NetStream版本5的自治系统选项。
ip netstream export version 9命令用来配置NetStream版本9的自治系统选项、BGP下一跳选项和设备序列号选项。
ip netstream export version 10命令用来配置NetStream版本10的自治系统选项、BGP下一跳选项和设备序列号选项。
undo ip netstream export version命令用来恢复缺省情况。
【命令】
ip netstream export version 5 { origin-as | peer-as }
ip netstream export version { 9 | 10 } { origin-as | peer-as } [ bgp-nexthop ] [ serial-number ]
undo ip netstream export version
【缺省情况】
NetStream统计输出报文使用版本9,记录邻接自治系统(peer-as)信息,不记录BGP下一跳信息和设备序列号信息。
【视图】
系统视图
【缺省用户角色】
network-admin
【参数】
origin-as:流信息中记录的自治系统号为起始自治系统号。
peer-as:流信息中记录的自治系统号为邻接自治系统号。
bgp-nexthop:流信息中记录BGP下一跳。
serial-number:流信息中记录设备序列号。
【使用指导】
NetStream流信息中会记录流的源IP地址及其对应的自治系统号;目的IP地址及其对应的自治系统号。设备会根据用户实际配置的自治系统参数来确定记录的自治系统号。版本9和版本10还可以配置是否记录BGP下一跳信息和设备序列号信息。
同一时间,Netstream只能使用一个版本输出报文,所以,多次执行本命令,最后一次执行的命令生效。
当设备上配置了聚合时,如果配置输出报文为版本5,则流统计信息采用版本8输出;如果配置输出为版本9,则流统计信息采用版本9输出;如果配置输出为版本10,则流统计信息采用版本10输出。
【举例】
# 将NetStream统计输出报文为版本5,并设置流信息中记录的自治系统号为起始自治系统号。
<Sysname> system-view
[Sysname] ip netstream export version 5 origin-as
# 将NetStream统计输出报文为版本9,并设置流信息中记录的自治系统号为起始自治系统号,同时记录BGP下一跳信息和设备序列号信息。
<Sysname> system-view
[Sysname] ip netstream export version 9 origin-as bgp-nexthop serial-number
ip netstream max-entry命令用来配置NetStream流缓存区中流表项的最大数目及达到最大数目时的处理方式。
undo ip netstream max-entry命令用来恢复缺省情况。
【命令】
ip netstream max-entry { max-entries | aging | disable-caching }
undo ip netstream max-entry
【缺省情况】
NetStream流缓存区中流表项的最大数目为2048000,达到流表项的最大数目时,强制老化部分流表项。
【视图】
系统视图
【缺省用户角色】
network-admin
【参数】
max-entries:NetStream流缓存区中流表项的最大数目。取值范围为1024~2048000。
aging:达到流表项的最大数目时,强制老化部分流表项。
disable-caching:达到流表项的最大数目时,禁止新建流表项。
【使用指导】
max-entries参数值在各单板上单独生效,而不是各单板的总和。
多次执行ip netstream max-entry max-entries命令,最后一次执行的命令生效。多次执行ip netstream max-entry { aging | disable-caching }命令,最后一次执行的命令生效。
【举例】
# 设置NetStream流缓存区中流表项的最大数目为5000。
<Sysname> system-view
[Sysname] ip netstream max-entry 5000
# 设置NetStream在达到流表项的最大数目时,禁止新建流表项。
<Sysname> system-view
[Sysname] ip netstream max-entry disable-caching
# 设置NetStream在达到流表项的最大数目时,强制老化部分流表项。
<Sysname> system-view
[Sysname] ip netstream max-entry aging
ip netstream mpls命令用来开启MPLS报文统计功能。
undo ip netstream mpls命令用来关闭MPLS报文统计功能。
【命令】
ip netstream mpls [ label-positions label-position1 [ label-position2 [ label-position3 ] ] ] [ no-ip-fields ]
undo ip netstream mpls
【缺省情况】
MPLS报文统计功能处于关闭状态。
【视图】
系统视图
【缺省用户角色】
network-admin
【参数】
label-positions:统计的MPLS报文的标签位置。
label-position1:指定统计的MPLS报文的第一个标签位置,取值范围为1~10。其中1表示栈顶标签,10表示第10层标签,以此类推。
label-position2:指定统计的MPLS报文的第二个标签位置,取值范围为1~10中除了已被指定过的标签位置。其中1表示栈顶标签,10表示第10层标签,以此类推。
label-position3:指定统计的MPLS报文的第三个标签位置,取值范围为1~10中除了已被指定过的标签位置。其中1表示栈顶标签,10表示第10层标签,以此类推。
no-ip-fields:不统计MPLS报文中的IP选项。
【使用指导】
该命令可同时开启IPv4 NetStream和IPv6 NetStream对MPLS报文的统计功能。
若未指定任何参数,表示基于MPLS报文的首标签并且带有IP选项进行统计。
当需要统计MPLS报文的多个标签时,指定的标签位置不允许重复且无大小顺序要求,最终统计到的多个标签的位置的MPLS信息将按照从小到大的顺序显示。
多次执行本命令,最后一次执行的命令生效。
【举例】
# 开启MPLS报文统计功能,基于MPLS报文的首标签并且不带IP选项进行统计。
<Sysname> system-view
[Sysname] ip netstream mpls no-ip-fields
ip netstream sampler命令用来配置NetStream采样率。
undo ip netstream sampler命令用来恢复缺省情况。
【命令】
ip netstream { inbound | outbound } sampler sampler-name
undo ip netstream { inbound | outbound } sampler
【缺省情况】
NetStream采样率为1。
【视图】
二层以太网接口视图
三层以太网接口视图
【缺省用户角色】
network-admin
【参数】
inbound:对入方向的报文进行采样。
outbound:对出方向的报文进行采样。
sampler sampler-name:采样器名称,为1~31个字符的字符串,不区分大小写。
【使用指导】
通过配置NetStream采样率,可在满足NetStream收集到的统计信息能基本反映整个网络的状况的前提下,减少网络的流量,避免网络中的大流量对设备转发性能造成影响。采样率越低对设备性能的影响越小。
【举例】
# 在接口Ten-GigabitEthernet3/1/1上配置使用名为abc的采样器对入方向的报文进行采样,Netstream根据采样结果进行报文统计。
<Sysname> system-view
[Sysname] interface ten-gigabitethernet 3/1/1
[Sysname-Ten-GigabitEthernet3/1/1] ip netstream inbound
[Sysname-Ten-GigabitEthernet3/1/1] ip netstream inbound sampler abc
ip netstream outbound sampler srv6-policy命令用来配置SRv6 TE Policy报文的NetStream采样率。
undo ip netstream outbound sampler srv6-policy命令用来恢复缺省情况。
【命令】
ip netstream outbound sampler sampler-name srv6-policy end-point ipv6 ipv6-address color color-value
undo ip netstream outbound sampler sampler-name srv6-policy end-point ipv6 ipv6-address color color-value
【缺省情况】
SRv6 TE Policy报文的NetStream采样率为1。
【视图】
系统视图
【缺省用户角色】
network-admin
【参数】
end-point ipv6 ipv6-address:SRv6 TE Policy目的节点的IPv6地址。
color color-value:SRv6 TE Policy的Color属性,取值范围为0~4294967295。
sampler-name:采样器名称,为1~31个字符的字符串,不区分大小写。
【使用指导】
在SRv6 TE Policy头节点上配置SRv6 TE Policy报文的NetStream采样率后,将会对头节点上引流到指定SRv6 TE Policy报文进行NetStream采样。可在满足NetStream收集到的统计信息能基本反映整个网络的状况的前提下,减少网络的流量,避免网络中的大流量对设备转发性能造成影响。采样率越低对设备性能的影响越小。有关SRv6 TE Policy的详细介绍,请参见“Segment Routing配置指导”中的“SRv6 TE Policy”。
【举例】
# 配置对SRv6 TE Policy头节点上引流到目的节点的IPv6地址为1000::1、Color属性为10的SRv6 TE Policy报文进行NetStream采样,使用名为abc的采样器对出方向的报文进行采样,Netstream根据采样结果进行报文统计。
<Sysname> system-view
[Sysname] ip netstream outbound sampler abc srv6-policy end-point ipv6 1000::1 color 10
ip netstream outbound srv6-policy命令用来开启SRv6 TE Policy报文的NetStream功能。
undo ip netstream outbound srv6-policy命令用来关闭SRv6 TE Policy报文的NetStream功能。
【命令】
ip netstream outbound srv6-policy end-point ipv6 ipv6-address color color-value
undo ip netstream outbound srv6-policy end-point ipv6 ipv6-address color color-value
【缺省情况】
SRv6 TE Policy报文的NetStream功能处于关闭状态。
【视图】
系统视图
【缺省用户角色】
network-admin
【参数】
end-point ipv6 ipv6-address:SRv6 TE Policy目的节点的IPv6地址。
color color-value:SRv6 TE Policy的Color属性,取值范围为0~4294967295。
【使用指导】
在SRv6 TE Policy头节点上开启本功能后,将会对头节点上引流到指定SRv6 TE Policy的报文进行NetStream统计。有关SRv6 TE Policy的详细介绍,请参见“Segment Routing配置指导”中的“SRv6 TE Policy”。
SRv6 TE Policy报文的NetStream统计功能开启和关闭状态,不受全局NetStream功能是否开启的影响,只由本命令控制。
【举例】
# 配置对SRv6 TE Policy头节点上引流到目的节点的IPv6地址为1000::1、Color属性为10的SRv6 TE Policy的报文进行NetStream统计。
<Sysname> system-view
[Sysname] ip netstream outbound srv6-policy end-point ipv6 1000::1 color 10
ip netstream template rfc7011命令用来配置模板格式与RFC协议一致。
undo ip netstream template rfc7011命令用来恢复缺省情况。
【命令】
ip netstream template rfc7011
undo ip netstream template rfc7011
【缺省情况】
设备采用H3C私有的NetStream的模板格式。
【视图】
系统视图
【缺省用户角色】
network-admin
【使用指导】
缺省情况下,设备采用H3C私有的NetStream的模板格式。配置该命令后,NetStream将使用RFC7011协议定义的模板格式输出报文。设备端选用的模板格式必须和服务器端选用的模板格式保持一致。
该命令对IPv4和IPv6 NetStream模板格式同时生效。
【举例】
# 配置模板格式与RFC7011协议一致。
<Sysname> system-view
[Sysname] ip netstream template rfc7011
ip netstream timeout active命令用来配置流的活跃老化时间。
undo ip netstream timeout active命令用来恢复缺省情况。
【命令】
ip netstream timeout active minutes
undo ip netstream timeout active
【缺省情况】
流的活跃老化时间为30分钟。
【视图】
系统视图
【缺省用户角色】
network-admin
【参数】
minutes:流的活跃老化时间,取值范围为1~60,单位为分钟。
【使用指导】
从采集到的第一个报文开始,该流在指定的时间内能被采集到,则该流属于活跃的流,指定的时间称为流的活跃老化时间。
【举例】
# 将流的活跃老化时间设置为60分钟。
<Sysname> system-view
[Sysname] ip netstream timeout active 60
【相关命令】
· ip netstream timeout inactive
ip netstream timeout inactive命令用来配置流的不活跃老化时间。
undo ip netstream timeout inactive命令用来恢复缺省情况。
【命令】
ip netstream timeout inactive seconds
undo ip netstream timeout inactive
【缺省情况】
流的不活跃老化时间为30秒。
【视图】
系统视图
【缺省用户角色】
network-admin
【参数】
seconds:流的不活跃老化时间,取值范围为10~600,单位为秒。
【使用指导】
从采集到的最后一个报文开始,该流在指定的时间内没有被采集到,则该流属于不活跃的流,指定的时间称为流的不活跃老化时间。
【举例】
# 将流的不活跃老化时间设置为60秒。
<Sysname> system-view
[Sysname] ip netstream timeout inactive 60
【相关命令】
reset ip netstream statistics命令用来将流缓存区中所有流强制老化,输出报文信息,并清空NetStream缓冲区的状态信息。
【命令】
reset ip netstream statistics
【视图】
用户视图
【缺省用户角色】
network-admin
【使用指导】
在执行清空缓冲区中老化流的动作时,命令行会给出提示,告知用户这个动作可能要持续几分钟,在这段时间内不能统计。
【举例】
# 将流缓存区中所有流老化,输出报文信息,并清空NetStream缓冲区的状态信息。
<Sysname> reset ip netstream statistics
This process may take a few minutes.
Netstream statistic function is disabled during this process.
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!