02-INT配置
本章节下载: 02-INT配置 (308.06 KB)
INT(In-band Telemetry,带内遥测)是一项从设备上采集数据的网络监控技术。配置了INT功能的设备会主动向采集器上送采集数据,提供实时、高速的数据采集功能,采集器分析收到的采集数据,以达到对网络设备的性能及网络运行情况进行监控的目的。
INT网络由开启INT功能的设备组成,该网络中包含一个首节点、若干中间节点和一个尾节点设备。
图1-1 INT网络示意图
INT功能通过镜像原始报文、插入INT报文头和采集信息的方式生成INT报文。INT报文头和采集信息位于原始IP头内部,所以INT报文与原始报文含有相同的IP头,走相同的转发链路,进而对路径上各节点进行信息采集。
目前设备支持基于TCP报文和UDP报文生成INT报文。INT报文的协议编号为253。
当前INT功能支持普通型INT和灵活型INT。普通型INT和灵活型INT在信息采集方面没有差异,但运行机制和配置逻辑稍有不同。
· 普通型INT网络中:每个节点的设备需要在入接口配置设备在INT网络中的角色为Ingress、Transit或Egress。首节点通过QoS策略定义数据流,中间节点和尾节点自动识别INT报文并对报文进行相应的INT处理。因此,流量转发路径的每个入接口上都只支持对首节点定义的数据流进行INT处理。
· 灵活型INT网络中:不需要配置设备在INT网络中的角色,每个节点的设备都可以通过ACL定义数据流(对于同一条流,首节点匹配原始报文,中间节点和尾节点匹配INT报文),并针对该数据流配置相应的INT处理动作。设备支持在同一接口上通过ACL匹配多条数据流并针对不同的数据流分别配置INT处理动作。
普通型INT的配置较为简洁,建议优先采用普通型INT。仅当INT节点需要在同一接口对多条数据流进行INT处理的时候采用灵活型INT。
如图1-2所示,普通型INT中各节点实现功能如下:
· 首节点
流量入接口上通过QoS策略将命中规则的报文镜像、采样至设备内部的INT处理器。处理器对其添加INT报文头,然后将INT报文环回至入接口。入接口根据INT标记自动识别INT报文,添加采集信息,查表转发。出接口添加采集信息,并发送给中间节点。
· 中间节点
流量入接口根据INT标记自动识别INT报文,添加采集信息,查表转发。出接口添加采集信息,发送给尾节点。
· 尾节点
流量入接口根据INT标记自动识别INT报文,添加采集信息,上送至INT处理器加封装后,查表转发至出接口,发送给采集器。
如图1-2所示,以同一条流的INT处理为例,灵活型INT中各节点实现功能如下:
· 首节点
入接口通过ACL对原始报文进行筛选,命中规则的报文被镜像、采样至设备内部的INT处理器。处理器为其添加INT报文头,然后将INT报文环回至入接口。入接口通过ACL筛选出本机环回INT报文,对其添加采集信息,查表转发。出接口添加采集信息,并发送给中间节点。
· 中间节点
入接口通过ACL筛选出INT报文,为命中规则的报文添加采集信息后,查表转发至出接口,出接口为INT报文添加采集信息,发送给尾节点。
· 尾节点
入接口通过ACL筛选出INT报文,为命中规则的报文被采样至INT处理器,处理器对其进行封装,然后查表转发至出接口,发送给采集器。
图1-2 INT功能组网与处理机制示意图
在配置INT功能时,建议先配置中间节点和尾节点,最后配置首节点。
在配置INT功能时,如果组网中已配置了首节点,则在报文转发的路径上不能再配置首节点,否则INT报文会被重复采样。
S9825系列交换机仅支持配置中间结点。
对于S9825系列交换机,INT报文的MMU stats字段信息的bit23:21会固定记录为3。
在INT的采集信息中,
· S9825和S9855系列交换机均不支持queue transmit bytes count字段。
· S9825系列交换机不支持egress port speed字段。
· S9825和S9855系列交换机的rx timestamp sec字段仅支持显示设备的启动时间。
在INT首节点为报文添加INT报文头中,入端口信息会被固定填充为0xFF。
INT报文的IP协议号为253,和原报文的协议号不一致。如果在报文的转发路径上存在多条等价的路径,并且设备上配置了根据报文的IP协议号进行负载分担,则INT报文和原报文的转发路径会不一致。
(1) 配置设备ID。
a. 进入系统视图。
system-view
b. 配置设备ID。
telemetry ifa device-id numeral
缺省情况下,INT设备未配置设备ID。
(2) 指定Egress接口。
a. 进入接口视图。
interface interface-type interface-number
b. 配置当前接口为Egress接口。
telemetry ifa role egress
缺省情况下,未配置设备接口在INT网络中的角色。
c. 退回系统视图。
quit
(3) 配置INT报文上送采集器时的封装参数。
telemetry ifa collector source source-address destination dest-address source-port port destination-port port [ vlan vlan-id ]
缺省情况下,未配置INT报文的IP地址、端口号及VLAN编号。
(4) 开启INT功能。
telemetry ifa global enable
缺省情况下,INT功能处于开启状态。
(1) 配置设备ID。
a. 进入系统视图。
system-view
b. 配置设备ID。
telemetry ifa device-id numeral
缺省情况下,INT设备未配置设备ID。
(2) 指定Transit接口。
a. 进入接口视图。
interface interface-type interface-number
b. 配置当前接口为Transit接口。
telemetry ifa role transit
缺省情况下,未配置设备接口在INT网络中的角色。
c. 退回系统视图。
quit
(3) 开启INT功能。
telemetry ifa global enable
缺省情况下,INT功能处于开启状态。
a. 进入系统视图。
system-view
b. 配置设备ID。
telemetry ifa device-id numeral
缺省情况下,INT设备未配置设备ID。
(2) 指定Ingress接口。
a. 进入接口视图。
interface interface-type interface-number
b. 配置当前接口为Ingress接口。
telemetry ifa role ingress
缺省情况下,未配置设备接口在INT网络中的角色。
c. 退回系统视图。
quit
(3) 配置流量镜像到INT处理器。
a. 请依次执行以下命令配置流分类。
traffic classifier classifier-name [ operator { and | or } ]
if-match match-criteria
quit
具体流分类规则的配置,请参见“QoS命令”中的if-match命令。
b. 请依次执行以下命令配置流行为。
traffic behavior behavior-name
mirror-to ifa-processor [ sampler sampler-name ]
quit
镜像至INT处理器命令的详细情况请参见“网络管理和监控命令参考”中的“镜像”。
c. 请依次执行以下命令配置QoS策略。
qos [ mirroring ] policy policy-name
classifier classifier-name behavior behavior-name
quit
d. 请依次执行以下命令将QoS策略应用在接口入方向上。
interface interface-type interface-number
qos apply [ mirroring ] policy policy-name inbound
quit
(4) 开启INT功能。
telemetry ifa global enable
缺省情况下,INT功能处于开启状态。
(1) 配置设备ID。
a. 进入系统视图。
system-view
b. 配置设备ID。
telemetry ifa device-id numeral
缺省情况下,INT设备未配置设备ID。
(2) 在流量入接口配置将INT流量镜像至INT处理器动作,并丢弃原始INT报文。
a. 创建IPv4、IPv6、二层或用户自定义ACL,并进入其视图。
有关acl命令的详细介绍,请参见“ACL和QoS命令参考”中的“ACL”。
b. 创建规则。
有关rule (user-defined ACL view)命令的详细介绍,请参见“ACL和QoS命令参考”中的“ACL”。
注意,本规则中需要配置如下两种内容,且必须配置在同一条规则中。首节点上配置的将原始流量镜像至INT处理器动作中引用了ACL,本规则中要配置与其相同的流量特征匹配项。例如,首节点上配置的镜像至INT处理器动作引用的ACL中,规则为rule permit tcp source 10.0.0.3 0,则本规则需配置为rule permit tcp source 10.0.0.3 0。
c. 退回系统视图
quit
d. 进入接口视图。
interface interface-type interface-number
e. 对接口入方向的INT流量添加采集信息动作,并丢弃原始INT报文。
telemetry ifa ifa-id [ acl [ ipv6 | mac | user-defined ] { acl-number | name acl-name } ] action add-metadata drop
缺省情况下,未配置INT动作。
f. 退回系统视图。
quit
(3) 配置INT报文上送采集器的封装参数。
telemetry ifa collector source source-address destination dest-address source-port port destination-port port [ vlan vlan-id ]
缺省情况下,未配置INT报文的IP地址、端口号及VLAN编号。
(4) 开启INT功能。
telemetry ifa global enable
缺省情况下,INT功能处于开启状态。
(1) 配置设备ID。
a. 进入系统视图。
system-view
b. 配置设备ID。
telemetry ifa device-id numeral
缺省情况下,INT设备未配置设备ID。
(2) 在流量入接口配置对INT流量添加采集信息动作。
a. 创建IPv4、IPv6、二层或用户自定义ACL,并进入其视图。
有关acl命令的详细介绍,请参见“ACL和QoS命令参考”中的“ACL”。
b. 创建规则。
有关rule (user-defined ACL view)命令的详细介绍,请参见“ACL和QoS命令参考”中的“ACL”。
注意,本规则中需要配置如下两种内容,且必须配置在同一条规则中。首节点上配置的将原始流量镜像至INT处理器动作中引用了ACL,本规则中要配置与其相同的流量特征匹配项。例如,首节点上配置的镜像至INT处理器动作引用的ACL中,规则为rule permit tcp source 10.0.0.3 0,则本规则需配置为rule permit tcp source 10.0.0.3 0。
c. 退回系统视图
quit
d. 进入接口视图。
interface interface-type interface-number
e. 对接口入方向的INT流量配置添加采集信息动作。
telemetry ifa ifa-id [ acl [ ipv6 | mac | user-defined ] { acl-number | name acl-name } ] action add-metadata
缺省情况下,未配置INT动作。
f. 退回系统视图。
quit
(3) 开启INT功能。
telemetry ifa global enable
缺省情况下,INT功能处于开启状态。
(1) 配置设备ID。
a. 进入系统视图。
system-view
b. 配置设备ID。
telemetry ifa device-id numeral
缺省情况下,INT设备未配置设备ID。
(2) 在流量入接口配置将原始流量镜像至INT处理器动作。
a. 创建IPv4、IPv6、二层或用户自定义ACL,并进入其视图。
有关acl命令的详细介绍,请参见“ACL和QoS命令参考”中的“ACL”。
b. 创建规则。
有关rule命令的详细介绍,请参见“ACL和QoS命令参考”中的“ACL”。
c. 退回系统视图
quit
d. 进入接口视图。
interface interface-type interface-number
e. 对接口入方向的原始流量配置镜像至INT处理器动作。
telemetry ifa ifa-id [ acl [ ipv6 | mac | user-defined ] { acl-number | name acl-name } ] action mirror-to-processor [ sampler sampler-name ]
缺省情况下,未配置INT动作。
f. 退回系统视图。
quit
(3) 开启INT功能。
telemetry ifa global enable
如果网络管理员希望本节点暂时不向下一节点发送INT报文,则可以开启全局丢弃INT报文功能。
(1) 进入系统视图。
system-view
(2) 配置全局丢弃INT报文。
telemetry ifa global packet-drop
缺省情况下,全局丢弃INT报文功能处于关闭状态。
可在任意视图下执行以下命令:
· 显示接口上QoS策略的配置信息和运行情况。
display qos [ mirroring ] policy interface [ interface-type interface-number ] [ slot slot-number ] inbound
· 显示INT的配置信息
display telemetry ifa
在Device A、Device B和Device C上分别配置普通型INT功能,Device C将INT报文上送采集器。
(1) IP地址和单播路由协议的具体配置过程略
(2) 配置尾节点Device C
# 配置设备ID为11。
<DeviceC> system-view
[DeviceC] telemetry ifa device-id 11
# 指定流量的入接口HundredGigE1/0/1为Egress接口。
[DeviceC] interface hundredgige 1/0/1
[DeviceC-HundredGigE1/0/1] telemetry ifa role egress
[DeviceC-HundredGigE1/0/1] quit
# 配置INT报文上送采集器时的封装参数。
[DeviceC] telemetry ifa collector source 20.0.0.2 destination 30.0.0.1 source-port 12 destination-port 14
# 开启INT功能。
[DeviceC] telemetry ifa global enable
(3) 配置中间节点Device B
# 配置设备ID为10。
<DeviceB> system-view
[DeviceB] telemetry ifa device-id 10
# 指定流量的入接口HundredGigE1/0/1为Transit接口。
[DeviceB] interface hundredgige 1/0/1
[DeviceB-HundredGigE1/0/1] telemetry ifa role transit
[DeviceB-HundredGigE1/0/1] quit
# 开启INT功能。
[DeviceB] telemetry ifa global enable
(4) 配置首节点Device A
# 配置设备ID为9。
<DeviceA> system-view
[DeviceA] telemetry ifa device-id 9
# 指定流量的入接口HundredGigE1/0/1为Ingress接口。
[DeviceA] interface hundredgige 1/0/1
[DeviceA-HundredGigE1/0/1] telemetry ifa role ingress
[DeviceA-HundredGigE1/0/1] quit
# 创建一个名为samp的采样器,采用随机采样方式,按照2的次方模式采样,采样率为8。
[DeviceA] sampler samp mode random packet-interval n-power 8
# 创建类classifier1,匹配目的MAC地址为a08c-fdd7-fd99的报文。
[DeviceA] traffic classifier classifier1
[DeviceA-classifier-classifier1] if-match destination-mac a08c-fdd7-fd99
[DeviceA-classifier-classifier1] quit
# 创建流行为behavior1,动作为流量镜像到INT处理器,并引用采样器samp。
[DeviceA] traffic behavior behavior1
[DeviceA-behavior-behavior1] mirror-to ifa-processor sampler samp
[DeviceA-behavior-behavior1] quit
# 创建QoS策略,命名为ifa1,将流分类classifier1和流行为behavior1进行关联。
[DeviceA] qos policy ifa1
[DeviceA-qospolicy-ifa1] classifier classifier1 behavior behavior1
[DeviceA-qospolicy-ifa1] quit
# 将QoS策略ifa1应用到接口HundredGigE1/0/1的入方向上。
[DeviceA] interface hundredgige 1/0/1
[DeviceA-HundredGigE1/0/1] qos apply policy ifa1 inbound
[DeviceA-HundredGigE1/0/1] quit
# 开启INT功能。
[DeviceA] telemetry ifa global enable
# 查看Device A相关配置是否生效。
[DeviceA] display qos policy interface hundredgige 1/0/1 inbound
Interface: HundredGigE1/0/1
Direction: Inbound
Policy: ifa1
Classifier: classifier1
Operator: AND
Rule(s) :
If-match destination-mac a08c-fdd7-fd99
Behavior: behavior1
Mirroring:
Mirror to the ifa-processor sampler samp
[DeviceA] display telemetry ifa
Telemetry ifa status : Enabled
Telemetry ifa packet-drop : Disabled
Telemetry ifa device-id: 9
Telemetry ifa role:
HundredGigE1/0/1: Ingress
# 查看Device B相关配置是否生效。
[DeviceB] display telemetry ifa
Telemetry ifa status : Enabled
Telemetry ifa packet-drop : Disabled
Telemetry ifa device-id: 10
Telemetry ifa role:
HundredGigE1/0/1: Transit
# 查看Device C相关配置是否生效。
[DeviceC] display telemetry ifa
Telemetry ifa status : Enabled
Telemetry ifa packet-drop : Disabled
Telemetry ifa device-id: 11
Telemetry ifa role:
HundredGigE1/0/1: Egress
Telemetry ifa collector:
Source IP: 20.0.0.2
Destination IP: 30.0.0.1
Source-port: 12
Destination-port: 14
在Device A、Device B和Device C上分别配置灵活型INT功能,Device C将INT报文送往采集器。
(1) IP地址和单播路由协议的具体配置过程略
(2) 配置尾节点Device C
# 配置设备ID为11。
<DeviceC> system-view
[DeviceC] telemetry ifa device-id 11
# 创建用户自定义ACL 5000,并配置规则为匹配源IP地址为192.168.1.2的INT报文。
[DeviceC] acl user-defined 5000
[DeviceC-acl-user-5000] rule permit tcp source 192.168.1.2 0
[DeviceC-acl-user-5000] rule permit udp source 192.168.1.2 0
[DeviceC-acl-user-5000] quit
# 对接口HundredGigE1/0/1入方向的INT流量添加采集信息动作,并丢弃原始INT报文。
[DeviceC] interface hundredgige 1/0/1
[DeviceC-HundredGigE1/0/1] telemetry ifa 1 acl user-defined 5000 action add-metadata drop
[DeviceC-HundredGigE1/0/1] quit
# 配置INT报文上送采集器时的封装参数。
[DeviceC] telemetry ifa collector source 20.0.0.2 destination 30.0.0.1 source-port 12 destination-port 14
# 开启INT功能。
[DeviceC] telemetry ifa global enable
(3) 配置中间节点Device B
# 配置设备ID为10。
<DeviceB> system-view
[DeviceB] telemetry ifa device-id 10
# 创建用户自定义ACL 5000,并配置规则为匹配源IP地址为192.168.1.2的INT报文。
[DeviceB] acl user-defined 5000
[DeviceB-acl-user-5000] rule permit tcp source 192.168.1.2 0
[DeviceB-acl-user-5000] rule permit udp source 192.168.1.2 0
[DeviceB-acl-user-5000] quit
# 对接口HundredGigE1/0/1入方向的INT流量配置添加采集信息动作。
[DeviceB] interface hundredgige 1/0/1
[DeviceB-HundredGigE1/0/1] telemetry ifa 1 acl user-defined 5000 action add-metadata
[DeviceB-HundredGigE1/0/1] quit
# 开启INT功能。
[DeviceB] telemetry ifa global enable
(4) 配置首节点Device A
# 配置设备ID为9。
<DeviceA> system-view
[DeviceA] telemetry ifa device-id 9
# 创建一个名为samp的采样器,采用随机采样方式,按照2的次方模式采样,采样率为8。
[DeviceA] sampler samp mode random packet-interval n-power 8
# 创建IPv4基本ACL 2000,并配置规则为匹配源IP地址为192.168.1.2的报文。
[DeviceA] acl basic 2000
[DeviceA-acl-ipv4-basic-2000] rule permit source 192.168.1.2 0
[DeviceA-acl-ipv4-basic-2000] quit
# 对接口HundredGigE1/0/1入方向的原始流量配置镜像至INT处理器动作:引用ACL 2000和采样器samp,对命中ACL规则的原始报文镜像、采样至INT处理器。
[DeviceA] interface hundredgige 1/0/1
[DeviceA-HundredGigE1/0/1] telemetry ifa 1 acl 2000 action mirror-to-processor sampler samp
[DeviceA-HundredGigE1/0/1] quit
# 开启INT功能。
[DeviceA] telemetry ifa global enable
# 查看Device A相关配置是否生效。
[DeviceA] display telemetry ifa
Telemetry ifa status : Enabled
Telemetry ifa packet-drop : Disabled
Telemetry ifa device-id: 9
Telemetry ifa action:
HundredGigE1/0/1:
Telemetry ifa 1 acl 2000 action mirror-to-processor sampler samp
# 查看Device B相关配置是否生效。
[DeviceB] display telemetry ifa
Telemetry ifa status : Enabled
Telemetry ifa packet-drop : Disabled
Telemetry ifa device-id: 10
Telemetry ifa action:
HundredGigE1/0/1:
Telemetry ifa 1 acl user-defined 5000 action add-metadata
# 查看Device C相关配置是否生效。
[DeviceC] display telemetry ifa
Telemetry ifa status : Enabled
Telemetry ifa packet-drop : Disabled
Telemetry ifa device-id: 11
Telemetry ifa action:
HundredGigE1/0/1:
Telemetry ifa 1 acl user-defined 5000 action add-metadata drop
Telemetry ifa collector:
Source IP: 20.0.0.2
Destination IP: 30.0.0.1
Source-port: 12
Destination-port: 14
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!