VrayoSystems / vtrunkd

Open source SD WAN daemon for linux (network link bonding/trunking/aggregation and multichannel VPN daemon).
GNU General Public License v3.0
223 stars 77 forks source link

alternative zero-copy method - splice packets when they are in sync #79

Open grandrew opened 8 years ago

grandrew commented 8 years ago

see http://osdir.com/ml/linux.network.general/2003-05/msg00016.html

If your application just needs to look at the header of lots of
packets, I would suggest using AF_PACKET's mmap feature with a limited
capture length. That will copy just a few bytes into user space for
each packet, and user space can process batches of packets at a time
when your device is loaded. This is very efficient.

AF_PACKET is a raw capture socket; this is completely zero-copy and works directly with DMA (PF_RING/DNA is the full crazy stuff)

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

so it is actually like implementing totally userspace networking

grandrew commented 8 years ago

also see http://dpdk.org/