-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*** ndpi library version mismatch, expected API rev.10926 (4.9.0) found rev.11086 (4.9.0-4778-c2b657f) *** #948
Comments
Please try pulling the latest code, we just updated the FT library to match latest nDPI |
It works now. But now I see another problem. here are 2 crash back trace from GDB Program received signal SIGSEGV, Segmentation fault. and: munmap_chunk(): invalid pointer Program received signal SIGABRT, Aborted. |
@ronygut it seems I am not able to reproduce it, I will analyse the code, thank you for the trace |
I was finally able to reproduce and fix this, please git pull the latest code and let me know |
Which git project to pull? nDPI , PF_RING, or both? |
PF_RING |
Fixed! |
can I use pfring_ft_process from different threads? |
For performance reason FT does not implement locking and it has been designed to be used with one instance per thread in case of multithreading, rather than sharing a single table. In short, please allocate multiple tables, one per thread. |
in pfring_ft_create_table what does user_metadata_size is used for? |
v = pfring_ft_flow_get_value(flow); |
If you use v->user to store data, the size of that data should be provided via the user_metadata_size parameter, otherwise you access memory out of boundaries |
FT takes care of allocating v->user (you can cast it to your data structure), just please pay attention if you place there pointers to other memory that you allocate dynamically (FT is not aware of those and you have to free them) |
pf_ring ft is responsible to allocate that size of bytes, and also to delete it at end of flow? |
Correct |
Do the callback from pfring_ft_set_flow_packet_callback is always called for each packet added to the flow? |
|
is HBO - host order? In pfring_ft_flow_key , the saddr ,sport and daddr, dport are the client and server for the flow? The direction in metadata is changed to s2d_direction and d2s_direction according to the packet itself? The saddr ,sport and daddr, dport in pfring_ft_flow_key will always be the same in the flow? are they indicate client/server? |
|
Do I need to call pfring_ft_housekeeping in the loop that process packets every x seconds for each flow table I use? |
Does VLAN ID part of the flow key by default? I know it is part of the key structure, but does the flow key consists of vlan id + src ip + src port + dst ip + dst port + protocol? I use only IPV4 I'm creating 12 threads and each has a reference to different pfring_ft_table* Maybe, VLAN ID 0 indicates that there was no VLAN in the packet? |
What does pfring_ft_ext_pkthdr is used for in pfring_ft_create_table. |
pfring_ft_housekeeping is called automatically once per second when calling pfring_ft_process(), however it is a good practice to call it by the caller when idle (in case pfring_ft_process is not called). However it is not mandatory to call it. |
This is not actually used by FT itseld, it is for external use. |
Yes, vlan id is part of the flow key. We can make it optional (open a separate ticket with this feature request)
Could you provide a pcap to reproduce this?
Yes, 0 means no vlan for us. Do you have a vlan with id 0? |
Thank you for your answers, I really appreciate it! Can I use an array of pfring_ft_tableto* , according to the number of consumer threads that I create, dynamically, and each thread will have an index to this array? (I will call pfring_ft_create_table in a main thread and fill it up before consumer threads are created and each can use one table according to an index in the array) What is the recommended way? I want to avoid synchronizations between PF_RING ZC consumer threads on the flow table? If you have an example of using multiple pf_ring flow table in multiple threads I would appreciate that you can share the code as an example on how to correctly do it. |
No we don't have VLAN ID 0. |
Where can I open the ticket for the VLAN ID field that will be an optional in the flow key? |
@cardigliano I think I know what is the main difference between my program and ftflow.c |
Please free the flow, regardless of the status. Slices are is just a copy of the original flow. |
@cardigliano , In this case I'm not sure I understand the use of slices. |
@ronygut you are correct: slices are used for long term flows to get updates without expiring the flow. The main flow is not touched until it expires, and it keeps the reference to the user data. Exported slices are like clones of the flow with a snapshot of the counters at the moment they are exported. |
@cardigliano , so I need to call free flow each time the export callback is called regardless if the flow status is PFRING_FT_FLOW_STATUS_SLICE_TIMEOUT? |
Correct |
@cardigliano , I don't have an internet connection from the machine I build PF_RING |
@cardigliano , I used git clone and pulled the repository and still getting the same error: I build PF_RING like this: Used new libpfring.a file in my program I built ndpi as static: Used new libndpi.a in my program Please advise |
@cardigliano , tried to call free flow also when getting slice timeout PFRING_FT_FLOW_STATUS_SLICE_TIMEOUT and exactly after timeout expired and getting indication of status = PFRING_FT_FLOW_STATUS_SLICE_TIMEOUT , the program crashes probably because I'm trying to access the user data in the flow. |
FT is dynamically loading ndpi from the installation paths (/usr/lib/libndpi.so.* or /usr/lib64/libndpi.so.*), alternatively you can provide a custom path via env var (NDPI_LIB_PATH) |
@cardigliano , I'm using static linking and not dynamic linking for both ndpi and pfring. |
Please do not release the user data when a flow slice is exported, as it is still referenced by the original flow |
FT is using dynamic linking (dlopen) anyway, please use .so |
I'm not releasing the user data on flow export. |
I can't use ./autogen.sh --with-only-libndpi /configure --enable-static make |
As I'm running from root NDPI_LIB_PATH will not work |
copied the libndpi.so* to /usr/lib |
@cardigliano I would appreciate it if you can fix the mismatch problem as I can't get the new IGNORE VLAN feature checked. |
You said you are using the stable branch (PF_RING 8.8.0 and nDPI 4.10) right? |
Yes, I'm using the stable (PF_RING 8.8.0 and nDPI 4.10) -rwxr-xr-x 1 root root 3046360 Sep 5 08:34 /usr/lib/libndpi.so.4 |
It seems you did not install the ndpi .so from ndpi 4.10 (use packages or run make install) |
I downloaded the zip file from nDPI 4.10 and build everything myself. |
@cardigliano dpkg -c ndpi_4.11.0-0_amd64.deb |
@cardigliano , I probably downloaded the 4.10 development branch and not the the 4.10-stable branch. |
@cardigliano , OK, it works! |
I'm running the ftflow program and when ICMP protocol is decoded I see that sometimes the destination port is not 0. (in this case 771) [Flow] l7: ICMP, category: 0, srcMac: A8:46:9D:38:96:D5, dstMac: 00:08:E3:FF:FD:90, vlanId: 0, srcIp: 10.61.230.130, dstIp: 10.21.210.240, srcPort: 0, dstPort: 771, protocol: 1, tcpFlags: 0x00, c2s: { Packets: 1, Bytes: 146, First: 1725804668.687727, Last: 1725804668.687727 }, s2c: { Packets: 0, Bytes: 0, First: 0.0, Last: 0.0 }, status: idle-timeout, action: default |
In case of ICMP, the destination port is set to (icmp_type * 256) + icmp_code, this is used to identify icmp requests between the same client/server |
What was the exact hardware that you used to accomplish ~100Gbit/second with PF_RING FT + nDPI? |
A sample configuration we used during recent tests in our lab is Intel Xeon Gold 6526Y with 8 x 16 GB DDR5 memory modules. As adapter at 100Gbit you can use Napatech (NT200A02) for best performance, NVIDIA ConnectX or Intel are also supported and perform good with PF_RING ZC drivers on average traffic at 100 Gbps. |
Do you mean 16 consumer threads bind to specific cores? |
Using the latest versions of PF_RING and nDPI
PF_RING 8.6.1 FROM October 23
nDPI 4.8 October 23
PF_RING FT is configured to use static nDPI
./configure --disable-ft-dl
When building PF_RING FT example with pcap and run ./ftflow_pcap -7 -i eth0
receiving:
*** ndpi library version mismatch, expected API rev.10926 (4.9.0) found rev.11086 (4.9.0-4778-c2b657f) ***
Please advise.
Thanks,
Rony.
The text was updated successfully, but these errors were encountered: