Search code examples
packet-capturepacket-snifferspf-ring

How can two or more applications use PF_RING ZC cluster?


The following Picture indicates that many applications could use PF_RING clusters. ref:UserGuid.pdf provided BY ntop.org

I have tested this by the following commands.

./zount -i eth0 -c 55 ---- ok

./zcount1 -i eth0 -c 99 ----- ok

Suppose i want to use pf_ring zc. As far as i know If you open a device using a PF_RING-aware driver in zero copy (e.g. pfcount -i zc:eth1) the device becomes unavailable to standard networking as it is accessed in zero-copy through kernel bypass, as happened with the predecessor DNA. Once the application accessing the device is closed, standard networking activities can take place again.

I have 2 questions:

Question 1- as long as the application connected to the NIC via ZC (e.g. pfcount -i zc:eth1), the NIC is inaccessible to other applications .in such a situations no one could use zero copy.

$pfcount2 -i zc:eth1 -------- error .

if i am wrong ,is it possible to use PF_RING ZC like PF_RING? the following pic show what i am trying to say.

enter image description here

Question 2: is it possible to use PFRing_zc as follow? if the answer is YES, how ? is there any API?

enter image description here

Thanks in Advance


Solution

  • cardigliano, a ntop member ,answered my question:

    yes you can do both with zbalance:

    1. zbalance_ipc -i zc:ethX -c 99 -m 0 -n

    2. zbalance_ipc -i zc:ethX -c 99 -m 0 -n ,

    Please take a look at zbalance_ipc -h for more options and at the zbalance_ipc output to see how to attach consumers to the cluster. There is also a README.examples with a few examples.