On Oct 16, 2011, at 5:26 AM, Nulik Nol wrote:

> Hi,
> I am developing an application (a distributed cache server) that will
> be using UDP protocol to send/receive many small packets at high rate
> and I am looking for a zero copy networking solution.
> First I evaluated the PACKET_MMAP . It is a small patch to kernel
> code, uses no system calls to receive packets and can send multiple
> packets with one system call. However it is NOT a true zero copy,
> since it does a copy inside the kernel, line 762 of af_packet.c:
> 
>    skb_copy_bits(skb, 0, h.raw + macoff, snaplen);
> 
> Then I checked PF_RING kernel module. It has much more features than
> just send/receive packets, has much larger development community, and
> it supports true zero copy with DNA aware NICs. I have checked the
> source for pf_ring module and it is big, many lines of code should be
> executed at runtime. Also it needs 1 syscall for every send/receive.
> Correct me if i am wrong please.
> 
> What would you recommend me to use for my application in order to
> achieve fast networking? If I use PACKET_MMAP I will not get a true
> zero copy but I will be avoiding issuing too much syscalls and saving
> on code size, thus gaining a little bit of speed.
> If I use PF_RING I will have a true zero copy but more instructions
> will be executed and more syscalls issued, so maybe there would be no
> big difference in speed?

Hi Nulik
if you are talking about PF_RING DNA, it does *not* use any syscall (unless you 
are doing rx and there are no packets to read: in this case poll() is used in 
non-active mode). Furthermore, very few instructions are executed (don't be 
fooled, the kernel module is completely bypassed) both for rx and tx. 

Best regards
Alfredo

> 
> Will appreciate any comment.
> Regards
> Nulik
> _______________________________________________
> Ntop-misc mailing list
> [email protected]
> http://listgateway.unipi.it/mailman/listinfo/ntop-misc

_______________________________________________
Ntop-misc mailing list
[email protected]
http://listgateway.unipi.it/mailman/listinfo/ntop-misc

Reply via email to