此产品的文档集力求使用非歧视性语言。在本文档集中,非歧视性语言是指不隐含针对年龄、残障、性别、种族身份、族群身份、性取向、社会经济地位和交叉性的歧视的语言。由于产品软件的用户界面中使用的硬编码语言、基于 RFP 文档使用的语言或引用的第三方产品使用的语言,文档中可能无法确保完全使用非歧视性语言。 深入了解思科如何使用包容性语言。
思科采用人工翻译与机器翻译相结合的方式将此文档翻译成不同语言,希望全球的用户都能通过各自的语言得到支持性的内容。 请注意:即使是最好的机器翻译,其准确度也不及专业翻译人员的水平。 Cisco Systems, Inc. 对于翻译的准确性不承担任何责任,并建议您总是参考英文原始文档(已提供链接)。
本文档介绍在统一计算系统(UCS)第4代交换矩阵互联(FI)6454中使用嵌入式逻辑分析器模块(ELAM)工具,以及如何最好地使用它。
读者无需满足任何前提条件即可理解本文档内容。
Cisco 建议您了解以下主题:
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您的网络处于活动状态,请确保您了解所有命令的潜在影响。
UCS第4代FI能够运行ELAM捕获。ELAM捕获嵌入在ASIC中。
ELAM工具允许实时查看在ASIC级别转发的数据包。您可以查看数据包的详细信息,例如:
ELAM提供数据包转发的详细信息。它对数据平面无干扰。
通过命令行界面(CLI)登录UCS。
运行以下命令:
#connect nxos a|b
#attach module 1
#debug platform internal tah elam asic 0
#trigger init asic 0 slice 0 lu-a2d 1 in-select 6 out-select 1
#set outer ...
#start
#report
注意:第4代FI是单机架单元,具有一个模块(模块1)、一个ASIC(asic 0)和一个片(片0)。 请参阅以下输出。
RCH-SV-FFAIII-A(nx-os)# show hardware internal tah interface ethernet 1/30
#########################################
IfIndex: 436222464
DstIndex: 6028
IfType: 26
Interface name Ethernet1/30
Asic: 0
Asic: 0 <<<<<
AsicPort: 49
SrcId: 98
Slice: 0 <<<<<
PortOnSlice: 49
Table entries for interface Ethernet1/30
对于ELAM,使用基于数据包属性“lu-a2d 1”的触发器。值6和1将分别用于“in-select”和“out-select”,以用于出现兴趣
“set outer”命令是我们的过滤器,我们在此定义并告诉FI我们要捕获什么数据包,有许多选项,我们可以根据需要进行粒度化:
module-1(TAH-elam-insel6)# set outer ?
arp ARP Fields
fcoe FCoE Fields
ipv4 IPv4 Fields
ipv6 IPv6 Fields
l2 All Layer 2 Fields
l4 L4 Fields
module-1(TAH-elam-insel6)# set outer l2 ?
cfi CFI Setting
cntag_vld CNTag Information Valid
cos Class of Service
dst_mac Destination MAC Address
qtag_vld VLAN Tag Information Valid
snap_vld SNAP Header Information Valid
src_mac Source MAC Address
vlan VLAN Id (Present only in case of FEX)
vntag_dvif VNTAG Destination vif
vntag_looped VNTAG Header Looped Valid
vntag_pointer VNTAG Header Pointer Valid
vntag_svif VNTAG Source vif
vntag_vld VNTAG Information Valid
module-1(TAH-elam-insel6)# set outer ipv4 ?
checksum Checksum
dscp Diff. Serv. Code Point
dst_ip Destination IP Address
ecn Explicit Congestion Ntfn
fragment-off Fragments Offset
header-len Header Length
more-frags More Fragments Available
next-protocol Next Protocol
packet-len Packet Total Length
pyld-len Payload Length
src_ip Source IP Address
ttl Time to Live
version Version
定义过滤器后,运行命令start以运行ELAM工具。如果未捕获填充过滤器条件的内容,则会看到:
module-1(TAH-elam-insel6)# report
ELAM not triggered yet on slot - 1, asic - 0, slice - 0
注意:“set”命令将在ELAM中生存,一个好的做法是,每次我们要捕获具有不同IP、MAC等的流量时,都运行“reset”命令。
1.从VM 172.16.35.31 ping网关172.16.35.126:
RCH-SV-FFAIII-A(nx-os)# attach module 1
module-1# debug platform internal tah elam asic 0
module-1(TAH-elam)# trigger init asic 0 slice 0 lu-a2d 1 in-select 6 out-select 1
param values: start asic 0, start slice 0, lu-a2d 1, in-select 6, out-select 1
module-1(TAH-elam-insel6)# set outer ipv4 src_ip 172.16.35.31 dst_ip 172.16.35.126
module-1(TAH-elam-insel6)# start
GBL_C++: [MSG] rocky_elam_wrapper_init:54:asic type 8 inst 0 slice 0 a_to_d 1 insel 6 outsel 1
GBL_C++: [MSG] rocky_elam_wrapper_enable:149:asic type 8 inst 0 slice 0 a_to_d 1
GBL_C++: [MSG] - writing data=0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000005608118F800000
000000000000000000560811BF00000000000000000000001000000000000000000000000000000000000000000000000000000000001
GBL_C++: [MSG] - writing mask=0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000007FFFFFFF800000
0000000000000000007FFFFFFF80000000000000000000003800000000000000000000000000000000000000000000000000000000001
module-1(TAH-elam-insel6)# report
HOMEWOOD ELAM REPORT SUMMARY
slot - 1, asic - 0, slice - 0
============================
Incoming Interface: Eth1/33
Src Idx : 0x1002, Src BD : 35
Outgoing Interface Info: dmod 1, dpid 4
Dst Idx : 0x604, Dst BD : 35
Packet Type: IPv4
Dst MAC address: 8C:60:4F:CD:FD:7C
Src MAC address: 00:25:C5:00:00:1E
.1q Tag0 VLAN: 35, cos = 0x1
Dst IPv4 address: 172.16.35.126
Src IPv4 address: 172.16.35.31
Ver = 4, DSCP = 0, Don't Fragment = 0
Proto = 1, TTL = 64, More Fragments = 0
Hdr len = 20, Pkt len = 84, Checksum = 0x5f19
L4 Protocol : 1
ICMP type : 8
ICMP code : 0
Drop Info:
----------
LUA:
LUB:
LUC:
LUD:
Final Drops:
具有src_ip 172.16.35.31和dst_ip 172.16.35.126的数据包在VLAN 35上,到达端口1/33(传入接口),并发往(传出接口)接口“dpid4”……什么?“dpid”是ASIC端口内部标识符,映射可通过“show interface hardware-mappings”找到:
Incoming Interface: Eth1/33
Src Idx : 0x1002, Src BD : 35
interface Ethernet1/33
description S: Server, Port-channel 1025
no pinning server sticky
switchport mode fex-fabric
priority-flow-control mode on
fex associate 1
channel-group 1025
no shutdown
Outgoing Interface Info: dmod 1, dpid 4
Dst Idx : 0x604, Dst BD : 35
RCH-SV-FFAIII-A(nx-os)# show interface hardware-mappings
Legends:
SMod - Source Mod. 0 is N/A
Unit - Unit on which port resides. N/A for port channels
HPort - Hardware Port Number or Hardware Trunk Id:
HName - Hardware port name. None means N/A
FPort - Fabric facing port number. 255 means N/A
NPort - Front panel port number
VPort - Virtual Port Number. -1 means N/A
Slice - Slice Number. N/A for BCM systems
SPort - Port Number wrt Slice. N/A for BCM systems
SrcId - Source Id Number. N/A for BCM systems
------------------------------------------------------------------------
Name Ifindex Smod Unit HPort FPort NPort VPort Slice SPort SrcId
------------------------------------------------------------------------
.
Eth1/13 1a001800 1 0 4 255 48 -1 0 4 8
此“dpid 4”还与“show hardware internal than interface ethernet 1/13”的建议相对应:
RCH-SV-FFAIII-A(nx-os)# show hardware internal tah interface ethernet 1/13
#########################################
IfIndex: 436213760
DstIndex: 6096
IfType: 26
Interface name Ethernet1/13
Asic: 0
Asic: 0
AsicPort: 4 <<<<<
SrcId: 8
Slice: 0
PortOnSlice: 4 <<<<<
该数据包被ELAM第4层(L4)协议识别为Internet控制消息协议(ICMP)。请参阅IANA协议号列表。您还可以使用特定MTU大小进行过滤。 ELAM仅在达到确切MTU时触发。
module-1(TAH-elam-insel6)# set outer ipv4 src_ip 172.16.35.31 dst_ip 172.16.35.126 packet-len 1500
Dst IPv4 address: 172.16.35.126
Src IPv4 address: 172.16.35.31
Ver = 4, DSCP = 0, Don't Fragment = 1
Proto = 1, TTL = 64, More Fragments = 0
Hdr len = 20, Pkt len = 1500, Checksum = 0x1758
L4 Protocol : 1
ICMP type : 8
ICMP code : 0
从虚拟机(VM)到上游网络的ARP请求,MAC地址设置为过滤器:
RCH-SV-FFAIII-B(nx-os)# attach module 1
module-1# debug platform internal tah elam asic 0
module-1(TAH-elam)# trigger init asic 0 slice 0 lu-a2d 1 in-select 6 out-select 1
param values: start asic 0, start slice 0, lu-a2d 1, in-select 6, out-select 1
module-1(TAH-elam-insel6)# set outer l2 src_mac 00:25:c5:00:00:1e dst_mac ff:ff:ff:ff:ff:ff
module-1(TAH-elam-insel6)# start
GBL_C++: [MSG] rocky_elam_wrapper_init:36:asic type 8 inst 0 slice 0 a_to_d 1 insel 6 outsel 1
GBL_C++: [MSG] rocky_elam_wrapper_enable:95:asic type 8 inst 0 slice 0 a_to_d 1
GBL_C++: [MSG] - writing data=0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000015820463E004B8A00003C0000000000000000000002000000000000000000000000000000000000000000000000000000000001
GBL_C++: [MSG] - writing mask=0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000001FFFFFFFFFFFFFFFFFFFE0000000000000000000003800000000000000000000000000000000000000000000000000000000001
module-1(TAH-elam-insel6)# report
HOMEWOOD ELAM REPORT SUMMARY
slot - 1, asic - 0, slice - 0
============================
Incoming Interface: Eth1/33
Src Idx : 0x1002, Src BD : 35
Outgoing Interface Info: dmod 1, dpid 4
Dst Idx : 0x604, Dst BD : 35
Packet Type: ARP
Dst MAC address: FF:FF:FF:FF:FF:FF
Src MAC address: 00:25:C5:00:00:1E
.1q Tag0 VLAN: 35, cos = 0x1
Target Hardware address: 00:00:00:00:00:00
Sender Hardware address: 00:25:C5:00:00:1E
Target Protocol address: 172.16.35.110
Sender Protocol address: 172.16.35.31
ARP opcode: 1
Drop Info:
----------
LUA:
LUB:
LUC:
LUD:
Final Drops:
数据包由系统识别为ARP,这在VM或网关级别存在不完整的ARP条目时特别有用。
如果适用,TCP/UDP端口也将列出,SSH将在以下位置进行测试:
RCH-SV-FFAIII-B(nx-os)# attach module 1
module-1# debug platform internal tah elam asic 0
module-1(TAH-elam)# trigger init asic 0 slice 0 lu-a2d 1 in-select 6 out-select 1
param values: start asic 0, start slice 0, lu-a2d 1, in-select 6, out-select 1
module-1(TAH-elam-insel6)# set outer ipv4 src_ip 172.16.35.126 dst_ip 172.16.35.31
module-1(TAH-elam-insel6)# start
GBL_C++: [MSG] rocky_elam_wrapper_init:36:asic type 8 inst 0 slice 0 a_to_d 1 insel 6 outsel 1
GBL_C++: [MSG] rocky_elam_wrapper_enable:95:asic type 8 inst 0 slice 0 a_to_d 1
GBL_C++: [MSG] - writing data=0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000560811BF0000
000000000000000000005608118F80000000000000000000001000000000000000000000000000000000000000000000000000000000001
GBL_C++: [MSG] - writing mask=0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000007FFFFFFF8000
000000000000000000007FFFFFFF80000000000000000000003800000000000000000000000000000000000000000000000000000000001
module-1(TAH-elam-insel6)# report
HOMEWOOD ELAM REPORT SUMMARY
slot - 1, asic - 0, slice - 0
============================
Incoming Interface: Eth1/14
Src Idx : 0x604, Src BD : 35
Outgoing Interface Info: dmod 1, dpid 44
Dst Idx : 0x1002, Dst BD : 35
Packet Type: IPv4
Dst MAC address: 00:25:C5:00:00:1E
Src MAC address: 8C:60:4F:CD:FD:7C
.1q Tag0 VLAN: 35, cos = 0x0
Dst IPv4 address: 172.16.35.31
Src IPv4 address: 172.16.35.126
Ver = 4, DSCP = 0, Don't Fragment = 0
Proto = 6, TTL = 64, More Fragments = 0
Hdr len = 20, Pkt len = 60, Checksum = 0x27f5
L4 Protocol : 6
TCP Dst Port : 22
TCP Src Port : 15067
Drop Info:
----------
LUA:
LUB:
LUC:
LUD:
Final Drops:
还记录丢包。FI丢弃ARP请求:
RCH-SV-FFAIII-B(nx-os)# attach module 1
module-1# debug platform internal tah elam asic 0
module-1(TAH-elam)# trigger init asic 0 slice 0 lu-a2d 1 in-select 6 out-select 1
param values: start asic 0, start slice 0, lu-a2d 1, in-select 6, out-select 1
module-1(TAH-elam-insel6)# set outer l2 src_mac 00:25:c5:00:00:1e dst_mac ff:ff:ff:ff:ff:ff
module-1(TAH-elam-insel6)# start
GBL_C++: [MSG] rocky_elam_wrapper_init:54:asic type 8 inst 0 slice 0 a_to_d 1 insel 6 outsel 1
GBL_C++: [MSG] rocky_elam_wrapper_enable:149:asic type 8 inst 0 slice 0 a_to_d 1
GBL_C++: [MSG] - writing data=0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000971400007BFFFFFFFFFFFC00001
GBL_C++: [MSG] - writing mask=0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000003FFFFFFFFFFFFFFFFFFFFFFFC00001
module-1(TAH-elam-insel6)# report
HOMEWOOD ELAM REPORT SUMMARY
slot - 1, asic - 0, slice - 0
============================
Incoming Interface: Eth1/18
Src Idx : 0x603, Src BD : 35
Outgoing Interface Info: dmod 0, dpid 0
Dst Idx : 0x0, Dst BD : 35
Packet Type: ARP
Dst MAC address: FF:FF:FF:FF:FF:FF
Src MAC address: 00:25:C5:00:00:1E
.1q Tag0 VLAN: 35, cos = 0x1
Target Hardware address: 00:00:00:00:00:00
Sender Hardware address: 00:25:C5:00:00:1E
Target Protocol address: 172.16.35.99
Sender Protocol address: 172.16.35.31
ARP opcode: 1
Drop Info:
----------
LUA:
LUB:
LUC:
LUD:
MC_RPF_FAIILURE
SRC_VLAN_MBR
Final Drops:
MC_RPF_FAIILURE
SRC_VLAN_MBR
FI在端口1/18(这是上行链路端口)上收到ARP请求,源MAC为00:25:c5:00:00:1e,在虚拟以太网(vEth)端口上本地获取。此条件触发反向路径转发(RPF)丢弃。请注意,传出接口信息报告dpid 0,这是丢弃。
端口1/18上不允许VLAN 35,这也触发了丢弃SRC_VLAN_MBR。
RCH-SV-FFAIII-A(nx-os)# show run interface ethernet 1/18
interface Ethernet1/18
description U: Uplink
pinning border
switchport mode trunk
switchport trunk allowed vlan 1
channel-group 105 mode active