Why do we use the Linux kernel's TCP stack?
The core functionality required is a &quot;zero copy&quot; networking lib : dpdk, netmap.<p>Normally, when the kernel recieves data from the network, it allocates a block in the kernel and copy the data into it. Then your read operation copies that data in your user space. 
The &quot;zero copy&quot; networking stacks avoids the data copy. The way it works, as I was explained, is that they use a shared memory mapped zone. This zone is organized as a pool of blocks managed with non blocking lists. Blocks have a fixed size big enough to hold the ~1500 IP blocks. I never used it so I don&#x27;t know the details.<p>When data arrives, it is directly written in place in a block of the memory mapped zone. In the user space you use select&#x2F;epoll&#x2F;kqueue or polling if the waiting time is very small. Once you have a block you can process it. This block contains raw network data received from the network card. So it&#x27;s up to you to code and decode the TCP&#x2F;IP headers or use an existing lib like mTCP that does that for you. I was told that it can work with dpdk and netmap.<p>My colleague is currently using netmap for a high performance data acquisition application in a LAN and plan to test dpdk with mTCP this summer. mTCP should simplify programming. At CERN they are now testing data acquisition setups using dpdk to be able to use commodity component hardware.<p>My colleague told me that Netmap is available in the BSD kernel so that you can use it right away. It is not included in the Linux kernel and you then need to patch it in. Zero copy is the future of network programming. Linux is late on this one. Then there is dpdk on which I don&#x27;t have much info yet except that it is made by Intel, it is open source and compatible with AMD processors. It is apparenly not easy to install.<p>Since dpdk and netmap communicates directly with the network card, it only works with supported network cards.<p>The gain in performance is significant, but I have no numbers at hand to give.