ntop / PF_RING

High-speed packet processing framework
http://www.ntop.org
GNU Lesser General Public License v2.1
2.68k stars 353 forks source link

NTAPI version error: Got 2, expect 1 #104

Closed ion9 closed 8 years ago

ion9 commented 8 years ago

Hello, I'm trying to work out a way to get a napatech card working with pf_ring so i can fan out to bro workers

This is what the error looks like

root@pcap01:~/pfring/userland/examples# ./pfcount -i nt:stream0
NT_Init() failed: NT_Init called with version mismatch
pfring_open error [No such device] (pf_ring not loaded or interface nt:stream0 is down ?)

I'm thinking it's something in the lib for opening the napa stream

Things I found that may help

root@pcap01:/opt/napatech3/include/ntapi# cat errorcodes.h |grep 'version mismatch'
NT_MAKE_ERROR2(NT_ERROR_NTAPI_VERSION_MISMATCH,             "NT_Init called with version mismatch") \

And

root@pcap01:/opt/napatech3/include/ntapi# cat-just-the-good-part ntapi.h

/**
 * @file
 *
 * This header file contains NTAPI function prototypes
 */
#ifndef __NTAPI_H__
#define __NTAPI_H__

/**
 * @brief Initializes the NTAPI library
 *
 * This function <em>must</em> be called prior to any other
 * NTAPI function. It will initialize the NTAPI library and perform
 * compatibility checks based on the version applied.
 * The version is used to indicate to NTAPI what version of the API the
 * application supports and will enable NTAPI to act on this and adapt to that
 * version of the API if possible. This means that if the application is compiled
 * to e.g. version 1 of the API and the current API is version 9, NT_Init will
 * check if it is possible to enable backward compatibility to version 1 and
 * thereby allow the application to run on a version 9 library with version 1 API.
 *
 * @param[in] version  The version that the calling application supports
 *
 * @retval  NT_SUCCESS     Success
 * @retval  !=0            Error
 */
int NT_Init(uint32_t version);

and this

root@pcap01:/opt/napatech3/include/ntapi# cat version.h 
/**
 * @file
 *
 * This is the header file of the NTAPI_VERSION define.
 */
#ifndef __VERSION_H__
#define __VERSION_H__

/**
 * This define is used to ensure that applications can control
 * what API version should be supported by the NTAPI library.
 * The NTAPI library will via NT_Init, check if backward compatibility
 * to NTAPI_VERSION can be ensured and convert all return structures
 * to this version if possible. If it is not possible, NT_Init() will fail.
 */
#define NTAPI_VERSION 1

#endif

attached is the step by step build and test of the system

pf_ring-napatech.txt

cardigliano commented 8 years ago

@ion9 please ask Napatech to provide you latest library (we have v.5.0.2 atm)

ion9 commented 8 years ago

Thank you.

ion9 commented 8 years ago

Just got word back from napatech and the latest release is ntanl_3.2, with an initial ntanl_5.x release; however it has a limited feature set and is not ready to provide to customers just yet.

in reviewing the change log i see:

2015-11-26 PF_RING 6.2

I'll try building PF_RING 6.0.3 with ntanl_3.2.

cardigliano commented 8 years ago

Yes v.4.0.1 is supported, using 3.2 you should get a version mismatch error from the napatech library.. anyway worth give it a try

Alfredo

On 30 Jun 2016, at 15:25, ion9 notifications@github.com wrote:

Just got word back from napatech and the latest release is ntanl_3.2, with an initial ntanl_5.x release; however it has a limited feature set and is not ready to provide to customers just yet.

in reviewing the change log i see:

2015-11-26 PF_RING 6.2

Napatech module compatibility with ntanl v.4.0.1 I'll try building PF_RING 6.0.3 with ntanl_3.2.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/ntop/PF_RING/issues/104#issuecomment-229656898, or mute the thread https://github.com/notifications/unsubscribe/AHMvJ934dfUsgLUgS3YJQTX6dV41lLlfks5qQ8PAgaJpZM4JBhqL.

ion9 commented 8 years ago

PF_RING 6.0.3 with ntanl_3.2, works!!! high 5's all around. One problem

root@pcap01:~/PF_RING-6.0.3-stable/userland/lib# ./configure  --enable-nt
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking linux/net_tstamp.h usability... yes
checking linux/net_tstamp.h presence... yes
checking for linux/net_tstamp.h... yes
checking librdi.h usability... no
checking librdi.h presence... no
checking for librdi.h... no
checking for pthread_setaffinity_np in -lpthread... yes
checking PF_RING ZC support... yes
checking Zero support... yes
checking if r/w locks are supported... yes
checking DNA support... yes
checking for librdi.h... (cached) no
checking for redisCommand in -lhiredis... no
checking for numa_available in -lnuma... yes
checking if libnuma is present... yes
checking for clock_gettime in -lrt... yes
checking for nl_handle_alloc in -lnl... no
checking for dag_get_stream_erf_types in -ldag... no
checking for NT_Init in -lntapi... yes
checking if ntapi is present... yes
checking Napatech support... no
I could not find libs/libpfring_nt_x86_64_core-avx2.a
No Napatech library available
root@pcap01:~/PF_RING-6.0.3-stable/userland/lib# cd libs/
root@pcap01:~/PF_RING-6.0.3-stable/userland/lib/libs# ls
EULA.txt                          libpfring_dna_x86_64_corei7.a      libpfring_zc_i686.a              libpfring_zc_x86_64_corei7.a      libpfring_zero_x86_64.a
libpfring_dna_i686.a              libpfring_dna_x86_64_corei7-avx.a  libpfring_zc_i686_corei7.a       libpfring_zc_x86_64_corei7-avx.a  libpfring_zero_x86_64_core-avx2.a
libpfring_dna_i686_corei7.a       libpfring_nt_x86_64.a              libpfring_zc_i686_corei7-avx.a   libpfring_zc_x86_64.so            libpfring_zero_x86_64_corei7.a
libpfring_dna_i686_corei7-avx.a   libpfring_nt_x86_64_corei7.a       libpfring_zc_i686.so             libpfring_zero_i686.a             libpfring_zero_x86_64_corei7-avx.a
libpfring_dna_x86_64.a            libpfring_nt_x86_64_corei7-avx.a   libpfring_zc_x86_64.a            libpfring_zero_i686_corei7.a
libpfring_dna_x86_64_core-avx2.a  libpfring_nt_x86_64.so             libpfring_zc_x86_64_core-avx2.a  libpfring_zero_i686_corei7-avx.a
root@pcap01:~/PF_RING-6.0.3-stable/userland/lib/libs# ln -s libpfring_nt_x86_64.a libpfring_nt_x86_64_core-avx2.a

After that I could build the lib

Then I got

root@pcap01:~/PF_RING-6.0.3-stable/userland/examples# ./pfcount -i nt:steam0
#########################################################################
# ERROR: You do not seem to have a valid PF_RING-Napatech 6.0.3.150330
# license for port steam0 (P/N 810-0048-01-08)
# ERROR: Please get one at http://shop.ntop.org/.
#########################################################################
# We're now working in demo mode with packet capture and          
# transmission limited to 5 minutes
#########################################################################
Using PF_RING v.6.0.3
Unable to read the device address

=========================
Absolute Stats: [0 pkts rcvd][0 pkts dropped]
Total Pkts=0/Dropped=0.0 %
0 pkts - 0 bytes [0.00 pkt/sec - 0.00 Mbit/sec]
=========================
Actual Stats: 0 pkts [1'000.09 ms][0.00 pps/0.00 Gbps]
=========================

NT_NetRxOpen() failed: When running PCAP header, the packet interface is not supported
Unable to enable ring :-(

To fix that the ntservice.ini has to have

TimestampFormat = NATIVE
PacketDescriptor = NT

as PCAP discriptor dose not work

oh joy, now to get the license file working....