Reputation: 193
My passive network monitoring
application needs packets to be captured from network interface (at higher packet rates). The packet capture module should be able to call a monitoring function upon capture of each packet (and also write the packet in to pcap
file).
I thought of using DPDK
as the packet capture module in my monitoring application (as we use pcap_loop
and pfring_loop
in libpcap
and pfring
respectively), but I am not sure whether this is one of the use cases of DPDK
, or, is DPDK
meant to be used like this?.
So my questions are..
Can I use DPDK
to fulfill my requirements?, If yes how to start?.
OS: Linux.
Karnal version: 4.
DPDK version: Latest stable.
Capture on physical device.
The capturing application has root privileges and will be used by the network administrator (as part of passive asset discovery).
I want to use DPDK because it supports capture at line rate upto 10 Gbps
Thank you.
Upvotes: 0
Views: 1348
Reputation: 11
Newer versions of libpcap can themselves use DPDK, at least on Linux. The libpcap on your system might, or might not, be configured to use it. (There are also versions of libpcap modified to use PF_RING.)
Upvotes: 0
Reputation: 4798
Based on the updates and clarification in comment the request is Can one replace an existing application which PF_RING API calls with DPDK API which is written in C?
. Simple answer to it is yes it can be done.
Here is how one should start
rte_pktmbuf_mtod
. There are many samples in DPDK/examples folder which does the same.Upvotes: 1