DMA ring, NAPI, PF_RING
Help me, please! I don't understand why in work "A HIGH PERFORMANCE PACKET CAPTURING SUPPORT FOR ALARM MANAGEMENT SYSTEMS" by Amitava Biswas, Purnendu Sinha DMA ring is described as an alternative technology to NAPI and PF_RING. DMA RING against PF_RING. Why? I read texts above in this forum. and dma ring here is only a buffer in every possible (almost every) linux.
The second question. Deitel in his book wrote, that packet follows the next way: memory, described by sk_buff (isn't it a dma ring?)- queue of packets-interrupt handler-softirq- and further. Where included dma ring? What components of this row changes with NAPI? circuit buffer instead of queue of packets? isn't this circuit buffer is DMA ring?
And the last question. What system I need to have no packet loss and to have maximum traffic capturing speed on a home computer? I used PF_RING + libpcap. Is there anything faster? Maybe combinations of RT linux?
I'm russian, and my English is ugly, sorry.
todik_kh answered me in messages:
"Yes Direct memory access, or DMA , is the advanced topic that completes our overview of memory issues. DMA is the hardware mechanism that allows peripheral components to transfer their I/O data directly to and from main memory without the need to involve the system processor. Use of this mechanism can greatly increase throughput to and from a device, because a great deal of computational overhead is eliminated.
I captured all packets with Netfilter its very powerful and no packet lost but the only problem is that you cant get the out going mac addresses if you only need to get incoming mac ip and packet and u dont need to get out going mac and only need to get out going ip and packet net filter is the fastest and no packet lost.
you have to write a kernel module to be able to use netfilter and after capturing all those packets you can use Netlink Sockets to transfer the packets from kernel space to user space, the good thing of netfilter is that you can control the packets that if u what to accept that packet to get to the O.S you can or if you want to drop it you can.
BUT if you want to capture all incoming and outgoing packet parts like Mac Header and the rest you have to write a code like network driver to get outgoing Mac address or you can add code to the kernel of the Linux and compile it, E.G. the incoming function in linux is (netif_rx) this function is the connector between Kernel level and user level this is the first function that Network Drivers call after they get that packet from the wire and this function send it to the O.S and you can add code in that function to change it but i couldn't find that exact function to get that outgoing packets."
I knew the definition of DMA.. but.. isn't it included in NAPI and PF_RING? How can I install this technology? And it's important for me to understand what place DMA ring included in the way of packet, described me above.
Netfilter.. it's a firewall.. This is technology not similar to NAPI and PF_RING, it solves another tasks, doesn't it?