OpenFastPath / ofp

OpenFastPath project
BSD 3-Clause "New" or "Revised" License
349 stars 126 forks source link

[openfastpath] Help for TCP application #206

Open sovu opened 6 years ago

sovu commented 6 years ago

Dear OpenFastPath developpers,

We want to test OpenFastPath to improve a network application. Only UDP connections need to work with OFP, TCP connections can stay in Linux BSD API. I try to develop a code with your API for 3 weeks without success. My codes are based on the socket example code. I test them with an echo application on another machine (basic Linux Ubuntu, without OFP, 192.168.0.59) and run my application (192.168.0.41).

My UDP test (with OFP) works fine. But I can observe a lot of mmap failure in the beginning of the application.

I did a TCP test based on my UDP test but didn't work. In beginning, I try with OFP API. I have seen (on Github issues) that there are some problem with the “ofp_connect” function and after testing “ofp_select” I have decided to continue with BSD API. But I don't succeed to make this API working with fast path. I can see with Wireshark (after capturing packet with tcpdump) that the TCP/SYN packet is sent and the echo server respond with the TCP/SYN-ACK packet but after I have a lot of retransmission packet and “connect” function never return (I don't change socket option, this function still blocking).

I don't know where the problem is (configure option ? Code structure ? API use ?) and I hope the .zip files I attach (client/server code/log and pcap file) will help you to help me.

Thank you in advance …

Kind Regards,

Guillaume BLOINO

iufl commented 6 years ago

simple_tcp_com.zip

iufl commented 6 years ago

I attached a functional example of the TCP client.

An example of running: ./simple_tcp_com -c 1 -i 0 -r 192.168.10.1 -p 12345 -f ofp.cli

-c - number of cores -i - the interface that will be enabled, in this case the interface is used by DPDK and its id is 0 -r - the IP address of the server -p - the port the server is listening on -f - config file for OFP

ofp.cli contains the IP address that will be added on the interface: ifconfig fp0 192.168.10.2/24