5 Using the trace command
6 ========================
14 #. Verify using ping from host
22 Show trace buffer [max COUNT].
24 .. code-block:: console
28 Clear trace buffer and free memory.
30 .. code-block:: console
34 filter trace output - include NODE COUNT | exclude NODE COUNT | none.
36 .. code-block:: console
38 vpp# trace filter <include NODE COUNT | exclude NODE COUNT | none>
43 .. code-block:: console
45 vpp# trace add af-packet-input 10
48 ----------------------
50 .. code-block:: console
54 PING 10.10.1.2 (10.10.1.2) 56(84) bytes of data.
55 64 bytes from 10.10.1.2: icmp_seq=1 ttl=64 time=0.283 ms
57 --- 10.10.1.2 ping statistics ---
58 1 packets transmitted, 1 received, 0% packet loss, time 0ms
59 rtt min/avg/max/mdev = 0.283/0.283/0.283/0.000 ms
61 Examine Trace of ping from host to VPP
62 ----------------------------------------
64 .. code-block:: console
66 $ sudo vppctl -s /run/vpp/cli-vpp1.sock
68 ------------------- Start of thread 0 vpp_main -------------------
71 00:17:04:099260: af-packet-input
72 af_packet: hw_if_index 1 next-index 4
74 status 0x20000001 len 98 snaplen 98 mac 66 net 80
75 sec 0x5b60e370 nsec 0x3af2736f vlan 0 vlan_tpid 0
76 00:17:04:099269: ethernet-input
77 IP4: e2:0f:1e:59:ec:f7 -> 02:fe:d9:75:d5:b4
78 00:17:04:099285: ip4-input
79 ICMP: 10.10.1.1 -> 10.10.1.2
80 tos 0x00, ttl 64, length 84, checksum 0x3f7c
81 fragment id 0xe516, flags DONT_FRAGMENT
82 ICMP echo_request checksum 0xc043
83 00:17:04:099290: ip4-lookup
84 fib 0 dpo-idx 5 flow hash: 0x00000000
85 ICMP: 10.10.1.1 -> 10.10.1.2
86 tos 0x00, ttl 64, length 84, checksum 0x3f7c
87 fragment id 0xe516, flags DONT_FRAGMENT
88 ICMP echo_request checksum 0xc043
89 00:17:04:099296: ip4-local
90 ICMP: 10.10.1.1 -> 10.10.1.2
91 tos 0x00, ttl 64, length 84, checksum 0x3f7c
92 fragment id 0xe516, flags DONT_FRAGMENT
93 ICMP echo_request checksum 0xc043
94 00:17:04:099300: ip4-icmp-input
95 ICMP: 10.10.1.1 -> 10.10.1.2
96 tos 0x00, ttl 64, length 84, checksum 0x3f7c
97 fragment id 0xe516, flags DONT_FRAGMENT
98 ICMP echo_request checksum 0xc043
99 00:17:04:099301: ip4-icmp-echo-request
100 ICMP: 10.10.1.1 -> 10.10.1.2
101 tos 0x00, ttl 64, length 84, checksum 0x3f7c
102 fragment id 0xe516, flags DONT_FRAGMENT
103 ICMP echo_request checksum 0xc043
104 00:17:04:099303: ip4-load-balance
105 fib 0 dpo-idx 13 flow hash: 0x00000000
106 ICMP: 10.10.1.2 -> 10.10.1.1
107 tos 0x00, ttl 64, length 84, checksum 0x4437
108 fragment id 0xe05b, flags DONT_FRAGMENT
109 ICMP echo_reply checksum 0xc843
110 00:17:04:099305: ip4-rewrite
111 tx_sw_if_index 1 dpo-idx 1 : ipv4 via 10.10.1.1 host-vpp1out: mtu:9000 e20f1e59ecf702fed975d5b40800 flow hash: 0x00000000
112 00000000: e20f1e59ecf702fed975d5b4080045000054e05b4000400144370a0a01020a0a
113 00000020: 01010000c8437c92000170e3605b000000001c170f00000000001011
114 00:17:04:099307: host-vpp1out-output
116 IP4: 02:fe:d9:75:d5:b4 -> e2:0f:1e:59:ec:f7
117 ICMP: 10.10.1.2 -> 10.10.1.1
118 tos 0x00, ttl 64, length 84, checksum 0x4437
119 fragment id 0xe05b, flags DONT_FRAGMENT
120 ICMP echo_reply checksum 0xc843
125 .. code-block:: console
129 Ping from VPP to Host
130 -----------------------
132 .. code-block:: console
135 64 bytes from 10.10.1.1: icmp_seq=1 ttl=64 time=.0789 ms
136 64 bytes from 10.10.1.1: icmp_seq=2 ttl=64 time=.0619 ms
137 64 bytes from 10.10.1.1: icmp_seq=3 ttl=64 time=.0519 ms
138 64 bytes from 10.10.1.1: icmp_seq=4 ttl=64 time=.0514 ms
139 64 bytes from 10.10.1.1: icmp_seq=5 ttl=64 time=.0526 ms
141 Statistics: 5 sent, 5 received, 0% packet loss
143 Examine Trace of ping from VPP to host
144 ---------------------------------------
146 The output will demonstrate FD.io VPP's trace of ping for all packets.
148 .. code-block:: console
151 ------------------- Start of thread 0 vpp_main -------------------
154 00:17:04:099260: af-packet-input
155 af_packet: hw_if_index 1 next-index 4
157 status 0x20000001 len 98 snaplen 98 mac 66 net 80
158 sec 0x5b60e370 nsec 0x3af2736f vlan 0 vlan_tpid 0
159 00:17:04:099269: ethernet-input
160 IP4: e2:0f:1e:59:ec:f7 -> 02:fe:d9:75:d5:b4
161 00:17:04:099285: ip4-input
162 ICMP: 10.10.1.1 -> 10.10.1.2
163 tos 0x00, ttl 64, length 84, checksum 0x3f7c
164 fragment id 0xe516, flags DONT_FRAGMENT
165 ICMP echo_request checksum 0xc043
166 00:17:04:099290: ip4-lookup
167 fib 0 dpo-idx 5 flow hash: 0x00000000
168 ICMP: 10.10.1.1 -> 10.10.1.2
169 tos 0x00, ttl 64, length 84, checksum 0x3f7c
170 fragment id 0xe516, flags DONT_FRAGMENT
171 ICMP echo_request checksum 0xc043
172 00:17:04:099296: ip4-local
173 ICMP: 10.10.1.1 -> 10.10.1.2
174 tos 0x00, ttl 64, length 84, checksum 0x3f7c
175 fragment id 0xe516, flags DONT_FRAGMENT
176 ICMP echo_request checksum 0xc043
177 00:17:04:099300: ip4-icmp-input
178 ICMP: 10.10.1.1 -> 10.10.1.2
179 tos 0x00, ttl 64, length 84, checksum 0x3f7c
180 fragment id 0xe516, flags DONT_FRAGMENT
181 ICMP echo_request checksum 0xc043
182 00:17:04:099301: ip4-icmp-echo-request
183 ICMP: 10.10.1.1 -> 10.10.1.2
184 tos 0x00, ttl 64, length 84, checksum 0x3f7c
185 fragment id 0xe516, flags DONT_FRAGMENT
186 ICMP echo_request checksum 0xc043
187 00:17:04:099303: ip4-load-balance
188 fib 0 dpo-idx 13 flow hash: 0x00000000
189 ICMP: 10.10.1.2 -> 10.10.1.1
190 tos 0x00, ttl 64, length 84, checksum 0x4437
191 fragment id 0xe05b, flags DONT_FRAGMENT
192 ICMP echo_reply checksum 0xc843
193 00:17:04:099305: ip4-rewrite
194 tx_sw_if_index 1 dpo-idx 1 : ipv4 via 10.10.1.1 host-vpp1out: mtu:9000 e20f1e59ecf702fed975d5b40800 flow hash: 0x00000000
195 00000000: e20f1e59ecf702fed975d5b4080045000054e05b4000400144370a0a01020a0a
196 00000020: 01010000c8437c92000170e3605b000000001c170f00000000001011
197 00:17:04:099307: host-vpp1out-output
199 IP4: 02:fe:d9:75:d5:b4 -> e2:0f:1e:59:ec:f7
200 ICMP: 10.10.1.2 -> 10.10.1.1
201 tos 0x00, ttl 64, length 84, checksum 0x4437
202 fragment id 0xe05b, flags DONT_FRAGMENT
203 ICMP echo_reply checksum 0xc843
207 00:17:09:113964: af-packet-input
208 af_packet: hw_if_index 1 next-index 4
210 status 0x20000001 len 42 snaplen 42 mac 66 net 80
211 sec 0x5b60e375 nsec 0x3b3bd57d vlan 0 vlan_tpid 0
212 00:17:09:113974: ethernet-input
213 ARP: e2:0f:1e:59:ec:f7 -> 02:fe:d9:75:d5:b4
214 00:17:09:113986: arp-input
215 request, type ethernet/IP4, address size 6/4
216 e2:0f:1e:59:ec:f7/10.10.1.1 -> 00:00:00:00:00:00/10.10.1.2
217 00:17:09:114003: host-vpp1out-output
219 ARP: 02:fe:d9:75:d5:b4 -> e2:0f:1e:59:ec:f7
220 reply, type ethernet/IP4, address size 6/4
221 02:fe:d9:75:d5:b4/10.10.1.2 -> e2:0f:1e:59:ec:f7/10.10.1.1
225 00:18:16:407079: af-packet-input
226 af_packet: hw_if_index 1 next-index 4
228 status 0x20000001 len 98 snaplen 98 mac 66 net 80
229 sec 0x5b60e3b9 nsec 0x90b7566 vlan 0 vlan_tpid 0
230 00:18:16:407085: ethernet-input
231 IP4: e2:0f:1e:59:ec:f7 -> 02:fe:d9:75:d5:b4
232 00:18:16:407090: ip4-input
233 ICMP: 10.10.1.1 -> 10.10.1.2
234 tos 0x00, ttl 64, length 84, checksum 0x3fe8
236 ICMP echo_reply checksum 0x37eb
237 00:18:16:407094: ip4-lookup
238 fib 0 dpo-idx 5 flow hash: 0x00000000
239 ICMP: 10.10.1.1 -> 10.10.1.2
240 tos 0x00, ttl 64, length 84, checksum 0x3fe8
242 ICMP echo_reply checksum 0x37eb
243 00:18:16:407097: ip4-local
244 ICMP: 10.10.1.1 -> 10.10.1.2
245 tos 0x00, ttl 64, length 84, checksum 0x3fe8
247 ICMP echo_reply checksum 0x37eb
248 00:18:16:407101: ip4-icmp-input
249 ICMP: 10.10.1.1 -> 10.10.1.2
250 tos 0x00, ttl 64, length 84, checksum 0x3fe8
252 ICMP echo_reply checksum 0x37eb
253 00:18:16:407104: ip4-icmp-echo-reply
254 ICMP echo id 7531 seq 1
255 00:18:16:407108: ip4-drop
256 ICMP: 10.10.1.1 -> 10.10.1.2
257 tos 0x00, ttl 64, length 84, checksum 0x3fe8
259 ICMP echo_reply checksum 0x37eb
260 00:18:16:407111: error-drop
261 ip4-icmp-input: unknown type
265 00:18:17:409084: af-packet-input
266 af_packet: hw_if_index 1 next-index 4
268 status 0x20000001 len 98 snaplen 98 mac 66 net 80
269 sec 0x5b60e3ba nsec 0x90b539f vlan 0 vlan_tpid 0
270 00:18:17:409088: ethernet-input
271 IP4: e2:0f:1e:59:ec:f7 -> 02:fe:d9:75:d5:b4
272 00:18:17:409092: ip4-input
273 ICMP: 10.10.1.1 -> 10.10.1.2
274 tos 0x00, ttl 64, length 84, checksum 0x3f40
276 ICMP echo_reply checksum 0xcc6d
277 00:18:17:409095: ip4-lookup
278 fib 0 dpo-idx 5 flow hash: 0x00000000
279 ICMP: 10.10.1.1 -> 10.10.1.2
280 tos 0x00, ttl 64, length 84, checksum 0x3f40
282 ICMP echo_reply checksum 0xcc6d
283 00:18:17:409097: ip4-local
284 ICMP: 10.10.1.1 -> 10.10.1.2
285 tos 0x00, ttl 64, length 84, checksum 0x3f40
287 ICMP echo_reply checksum 0xcc6d
288 00:18:17:409099: ip4-icmp-input
289 ICMP: 10.10.1.1 -> 10.10.1.2
290 tos 0x00, ttl 64, length 84, checksum 0x3f40
292 ICMP echo_reply checksum 0xcc6d
293 00:18:17:409101: ip4-icmp-echo-reply
294 ICMP echo id 7531 seq 2
295 00:18:17:409104: ip4-drop
296 ICMP: 10.10.1.1 -> 10.10.1.2
297 tos 0x00, ttl 64, length 84, checksum 0x3f40
299 ICMP echo_reply checksum 0xcc6d
300 00:18:17:409104: error-drop
301 ip4-icmp-input: unknown type
305 00:18:18:409082: af-packet-input
306 af_packet: hw_if_index 1 next-index 4
308 status 0x20000001 len 98 snaplen 98 mac 66 net 80
309 sec 0x5b60e3bb nsec 0x8ecad24 vlan 0 vlan_tpid 0
310 00:18:18:409087: ethernet-input
311 IP4: e2:0f:1e:59:ec:f7 -> 02:fe:d9:75:d5:b4
312 00:18:18:409091: ip4-input
313 ICMP: 10.10.1.1 -> 10.10.1.2
314 tos 0x00, ttl 64, length 84, checksum 0x3e66
316 ICMP echo_reply checksum 0x8e59
317 00:18:18:409093: ip4-lookup
318 fib 0 dpo-idx 5 flow hash: 0x00000000
319 ICMP: 10.10.1.1 -> 10.10.1.2
320 tos 0x00, ttl 64, length 84, checksum 0x3e66
322 ICMP echo_reply checksum 0x8e59
323 00:18:18:409096: ip4-local
324 ICMP: 10.10.1.1 -> 10.10.1.2
325 tos 0x00, ttl 64, length 84, checksum 0x3e66
327 ICMP echo_reply checksum 0x8e59
328 00:18:18:409098: ip4-icmp-input
329 ICMP: 10.10.1.1 -> 10.10.1.2
330 tos 0x00, ttl 64, length 84, checksum 0x3e66
332 ICMP echo_reply checksum 0x8e59
333 00:18:18:409099: ip4-icmp-echo-reply
334 ICMP echo id 7531 seq 3
335 00:18:18:409102: ip4-drop
336 ICMP: 10.10.1.1 -> 10.10.1.2
337 tos 0x00, ttl 64, length 84, checksum 0x3e66
339 ICMP echo_reply checksum 0x8e59
340 00:18:18:409102: error-drop
341 ip4-icmp-input: unknown type
345 00:18:19:414750: af-packet-input
346 af_packet: hw_if_index 1 next-index 4
348 status 0x20000001 len 98 snaplen 98 mac 66 net 80
349 sec 0x5b60e3bc nsec 0x92450f2 vlan 0 vlan_tpid 0
350 00:18:19:414754: ethernet-input
351 IP4: e2:0f:1e:59:ec:f7 -> 02:fe:d9:75:d5:b4
352 00:18:19:414757: ip4-input
353 ICMP: 10.10.1.1 -> 10.10.1.2
354 tos 0x00, ttl 64, length 84, checksum 0x3e52
356 ICMP echo_reply checksum 0x9888
357 00:18:19:414760: ip4-lookup
358 fib 0 dpo-idx 5 flow hash: 0x00000000
359 ICMP: 10.10.1.1 -> 10.10.1.2
360 tos 0x00, ttl 64, length 84, checksum 0x3e52
362 ICMP echo_reply checksum 0x9888
363 00:18:19:414762: ip4-local
364 ICMP: 10.10.1.1 -> 10.10.1.2
365 tos 0x00, ttl 64, length 84, checksum 0x3e52
367 ICMP echo_reply checksum 0x9888
368 00:18:19:414764: ip4-icmp-input
369 ICMP: 10.10.1.1 -> 10.10.1.2
370 tos 0x00, ttl 64, length 84, checksum 0x3e52
372 ICMP echo_reply checksum 0x9888
373 00:18:19:414765: ip4-icmp-echo-reply
374 ICMP echo id 7531 seq 4
375 00:18:19:414768: ip4-drop
376 ICMP: 10.10.1.1 -> 10.10.1.2
377 tos 0x00, ttl 64, length 84, checksum 0x3e52
379 ICMP echo_reply checksum 0x9888
380 00:18:19:414769: error-drop
381 ip4-icmp-input: unknown type
385 00:18:20:418038: af-packet-input
386 af_packet: hw_if_index 1 next-index 4
388 status 0x20000001 len 98 snaplen 98 mac 66 net 80
389 sec 0x5b60e3bd nsec 0x937bcc2 vlan 0 vlan_tpid 0
390 00:18:20:418042: ethernet-input
391 IP4: e2:0f:1e:59:ec:f7 -> 02:fe:d9:75:d5:b4
392 00:18:20:418045: ip4-input
393 ICMP: 10.10.1.1 -> 10.10.1.2
394 tos 0x00, ttl 64, length 84, checksum 0x3e47
396 ICMP echo_reply checksum 0xc0e8
397 00:18:20:418048: ip4-lookup
398 fib 0 dpo-idx 5 flow hash: 0x00000000
399 ICMP: 10.10.1.1 -> 10.10.1.2
400 tos 0x00, ttl 64, length 84, checksum 0x3e47
402 ICMP echo_reply checksum 0xc0e8
403 00:18:20:418049: ip4-local
404 ICMP: 10.10.1.1 -> 10.10.1.2
405 tos 0x00, ttl 64, length 84, checksum 0x3e47
407 ICMP echo_reply checksum 0xc0e8
408 00:18:20:418054: ip4-icmp-input
409 ICMP: 10.10.1.1 -> 10.10.1.2
410 tos 0x00, ttl 64, length 84, checksum 0x3e47
412 ICMP echo_reply checksum 0xc0e8
413 00:18:20:418054: ip4-icmp-echo-reply
414 ICMP echo id 7531 seq 5
415 00:18:20:418057: ip4-drop
416 ICMP: 10.10.1.1 -> 10.10.1.2
417 tos 0x00, ttl 64, length 84, checksum 0x3e47
419 ICMP echo_reply checksum 0xc0e8
420 00:18:20:418058: error-drop
421 ip4-icmp-input: unknown type
425 00:18:21:419208: af-packet-input
426 af_packet: hw_if_index 1 next-index 4
428 status 0x20000001 len 42 snaplen 42 mac 66 net 80
429 sec 0x5b60e3be nsec 0x92a9429 vlan 0 vlan_tpid 0
430 00:18:21:419876: ethernet-input
431 ARP: e2:0f:1e:59:ec:f7 -> 02:fe:d9:75:d5:b4
432 00:18:21:419881: arp-input
433 request, type ethernet/IP4, address size 6/4
434 e2:0f:1e:59:ec:f7/10.10.1.1 -> 00:00:00:00:00:00/10.10.1.2
435 00:18:21:419896: host-vpp1out-output
437 ARP: 02:fe:d9:75:d5:b4 -> e2:0f:1e:59:ec:f7
438 reply, type ethernet/IP4, address size 6/4
439 02:fe:d9:75:d5:b4/10.10.1.2 -> e2:0f:1e:59:ec:f7/10.10.1.1
441 After examining the trace, clear it again using vpp# clear trace.
446 .. code-block:: console
449 Time IP4 Flags Ethernet Interface
450 1101.5636 10.10.1.1 D e2:0f:1e:59:ec:f7 host-vpp1out
452 Examine routing tables
453 -----------------------
455 .. code-block:: console
458 ipv4-VRF:0, fib_index:0, flow hash:[src dst sport dport proto ] locks:[src:plugin-hi:2, src:adjacency:1, src:default-route:1, ]
461 [@0]: dpo-load-balance: [proto:ip4 index:1 buckets:1 uRPF:0 to:[0:0]]
462 [0] [@0]: dpo-drop ip4
465 [@0]: dpo-load-balance: [proto:ip4 index:2 buckets:1 uRPF:1 to:[0:0]]
466 [0] [@0]: dpo-drop ip4
469 [@0]: dpo-load-balance: [proto:ip4 index:10 buckets:1 uRPF:9 to:[0:0]]
470 [0] [@0]: dpo-drop ip4
473 [@0]: dpo-load-balance: [proto:ip4 index:13 buckets:1 uRPF:12 to:[5:420] via:[2:168]]
474 [0] [@5]: ipv4 via 10.10.1.1 host-vpp1out: mtu:9000 e20f1e59ecf702fed975d5b40800
477 [@0]: dpo-load-balance: [proto:ip4 index:9 buckets:1 uRPF:8 to:[0:0]]
478 [0] [@4]: ipv4-glean: host-vpp1out: mtu:9000 ffffffffffff02fed975d5b40806
481 [@0]: dpo-load-balance: [proto:ip4 index:12 buckets:1 uRPF:13 to:[7:588]]
482 [0] [@2]: dpo-receive: 10.10.1.2 on host-vpp1out
485 [@0]: dpo-load-balance: [proto:ip4 index:11 buckets:1 uRPF:11 to:[0:0]]
486 [0] [@0]: dpo-drop ip4
489 [@0]: dpo-load-balance: [proto:ip4 index:4 buckets:1 uRPF:3 to:[0:0]]
490 [0] [@0]: dpo-drop ip4
493 [@0]: dpo-load-balance: [proto:ip4 index:3 buckets:1 uRPF:2 to:[0:0]]
494 [0] [@0]: dpo-drop ip4
497 [@0]: dpo-load-balance: [proto:ip4 index:5 buckets:1 uRPF:4 to:[0:0]]
498 [0] [@0]: dpo-drop ip4