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
47 The following list of nodes are supported under trace add:
70 ----------------------
72 .. code-block:: console
76 PING 10.10.1.2 (10.10.1.2) 56(84) bytes of data.
77 64 bytes from 10.10.1.2: icmp_seq=1 ttl=64 time=0.283 ms
79 --- 10.10.1.2 ping statistics ---
80 1 packets transmitted, 1 received, 0% packet loss, time 0ms
81 rtt min/avg/max/mdev = 0.283/0.283/0.283/0.000 ms
83 Examine Trace of ping from host to VPP
84 ----------------------------------------
86 .. code-block:: console
88 $ sudo vppctl -s /run/vpp/cli-vpp1.sock
90 ------------------- Start of thread 0 vpp_main -------------------
93 00:17:04:099260: af-packet-input
94 af_packet: hw_if_index 1 next-index 4
96 status 0x20000001 len 98 snaplen 98 mac 66 net 80
97 sec 0x5b60e370 nsec 0x3af2736f vlan 0 vlan_tpid 0
98 00:17:04:099269: ethernet-input
99 IP4: e2:0f:1e:59:ec:f7 -> 02:fe:d9:75:d5:b4
100 00:17:04:099285: ip4-input
101 ICMP: 10.10.1.1 -> 10.10.1.2
102 tos 0x00, ttl 64, length 84, checksum 0x3f7c
103 fragment id 0xe516, flags DONT_FRAGMENT
104 ICMP echo_request checksum 0xc043
105 00:17:04:099290: ip4-lookup
106 fib 0 dpo-idx 5 flow hash: 0x00000000
107 ICMP: 10.10.1.1 -> 10.10.1.2
108 tos 0x00, ttl 64, length 84, checksum 0x3f7c
109 fragment id 0xe516, flags DONT_FRAGMENT
110 ICMP echo_request checksum 0xc043
111 00:17:04:099296: ip4-local
112 ICMP: 10.10.1.1 -> 10.10.1.2
113 tos 0x00, ttl 64, length 84, checksum 0x3f7c
114 fragment id 0xe516, flags DONT_FRAGMENT
115 ICMP echo_request checksum 0xc043
116 00:17:04:099300: ip4-icmp-input
117 ICMP: 10.10.1.1 -> 10.10.1.2
118 tos 0x00, ttl 64, length 84, checksum 0x3f7c
119 fragment id 0xe516, flags DONT_FRAGMENT
120 ICMP echo_request checksum 0xc043
121 00:17:04:099301: ip4-icmp-echo-request
122 ICMP: 10.10.1.1 -> 10.10.1.2
123 tos 0x00, ttl 64, length 84, checksum 0x3f7c
124 fragment id 0xe516, flags DONT_FRAGMENT
125 ICMP echo_request checksum 0xc043
126 00:17:04:099303: ip4-load-balance
127 fib 0 dpo-idx 13 flow hash: 0x00000000
128 ICMP: 10.10.1.2 -> 10.10.1.1
129 tos 0x00, ttl 64, length 84, checksum 0x4437
130 fragment id 0xe05b, flags DONT_FRAGMENT
131 ICMP echo_reply checksum 0xc843
132 00:17:04:099305: ip4-rewrite
133 tx_sw_if_index 1 dpo-idx 1 : ipv4 via 10.10.1.1 host-vpp1out: mtu:9000 e20f1e59ecf702fed975d5b40800 flow hash: 0x00000000
134 00000000: e20f1e59ecf702fed975d5b4080045000054e05b4000400144370a0a01020a0a
135 00000020: 01010000c8437c92000170e3605b000000001c170f00000000001011
136 00:17:04:099307: host-vpp1out-output
138 IP4: 02:fe:d9:75:d5:b4 -> e2:0f:1e:59:ec:f7
139 ICMP: 10.10.1.2 -> 10.10.1.1
140 tos 0x00, ttl 64, length 84, checksum 0x4437
141 fragment id 0xe05b, flags DONT_FRAGMENT
142 ICMP echo_reply checksum 0xc843
147 .. code-block:: console
151 Ping from VPP to Host
152 -----------------------
154 .. code-block:: console
157 64 bytes from 10.10.1.1: icmp_seq=1 ttl=64 time=.0789 ms
158 64 bytes from 10.10.1.1: icmp_seq=2 ttl=64 time=.0619 ms
159 64 bytes from 10.10.1.1: icmp_seq=3 ttl=64 time=.0519 ms
160 64 bytes from 10.10.1.1: icmp_seq=4 ttl=64 time=.0514 ms
161 64 bytes from 10.10.1.1: icmp_seq=5 ttl=64 time=.0526 ms
163 Statistics: 5 sent, 5 received, 0% packet loss
165 Examine Trace of ping from VPP to host
166 ---------------------------------------
168 The output will demonstrate FD.io VPP's trace of ping for all packets.
170 .. code-block:: console
173 ------------------- Start of thread 0 vpp_main -------------------
176 00:17:04:099260: af-packet-input
177 af_packet: hw_if_index 1 next-index 4
179 status 0x20000001 len 98 snaplen 98 mac 66 net 80
180 sec 0x5b60e370 nsec 0x3af2736f vlan 0 vlan_tpid 0
181 00:17:04:099269: ethernet-input
182 IP4: e2:0f:1e:59:ec:f7 -> 02:fe:d9:75:d5:b4
183 00:17:04:099285: ip4-input
184 ICMP: 10.10.1.1 -> 10.10.1.2
185 tos 0x00, ttl 64, length 84, checksum 0x3f7c
186 fragment id 0xe516, flags DONT_FRAGMENT
187 ICMP echo_request checksum 0xc043
188 00:17:04:099290: ip4-lookup
189 fib 0 dpo-idx 5 flow hash: 0x00000000
190 ICMP: 10.10.1.1 -> 10.10.1.2
191 tos 0x00, ttl 64, length 84, checksum 0x3f7c
192 fragment id 0xe516, flags DONT_FRAGMENT
193 ICMP echo_request checksum 0xc043
194 00:17:04:099296: ip4-local
195 ICMP: 10.10.1.1 -> 10.10.1.2
196 tos 0x00, ttl 64, length 84, checksum 0x3f7c
197 fragment id 0xe516, flags DONT_FRAGMENT
198 ICMP echo_request checksum 0xc043
199 00:17:04:099300: ip4-icmp-input
200 ICMP: 10.10.1.1 -> 10.10.1.2
201 tos 0x00, ttl 64, length 84, checksum 0x3f7c
202 fragment id 0xe516, flags DONT_FRAGMENT
203 ICMP echo_request checksum 0xc043
204 00:17:04:099301: ip4-icmp-echo-request
205 ICMP: 10.10.1.1 -> 10.10.1.2
206 tos 0x00, ttl 64, length 84, checksum 0x3f7c
207 fragment id 0xe516, flags DONT_FRAGMENT
208 ICMP echo_request checksum 0xc043
209 00:17:04:099303: ip4-load-balance
210 fib 0 dpo-idx 13 flow hash: 0x00000000
211 ICMP: 10.10.1.2 -> 10.10.1.1
212 tos 0x00, ttl 64, length 84, checksum 0x4437
213 fragment id 0xe05b, flags DONT_FRAGMENT
214 ICMP echo_reply checksum 0xc843
215 00:17:04:099305: ip4-rewrite
216 tx_sw_if_index 1 dpo-idx 1 : ipv4 via 10.10.1.1 host-vpp1out: mtu:9000 e20f1e59ecf702fed975d5b40800 flow hash: 0x00000000
217 00000000: e20f1e59ecf702fed975d5b4080045000054e05b4000400144370a0a01020a0a
218 00000020: 01010000c8437c92000170e3605b000000001c170f00000000001011
219 00:17:04:099307: host-vpp1out-output
221 IP4: 02:fe:d9:75:d5:b4 -> e2:0f:1e:59:ec:f7
222 ICMP: 10.10.1.2 -> 10.10.1.1
223 tos 0x00, ttl 64, length 84, checksum 0x4437
224 fragment id 0xe05b, flags DONT_FRAGMENT
225 ICMP echo_reply checksum 0xc843
229 00:17:09:113964: af-packet-input
230 af_packet: hw_if_index 1 next-index 4
232 status 0x20000001 len 42 snaplen 42 mac 66 net 80
233 sec 0x5b60e375 nsec 0x3b3bd57d vlan 0 vlan_tpid 0
234 00:17:09:113974: ethernet-input
235 ARP: e2:0f:1e:59:ec:f7 -> 02:fe:d9:75:d5:b4
236 00:17:09:113986: arp-input
237 request, type ethernet/IP4, address size 6/4
238 e2:0f:1e:59:ec:f7/10.10.1.1 -> 00:00:00:00:00:00/10.10.1.2
239 00:17:09:114003: host-vpp1out-output
241 ARP: 02:fe:d9:75:d5:b4 -> e2:0f:1e:59:ec:f7
242 reply, type ethernet/IP4, address size 6/4
243 02:fe:d9:75:d5:b4/10.10.1.2 -> e2:0f:1e:59:ec:f7/10.10.1.1
247 00:18:16:407079: af-packet-input
248 af_packet: hw_if_index 1 next-index 4
250 status 0x20000001 len 98 snaplen 98 mac 66 net 80
251 sec 0x5b60e3b9 nsec 0x90b7566 vlan 0 vlan_tpid 0
252 00:18:16:407085: ethernet-input
253 IP4: e2:0f:1e:59:ec:f7 -> 02:fe:d9:75:d5:b4
254 00:18:16:407090: ip4-input
255 ICMP: 10.10.1.1 -> 10.10.1.2
256 tos 0x00, ttl 64, length 84, checksum 0x3fe8
258 ICMP echo_reply checksum 0x37eb
259 00:18:16:407094: ip4-lookup
260 fib 0 dpo-idx 5 flow hash: 0x00000000
261 ICMP: 10.10.1.1 -> 10.10.1.2
262 tos 0x00, ttl 64, length 84, checksum 0x3fe8
264 ICMP echo_reply checksum 0x37eb
265 00:18:16:407097: ip4-local
266 ICMP: 10.10.1.1 -> 10.10.1.2
267 tos 0x00, ttl 64, length 84, checksum 0x3fe8
269 ICMP echo_reply checksum 0x37eb
270 00:18:16:407101: ip4-icmp-input
271 ICMP: 10.10.1.1 -> 10.10.1.2
272 tos 0x00, ttl 64, length 84, checksum 0x3fe8
274 ICMP echo_reply checksum 0x37eb
275 00:18:16:407104: ip4-icmp-echo-reply
276 ICMP echo id 7531 seq 1
277 00:18:16:407108: ip4-drop
278 ICMP: 10.10.1.1 -> 10.10.1.2
279 tos 0x00, ttl 64, length 84, checksum 0x3fe8
281 ICMP echo_reply checksum 0x37eb
282 00:18:16:407111: error-drop
283 ip4-icmp-input: unknown type
287 00:18:17:409084: af-packet-input
288 af_packet: hw_if_index 1 next-index 4
290 status 0x20000001 len 98 snaplen 98 mac 66 net 80
291 sec 0x5b60e3ba nsec 0x90b539f vlan 0 vlan_tpid 0
292 00:18:17:409088: ethernet-input
293 IP4: e2:0f:1e:59:ec:f7 -> 02:fe:d9:75:d5:b4
294 00:18:17:409092: ip4-input
295 ICMP: 10.10.1.1 -> 10.10.1.2
296 tos 0x00, ttl 64, length 84, checksum 0x3f40
298 ICMP echo_reply checksum 0xcc6d
299 00:18:17:409095: ip4-lookup
300 fib 0 dpo-idx 5 flow hash: 0x00000000
301 ICMP: 10.10.1.1 -> 10.10.1.2
302 tos 0x00, ttl 64, length 84, checksum 0x3f40
304 ICMP echo_reply checksum 0xcc6d
305 00:18:17:409097: ip4-local
306 ICMP: 10.10.1.1 -> 10.10.1.2
307 tos 0x00, ttl 64, length 84, checksum 0x3f40
309 ICMP echo_reply checksum 0xcc6d
310 00:18:17:409099: ip4-icmp-input
311 ICMP: 10.10.1.1 -> 10.10.1.2
312 tos 0x00, ttl 64, length 84, checksum 0x3f40
314 ICMP echo_reply checksum 0xcc6d
315 00:18:17:409101: ip4-icmp-echo-reply
316 ICMP echo id 7531 seq 2
317 00:18:17:409104: ip4-drop
318 ICMP: 10.10.1.1 -> 10.10.1.2
319 tos 0x00, ttl 64, length 84, checksum 0x3f40
321 ICMP echo_reply checksum 0xcc6d
322 00:18:17:409104: error-drop
323 ip4-icmp-input: unknown type
327 00:18:18:409082: af-packet-input
328 af_packet: hw_if_index 1 next-index 4
330 status 0x20000001 len 98 snaplen 98 mac 66 net 80
331 sec 0x5b60e3bb nsec 0x8ecad24 vlan 0 vlan_tpid 0
332 00:18:18:409087: ethernet-input
333 IP4: e2:0f:1e:59:ec:f7 -> 02:fe:d9:75:d5:b4
334 00:18:18:409091: ip4-input
335 ICMP: 10.10.1.1 -> 10.10.1.2
336 tos 0x00, ttl 64, length 84, checksum 0x3e66
338 ICMP echo_reply checksum 0x8e59
339 00:18:18:409093: ip4-lookup
340 fib 0 dpo-idx 5 flow hash: 0x00000000
341 ICMP: 10.10.1.1 -> 10.10.1.2
342 tos 0x00, ttl 64, length 84, checksum 0x3e66
344 ICMP echo_reply checksum 0x8e59
345 00:18:18:409096: ip4-local
346 ICMP: 10.10.1.1 -> 10.10.1.2
347 tos 0x00, ttl 64, length 84, checksum 0x3e66
349 ICMP echo_reply checksum 0x8e59
350 00:18:18:409098: ip4-icmp-input
351 ICMP: 10.10.1.1 -> 10.10.1.2
352 tos 0x00, ttl 64, length 84, checksum 0x3e66
354 ICMP echo_reply checksum 0x8e59
355 00:18:18:409099: ip4-icmp-echo-reply
356 ICMP echo id 7531 seq 3
357 00:18:18:409102: ip4-drop
358 ICMP: 10.10.1.1 -> 10.10.1.2
359 tos 0x00, ttl 64, length 84, checksum 0x3e66
361 ICMP echo_reply checksum 0x8e59
362 00:18:18:409102: error-drop
363 ip4-icmp-input: unknown type
367 00:18:19:414750: af-packet-input
368 af_packet: hw_if_index 1 next-index 4
370 status 0x20000001 len 98 snaplen 98 mac 66 net 80
371 sec 0x5b60e3bc nsec 0x92450f2 vlan 0 vlan_tpid 0
372 00:18:19:414754: ethernet-input
373 IP4: e2:0f:1e:59:ec:f7 -> 02:fe:d9:75:d5:b4
374 00:18:19:414757: ip4-input
375 ICMP: 10.10.1.1 -> 10.10.1.2
376 tos 0x00, ttl 64, length 84, checksum 0x3e52
378 ICMP echo_reply checksum 0x9888
379 00:18:19:414760: ip4-lookup
380 fib 0 dpo-idx 5 flow hash: 0x00000000
381 ICMP: 10.10.1.1 -> 10.10.1.2
382 tos 0x00, ttl 64, length 84, checksum 0x3e52
384 ICMP echo_reply checksum 0x9888
385 00:18:19:414762: ip4-local
386 ICMP: 10.10.1.1 -> 10.10.1.2
387 tos 0x00, ttl 64, length 84, checksum 0x3e52
389 ICMP echo_reply checksum 0x9888
390 00:18:19:414764: ip4-icmp-input
391 ICMP: 10.10.1.1 -> 10.10.1.2
392 tos 0x00, ttl 64, length 84, checksum 0x3e52
394 ICMP echo_reply checksum 0x9888
395 00:18:19:414765: ip4-icmp-echo-reply
396 ICMP echo id 7531 seq 4
397 00:18:19:414768: ip4-drop
398 ICMP: 10.10.1.1 -> 10.10.1.2
399 tos 0x00, ttl 64, length 84, checksum 0x3e52
401 ICMP echo_reply checksum 0x9888
402 00:18:19:414769: error-drop
403 ip4-icmp-input: unknown type
407 00:18:20:418038: af-packet-input
408 af_packet: hw_if_index 1 next-index 4
410 status 0x20000001 len 98 snaplen 98 mac 66 net 80
411 sec 0x5b60e3bd nsec 0x937bcc2 vlan 0 vlan_tpid 0
412 00:18:20:418042: ethernet-input
413 IP4: e2:0f:1e:59:ec:f7 -> 02:fe:d9:75:d5:b4
414 00:18:20:418045: ip4-input
415 ICMP: 10.10.1.1 -> 10.10.1.2
416 tos 0x00, ttl 64, length 84, checksum 0x3e47
418 ICMP echo_reply checksum 0xc0e8
419 00:18:20:418048: ip4-lookup
420 fib 0 dpo-idx 5 flow hash: 0x00000000
421 ICMP: 10.10.1.1 -> 10.10.1.2
422 tos 0x00, ttl 64, length 84, checksum 0x3e47
424 ICMP echo_reply checksum 0xc0e8
425 00:18:20:418049: ip4-local
426 ICMP: 10.10.1.1 -> 10.10.1.2
427 tos 0x00, ttl 64, length 84, checksum 0x3e47
429 ICMP echo_reply checksum 0xc0e8
430 00:18:20:418054: ip4-icmp-input
431 ICMP: 10.10.1.1 -> 10.10.1.2
432 tos 0x00, ttl 64, length 84, checksum 0x3e47
434 ICMP echo_reply checksum 0xc0e8
435 00:18:20:418054: ip4-icmp-echo-reply
436 ICMP echo id 7531 seq 5
437 00:18:20:418057: ip4-drop
438 ICMP: 10.10.1.1 -> 10.10.1.2
439 tos 0x00, ttl 64, length 84, checksum 0x3e47
441 ICMP echo_reply checksum 0xc0e8
442 00:18:20:418058: error-drop
443 ip4-icmp-input: unknown type
447 00:18:21:419208: af-packet-input
448 af_packet: hw_if_index 1 next-index 4
450 status 0x20000001 len 42 snaplen 42 mac 66 net 80
451 sec 0x5b60e3be nsec 0x92a9429 vlan 0 vlan_tpid 0
452 00:18:21:419876: ethernet-input
453 ARP: e2:0f:1e:59:ec:f7 -> 02:fe:d9:75:d5:b4
454 00:18:21:419881: arp-input
455 request, type ethernet/IP4, address size 6/4
456 e2:0f:1e:59:ec:f7/10.10.1.1 -> 00:00:00:00:00:00/10.10.1.2
457 00:18:21:419896: host-vpp1out-output
459 ARP: 02:fe:d9:75:d5:b4 -> e2:0f:1e:59:ec:f7
460 reply, type ethernet/IP4, address size 6/4
461 02:fe:d9:75:d5:b4/10.10.1.2 -> e2:0f:1e:59:ec:f7/10.10.1.1
463 After examining the trace, clear it again using vpp# clear trace.
468 .. code-block:: console
471 Time IP4 Flags Ethernet Interface
472 1101.5636 10.10.1.1 D e2:0f:1e:59:ec:f7 host-vpp1out
474 Examine routing tables
475 -----------------------
477 .. code-block:: console
480 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, ]
483 [@0]: dpo-load-balance: [proto:ip4 index:1 buckets:1 uRPF:0 to:[0:0]]
484 [0] [@0]: dpo-drop ip4
487 [@0]: dpo-load-balance: [proto:ip4 index:2 buckets:1 uRPF:1 to:[0:0]]
488 [0] [@0]: dpo-drop ip4
491 [@0]: dpo-load-balance: [proto:ip4 index:10 buckets:1 uRPF:9 to:[0:0]]
492 [0] [@0]: dpo-drop ip4
495 [@0]: dpo-load-balance: [proto:ip4 index:13 buckets:1 uRPF:12 to:[5:420] via:[2:168]]
496 [0] [@5]: ipv4 via 10.10.1.1 host-vpp1out: mtu:9000 e20f1e59ecf702fed975d5b40800
499 [@0]: dpo-load-balance: [proto:ip4 index:9 buckets:1 uRPF:8 to:[0:0]]
500 [0] [@4]: ipv4-glean: host-vpp1out: mtu:9000 ffffffffffff02fed975d5b40806
503 [@0]: dpo-load-balance: [proto:ip4 index:12 buckets:1 uRPF:13 to:[7:588]]
504 [0] [@2]: dpo-receive: 10.10.1.2 on host-vpp1out
507 [@0]: dpo-load-balance: [proto:ip4 index:11 buckets:1 uRPF:11 to:[0:0]]
508 [0] [@0]: dpo-drop ip4
511 [@0]: dpo-load-balance: [proto:ip4 index:4 buckets:1 uRPF:3 to:[0:0]]
512 [0] [@0]: dpo-drop ip4
515 [@0]: dpo-load-balance: [proto:ip4 index:3 buckets:1 uRPF:2 to:[0:0]]
516 [0] [@0]: dpo-drop ip4
519 [@0]: dpo-load-balance: [proto:ip4 index:5 buckets:1 uRPF:4 to:[0:0]]
520 [0] [@0]: dpo-drop ip4