取消
显示结果 
搜索替代 
您的意思是: 
cancel
10487
查看次数
70
有帮助
11
评论
xupeng
Cisco Employee
Cisco Employee
本帖最后由 xupeng 于 2015-4-19 21:23 编辑
NetDR
-NetDR(NetDriver) 是Catalyst6500/Cisco7600平台上用于排查CPU利用率高的有效工具.
-用于排查由于数据包被发送到CPU,从而引起CPU中断(interrupt)高.
-可以在去往Route Processor CPU(RP CPU)和SwitchProcessor CPU(SP CPU)的内部带内CPU软件转发路径(internal inband CPU software switching path)进行抓包.
-这个工具无法对硬件转发的流量进行抓包.
-使用debug netdr capture命令开启NetDr,可以在CPU高时使用,并不会对CPU/业务流量造成特别的负担.

195711zf4m6kpfav171gv7.jpg

检查RP的CPU利用率
-showprocess cpu sorted
-show process cpu history

检查SP的CPU利用率
- remote command switch show process cpu sorted
- remote command switch show processcpu history

Cat6500#show process cpu
CPU utilization for five seconds: 90%/81%; one minute: 89%; fiveminutes: 80%
//90%是总体CPU利用率.
//81%是由于中断引起的CPU利用率.
//9%=(90% - 81%) 是IOS软件进程占用的CPU利用率


使用Netdr工具

对RP进行抓包,可以直接在RPconsole输入Netdr命令:
Cat6500#debug netdr capture ?
acl (11) Capture packets matching an acl
and-filter (3)Apply filters in an and function: all must match
continuous (1)Capture packets continuously: cyclic overwrite
destination-ip-address (10) Capture all packets matching ipdst address
dstindex (7) Capture all packets matching destination index
ethertype (8) Capture all packets matching ethertype
interface (4) Capture packets related to this interface
or-filter (3) Apply filters in an or function: only one must match
rx (2) Capture incoming packets only
source-ip-address (9) Capture allpackets matching ip src address
srcindex (6) Capture all packets matching source index
tx (2) Capture outgoing packets only
vlan (5) Capture packets matching this vlan number

//参数解释:
continuous: 当抓包缓存达到4096个包,再有包进来,将会按照先进先出(FIFO)的方式覆盖已存储的数据包.
tx: 离开CPU的数据包
rx: 进入CPU的数据包
vlan: 用来抓取某个vlan的所有数据包. 包括伴随三层接口的internal vlan. 可以使用show vlan internal usage 命令查看L3接口的vlan映射关系.
interface : 抓取三层接口的数据包,包括SVI和物理接口.


对SP进行抓包, 需要使用以下命令进入SPconsole, 再输入Netdr命令, :
Cat6500#remote login switch
Trying Switch ...
Entering CONSOLE for Switch
Type "^C^C^C" to end this session
Cat6500-sp#debug netdr capture ?

注意: 执行exit命令或者^C^C^C(同时按下ctrl和C三次)退出并回到RPconsole界面.
当抓取数据包之后,可以使用shownetdr capture命令查看数据包.


排错案例:
1/
开启NetDr,抓取进入RP CPU的数据包
Cat6500#debug netdr capture rx

2/
抓取一段时间后,关闭NetDr.通常30秒 或者60秒.
Cat6500#no debug netdr capture

3/
将NetDr抓取的信息导入指定文件,并将文件导出.
Cat6500#show netdr captured-packets | appendsup-bootdisk:cpu_stats.txt
//sup-bootdisk为文件存储路径. 可以根据不同平台调整路径名称.cpu_stats.txt为文件名.

4/
将导出的文件,上传到官方提供的NetDr解析工具.
http://www.cisco.com/c/en/us/support/web/tools-catalog.html
195712ixxaaxaah5ha6ztx.jpg
195713c10925ogsuiv0bo1.jpg
195715azs5t1zr025z8902.jpg

解析结果:
195716x0nc8cctuspippgh.jpg
根据解析出来的信息就可以定位到导致CPU高的数据包的来源

或者
在设备上直接显示netdr抓包结果

Cat6500#show netdr captured-packets
A total of 111 packets have been captured
The capture buffer wrapped 0 times
Total capture capacity: 4096 packets
------- dump of incoming inband packet -------
l2idb Gi6/3, l3idb Vl576, routine inband_process_rx_packet,timestamp 21:33:37.779
dbus info: src_vlan 0x240(576), src_indx 0x142(322), len 0x82(130)
bpdu 0, index_dir 0, flood 0, dont_lrn 0, dest_indx 0x7FA3(32675)
cap1 0, cap2 0
D0020900 02400400 01420000 82000000 1E000424 26000004 000000007FA3FCBB
destmac B4.14.89.61.37.80, srcmac 08.D0.9F.E3.6D.C2, shimethertype CCF0
earl 8 shim header IS present:
version 0, control 64(0x40), lif 576(0x240), mark_enable 1,
feature_index 0, group_id 0(0x0), acos 0(0x0), ttl 14,
dti 4, dti_value 0(0x0)
ethertype 0800
protocol ip: version 0x04, hlen 0x05, tos 0x00, totlen 100,identifier 5
df 0, mf 0, fo 0, ttl 255, src 14.2.36.1, dst 14.2.36.11
icmp type 8, code 0

//抓到111个数据包.
这一个数据包来自VLAN576,从Gi6/3接口进入设备.
destmac=目的MAC
srcmac=源MAC
ethertype 0800=以太帧类型0x0800代表IPv4
src=源IP
dst=目的IP
根据这些信息就可以定位到导致CPU高的数据包的来源

推荐观看:
【CSC公开课】第七期:Cat6500 CPU 故障排查及保护机制
http://bbs.csc-china.com.cn/foru ... 2972&extra=page%3D1

评论
Lin Zhang
Level 1
Level 1
感谢楼主分享,非常有用的一篇关于troubleshooting high cpu的文章
Luke Huang
Cisco Employee
Cisco Employee
谢谢楼主分享
qwe2
Spotlight
Spotlight
谢谢楼主分享
linchen2
Community Member
赞一个
taosun2
Cisco Employee
Cisco Employee
谢谢楼主分享
Fisheryu
Cisco Employee
Cisco Employee
:):):):):)
suzhouxiaoniu
Spotlight
Spotlight
CPU排错的东西,一个都不能放过,谢谢分享
lelwu
Cisco Employee
Cisco Employee
:D:D 好东西~
yingnxu
Cisco Employee
Cisco Employee
赞赞赞
cpmld-199
Community Member
谢谢楼主分享。
shuangbao wang
Level 7
Level 7
:)赞一个:):):)
入门指南

使用上面的搜索栏输入关键字、短语或问题,搜索问题的答案。

我们希望您在这里的旅程尽可能顺利,因此这里有一些链接可以帮助您快速熟悉思科社区:









快捷链接