Hi, Louis,

In addition to the DPDK and the libvma options that others have discussed, you 
might want to consider using memory mapped packet sockets.  This is very 
agnostic to the NIC you are using and requires no special driver magic to work, 
so in that sense it is simpler than the other options.  The latest Hashpipe 
program includes a user friendly API for setting up and using sockets of this 
type to receive UDP packets.  Once setup, the kernel will DMA packets directly 
from the NIC into your application's memory space and set an in-memory flag 
which you can poll to detect the arrival of new packets.  It may not be quite 
as fast/optimized as the DPDK or libvma options, but it is very much faster 
than receiving packets from the kernel’s IP stack via recv().  Since the 
barrier to entry is lower, it might be worth exploring this option first.  If 
it doesn’t meet your needs, then you can try the other more involved approaches.

I agree with the suggestion to measure where your code is spending time.  If 
you are getting bogged down in disk I/O or some other non-network part of your 
code then no amount of speeding up the network code will fix things.

You can read about the mmap’d packet sockets here:

https://www.kernel.org/doc/Documentation/networking/packet_mmap.txt

You can find the latest Hashpipe code here:

https://github.com/david-macmahon/hashpipe

Hope this helps,
Dave

> On Jun 29, 2016, at 9:58 PM, Louis P. Dartez <[email protected]> wrote:
> 
> Hi all, 
>       Can anyone guide me on what tools are being used for packet capture 
> purposes right now? I’ve been working on a baseband recorder using a ROACH1 
> using the 10GbE lines but I can’t seem to avoid losing packets when writing 
> data to memory or disk. I wrote a threaded packet sniffer in C with a pretty 
> tight loop that write directly to memory in Ubuntu Linux. I’m wondering if 
> there are any optimizations that I could be missing out.
> 
> 
> Any advice would be greatly appreciated, Thanks in advance!
> LD
>> Louis P. Dartez
>> Ph.D. Candidate
>> STARGATE
>> Center for Advanced Radio Astronomy
>> University of Texas Rio Grande Valley
>> (956) 372-5812
> 

Reply via email to