Saturday, July 10, 2021

XR Embedded Packet Tracer

 喜大普奔,XR终于出了内置的Packet Tracer工具了。该工具作用是用于跟踪数据包进入路由器后经过的组件,监视数据包信息,查找数据包丢失或最后一次见到的位置 .

如我们常用的ACL匹配数据包一样,需要设定特定的匹配条件,然后执行该内置的工具进行数据包的匹配。

Packet Tracer Conditions – Offset/Value/Mask

如何生成这个匹配条件,我们提供了一个web工具,如下,包含丰富的数据包类型:



该Web 工具发布在Github,可以参考以下link完成安装使用:

https://github.com/xr-packet-tracer/xr-embedded-packet-tracer-condition-generator

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[root@xuxing ~]# nvm install node
[root@xuxing ~]# cd xr-embedded-packet-tracer-condition-generator/
[root@xuxing xr-embedded-packet-tracer-condition-generator]# npm install
[root@xuxing xr-embedded-packet-tracer-condition-generator]# npm start
 
Compiled successfully!
 
You can now view packet-tracer-condition in the browser.
 
  Local:            http://localhost:3000/
  On Your Network:  http://10.75.49.238:3000/
 
Note that the development build is not optimized.
To create a production build, use npm run build.
Packet Trace Use Case

这里使用一个很简单的环境测试下这个feature,用来抓取ICMP数据包进入路由器后的路径。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
RP/0/RSP0/CPU0:9901-2#packet-trace condition interface tenGigE 0/0/0/30
RP/0/RSP0/CPU0:9901-2#packet-trace condition 1 Offset 23 Value 0x01 Mask 0xff
RP/0/RSP0/CPU0:9901-2#packet-trace condition 2 Offset 26 Value 0x7b7b7a02 Mask 0xffffffff
RP/0/RSP0/CPU0:9901-2#packet-trace condition 3 Offset 30 Value 0x7b7b7a01 Mask 0xffffffff
RP/0/RSP0/CPU0:9901-2#packet-trace start
RP/0/RSP0/CPU0:9901-2#ping 123.123.122.2 count  1000                                       
Wed Aug 26 04:11:01.157 HKT
Type escape sequence to abort.
Sending 1000, 100-byte ICMP Echos to 123.123.122.2, timeout is 2 seconds:
!!!!!!!!!!!!!!!!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/max = 1/1/12 ms
RP/0/RSP0/CPU0:9901-2#show packet-trace results  
Wed Aug 26 04:11:14.893 HKT
T: D - Drop counter; P - Pass counter
Location     | Source       | Counter                   | T | Last-Attribute                           | Count         
------------   ------------   -------------------------   -   ----------------------------------------   ---------------
0/0/CPU0       NP1            PACKET_MARKED               P   TenGigE0_0_0_30                            1000          
0/0/CPU0       NP1            PACKET_TO_PUNT              P                                              1000          
0/RSP0/CPU0    SPP_PD         PKT_SPP_PD_PUNT_DROP        D                                              1             
Other userful command
1
2
3
4
5
6
7
8
9
10
11
// 清除之前的一些设置
#packet-trace atop
#clear packet-trace conditions all
#clear packet-trace counters all
 
//show command
#show packet-trace status
#show packet-trace status detail
#show packet-trace descriptions 
#show packet-trace results counter PACKET_MARKED location 0/0/CPU0
#show packet-trace results counter PACKET_MARKED source NP1 location 0/0/CPU0
限制

7.1.2 开始,5th, 4th and 3rd generation line cards (aka Lightspeed Plus, Lighstpeed, Tomahawk).

Reference

XR Embedded Packet Tracer

No comments:

Post a Comment