mfontanini / libtins

High-level, multiplatform C++ network packet sniffing and crafting library.
http://libtins.github.io/
BSD 2-Clause "Simplified" License
1.89k stars 373 forks source link

faster than libpcap #24

Open simonhf opened 9 years ago

simonhf commented 9 years ago

Would it make sense to allow libtins to run either on top of libpcap (like it does today), or other packet capturing technologies -- which are potentially faster -- like netmap [1]?

[1] http://info.iet.unipi.it/~luigi/netmap/

mfontanini commented 9 years ago

I hadn't considered this, but it could be an option. However, regarding netmap, I see that there is a fork of libpcap that uses this capture mechanism, so I guess if you're using it, it should work.

Is there any other packet capturing libraries that are not libpcap compatible and that it would make sense to support?

simonhf commented 9 years ago

AFAIK netmap is not a packet capturing library per se but rather a mechanism to bypass the (slower) kernel network stack to allow direct, zero copy access to packets in user land via shared memory. AFAIK there are a bunch of other kernel network stack bypass technologies around like netmap and probably the most note-worthy is [1]. However, AFAIK only netmap allows you to run on a single NIC and decide in the NIC driver which packets should flow to the kernel network stack and which packets should be made available to user land via shared memory. Most other solutions require the kernel bypass technology to completely take over a particular NIC... meaning that servers need at least two NICs (one for ssh, and one for the bypass) to work... which rules out using the bypass technology on commodity servers which only have a single NIC. HTH.

[1] http://dpdk.org/