xdpdump(8) a simple tcpdump like tool for capturing packets at the XDP layer (NAME) xdpdump - tcpdump XDP (SYNOPSIS) xdpdump XDP tcpdump . XDP . entry XDP exit XDP . exit (action) XDP . XDP (dropped) . xdpdump bpf (entry) / (exit) XDP perf . XDP libpcap . xdpdump xdpdump : Usage: xdpdump [options] XDPDump tool to dump network traffic Options: --rx-capture Capture point for the rx direction (valid values: entry,exit) -D, --list-interfaces Print the list of available interfaces -i, --interface Name of interface to capture on --perf-wakeup Wake up xdpdump every packets -p, --program-names Specific program to attach to -s, --snapshot-length Minimum bytes of packet to capture --use-pcap Use legacy pcap format for XDP traces -w, --write Write raw packets to pcap file -x, --hex Print the full packet in hex -v, --verbose Enable verbose logging (-vv: more verbose) --version Display version information -h, --help Show this help (The options explained) xdpdump tcpdump : --rx-capture (ingress) : XDP / XDP. entry exit entry,exit. exit XDP . entry,exit . . entry . -D, --list-interfaces XDP . --load-xdp-mode --load-xdp-program . : <> XDP <> skb ( XDP generic) <> <> ( native generic ). <> . <> . --load-xdp-program XDP xdpdump libpcap . xdpdump XDP . -i, --interface ifname. XDP libpcap . --perf-wakeup perf xdpdump . XDP . 0 / . -v . -p, --program-names [|all] XDP . (IDs) . . -D . eBPF API . xdpdump BTF . . . . @ . -P, --promiscuous-mode (promiscuous mode) . -s, --snapshot-length snaplen 262144 . --use-pcap pcap XDP. PcapNG . -w, --write pcap (). file - . -x, --hex . -v, --verbose . (-vv). --version xdpdump . -h, --help . (EXAMPLES) xdp-filter eth0 : # xdp-filter load --mode skb eth0 # # xdpdump -D Interface Prio Program name Mode ID Tag Chain actions -------------------------------------------------------------------------------------- lo eth0 xdp_dispatcher skb 10651 d51e469e988d81da => 10 xdpfilt_alw_all 10669 0b394f43ab24501c XDP_PASS xdpdump : # xdpdump -i eth0 -x listening on eth0, ingress XDP program ID 10651 func xdp_dispatcher, capture mode entry, capture size 262144 bytes 1584373839.460733895: xdp_dispatcher()@entry: packet size 102 bytes, captured 102 bytes on if_index 2, rx queue 0, id 1 0x0000: 52 54 00 db 44 b6 52 54 00 34 38 da 08 00 45 48 RT..D.RT.48...EH 0x0010: 00 58 d7 dd 40 00 40 06 ec c3 c0 a8 7a 01 c0 a8 .X..@.@.....z... 0x0020: 7a 64 9c de 00 16 0d d5 c6 bc 46 c9 bb 11 80 18 zd........F..... 0x0030: 01 f5 7b b4 00 00 01 01 08 0a 77 0a 8c b8 40 12 ..{.......w...@. 0x0040: cc a6 00 00 00 10 54 ce 6e 20 c3 e7 da 6c 08 42 ......T.n ...l.B 0x0050: d6 d9 ee 42 42 f0 82 c9 4f 12 ed 7b 19 ab 22 0d ...BB...O..{..". 0x0060: 09 29 a9 ee df 89 .).... 1584373839.462340808: xdp_dispatcher()@entry: packet size 66 bytes, captured 66 bytes on if_index 2, rx queue 0, id 2 0x0000: 52 54 00 db 44 b6 52 54 00 34 38 da 08 00 45 48 RT..D.RT.48...EH 0x0010: 00 34 d7 de 40 00 40 06 ec e6 c0 a8 7a 01 c0 a8 .4..@.@.....z... 0x0020: 7a 64 9c de 00 16 0d d5 c6 e0 46 c9 bc 85 80 10 zd........F..... 0x0030: 01 f5 74 0c 00 00 01 01 08 0a 77 0a 8c ba 40 12 ..t.......w...@. 0x0040: d2 34 .4 ^C 2 packets captured 0 packets dropped by perf ring tcpdump tshark : # xdpdump -i eth0 -w - | tcpdump -r - -n listening on eth0, ingress XDP program ID 10651 func xdp_dispatcher, capture mode entry, capture size 262144 bytes reading from file -, link-type EN10MB (Ethernet) 15:55:09.075887 IP 192.168.122.1.40928 > 192.168.122.100.ssh: Flags [P.], seq 3857553815:3857553851, ack 3306438882, win 501, options [nop,nop,TS val 1997449167 ecr 1075234328], length 36 15:55:09.077756 IP 192.168.122.1.40928 > 192.168.122.100.ssh: Flags [.], ack 37, win 501, options [nop,nop,TS val 1997449169 ecr 1075244363], length 0 15:55:09.750230 IP 192.168.122.1.40928 > 192.168.122.100.ssh: Flags [P.], seq 36:72, ack 37, win 501, options [nop,nop,TS val 1997449842 ecr 1075244363], length 36 # xdpdump -i eth0 -w - | tshark -r - -n listening on eth0, ingress XDP program ID 10651 func xdp_dispatcher, capture mode entry, capture size 262144 bytes 1 0.000000 192.168.122.1 -> 192.168.122.100 SSH 102 Client: Encrypted packet (len=36) 2 0.000646 192.168.122.1 -> 192.168.122.100 TCP 66 40158 -> 22 [ACK] Seq=37 Ack=37 Win=1467 Len=0 TSval=1997621571 TSecr=1075416765 3 12.218164 192.168.122.1 -> 192.168.122.100 SSH 102 Client: Encrypted packet (len=36) XDP : # xdpdump -D Interface Prio Program name Mode ID Tag Chain actions -------------------------------------------------------------------------------------- lo eth0 xdp_dispatcher skb 10558 d51e469e988d81da => 5 xdp_test_prog_w 10576 b5a46c6e9935298c XDP_PASS => 10 xdp_pass 10582 3b185187f1855c4c XDP_PASS => 10 xdp_pass 10587 3b185187f1855c4c XDP_PASS xdp_dispatcher() xdp_pass() : # xdpdump -i eth0 --rx-capture=entry,exit -p xdp_dispatcher,xdp_pass@10587 or # xdpdump -i eth0 --rx-capture=entry,exit -p 10558,10587 listening on eth0, ingress XDP program ID 10558 func xdp_dispatcher, ID 10587 func xdp_pass, capture mode entry/exit, capture size 262144 bytes 1607694215.501287259: xdp_dispatcher()@entry: packet size 102 bytes on if_index 2, rx queue 0, id 1 1607694215.501371504: xdp_pass()@entry: packet size 102 bytes on if_index 2, rx queue 0, id 1 1607694215.501383099: xdp_pass()@exit[PASS]: packet size 102 bytes on if_index 2, rx queue 0, id 1 1607694215.501394709: xdp_dispatcher()@exit[PASS]: packet size 102 bytes on if_index 2, rx queue 0, id 1 ^C 4 packets captured 0 packets dropped by perf ring (BUGS) : https://github.com/xdp-project/xdp-tools/issues (AUTHOR) xdpdump Eelco Chaudron . V1.6.3 January 13, 2021 xdpdump(8)