简体   繁体   中英

libpcap (>1.0.0) and PF_RING efficiency

I'm using libpcap 1.4.0 in order to capture packets from/to a device (I'm using linux). I'm suffering from packet loss, and after a research about it, I found PF_RING, and now i'm considering using it.

The problem is, I don't really understand why using PF_RING is more efficient than using libpcap's PF_PACKET, when libpcap's default packet capture method is "zero-copy" (since libpcap 1.0.0), as well as PF_RING's...

Can someone please explain me why, with libpcap 1.0.0 and later, using PF_RING would be still more efficient (if it is actually more efficient) than not using it ?

Thank you in advance! :)

according to https://stackoverflow.com/a/8897187/288875 there is still one copy from the kernel's socket buffer (sk_buff) to the memory you will read. PF_RING seems not to do this copy (as far as I remember does pfring bypass the normal kernel mechanism of handling data received from the network card).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM