DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] tcpdump support in DPDK 2.3
@ 2015-12-14  9:57 Morten Brørup
  2015-12-14 15:45 ` Aaron Conole
  2015-12-14 18:29 ` Matthew Hall
  0 siblings, 2 replies; 26+ messages in thread
From: Morten Brørup @ 2015-12-14  9:57 UTC (permalink / raw)
  To: dev

I noticed a discussion about support for tcpdump in DPDK 2.3.

 

Please consider which scenarios you want to support:

 

1. Compatibility with legacy non-DPDK applications (e.g. a DHCP server application) that captures specific packets by opening RAW sockets and attaching BPF filters to these sockets?

I agree that KNI (or TUN/TAP for the non-KNI kernels) is a realistic and simple way to interact with the kernel regarding raw packet capture, which might be filtered by the kernel. In this case, all packets will be passed on from DPDK to the kernel, which will handle the BPF filtering, and then pass up the packets to the application.

 

2. Compatibility with Wireshark?

Check out the new "extcap" feature of Wireshark. It uses named pipes for the packets, already mentioned by Stephen Hemminger.

 

3. tcpdump/libpcap support?

Tcpdump is an open source application, so it should be possible to define an efficient interface between DPDK and tcpdump, and implement it in both DPDK and tcpdump. The same goes for libpcap. An efficient interface has a primary feature: passing packets from DPDK to tcpdump/libpcap without too much overhead. It possibly also has a secondary feature: passing a BPF program from tcpdump/libpcap to DPDK, so packets can be filtered in DPDK and don't need to be passed on to tcpdump/libpcap.

 

4. Efficient fast path packet filtering using BPF?

Technically, this has nothing to do with tcpdump. Just add a BPF library (librte_bpf) to DPDK, preferably with a compiler. The application initially calls the library's BPF compiler function once with the BPF program to compile it, and in the fast path the application calls a library function that takes an mbuf and the compiled BPF program and returns an integer value indicating how many bytes of the packet should be mirrored by the capturing application. +1 to Matthew Hall for taking this direction!

 

5. Pcap formatted output?

The pcap file format contains a header in front of each packet, which is extremely simple. But it has a timestamp (which uses 32 bit for tv_sec and tv_usec in files), so it needs to be considered how to handle this efficiently.

 

 

PS: Remember that the packets received on the port might be distributed to multiple lcores by RSS, and all these lcores need to write to a single queue (named pipe, TUN/TAP port, pcap file, or whatever).

 

PPS: Bruce Richardson suggested adding a port mirroring callback. If you want port mirroring or tcpdump support in your application, it belongs in your application. Callbacks come at a cost (especially if not used), so don't start adding callbacks and hooks for new features if not strictly required. You might also want port mirroring or tcpdump support for something further down the application's fast path, e.g. mirroring PPPoE tunneled packets after they come out of the PPPoE tunnel. In this case, you need to add it to your application anyway.

 

 

Med venlig hilsen / kind regards

 

Morten Brørup

CTO

 

 

 

SmartShare Systems A/S

Tonsbakken 16-18

DK-2740 Skovlunde

Denmark

 

Office      +45 70 20 00 93

Direct      +45 89 93 50 22

Mobile      +45 25 40 82 12

 

mb@smartsharesystems.com <mailto:mb@smartsharesystems.com> 

www.smartsharesystems.com <http://www.smartsharesystems.com/> 

 

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2015-12-21 17:22 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-14  9:57 [dpdk-dev] tcpdump support in DPDK 2.3 Morten Brørup
2015-12-14 15:45 ` Aaron Conole
2015-12-14 15:48   ` Thomas Monjalon
2015-12-14 18:29 ` Matthew Hall
2015-12-14 19:14   ` Stephen Hemminger
2015-12-14 22:23     ` Matthew Hall
2015-12-14 19:17   ` Aaron Conole
2015-12-14 21:29     ` Kyle Larose
2015-12-14 22:36       ` Matthew Hall
2015-12-16 10:45         ` Bruce Richardson
2015-12-16 11:37           ` Arnon Warshavsky
2015-12-16 11:56             ` Morten Brørup
2015-12-16 11:40           ` Morten Brørup
2015-12-16 11:56             ` Bruce Richardson
2015-12-16 12:26               ` Morten Brørup
2015-12-16 13:12                 ` Bruce Richardson
2015-12-16 22:45                   ` Morten Brørup
2015-12-16 23:38                     ` Matthew Hall
2015-12-17  5:59                       ` Arnon Warshavsky
2015-12-16 18:15               ` Matthew Hall
2015-12-21 15:39                 ` Bruce Richardson
2015-12-21 16:08                   ` Morten Brørup
2015-12-21 16:17                     ` Gray, Mark D
2015-12-21 17:22                       ` Matthew Hall
2015-12-21 16:11                   ` Gray, Mark D
2015-12-14 22:25     ` Matthew Hall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).