naoki9911 / MPTCP-Proxy

7 stars 1 forks source link

Subflow connection recovery #1

Open Sunser opened 2 years ago

Sunser commented 2 years ago

After using iperf3 to measure the speed, the sub stream is not recovered。

The error is as follows: ERRO[1778] connection reset by peer ERRO[1778] broken pipe

naoki9911 commented 2 years ago

Thank you for trying!

I'm not an expert in MPTCP. I'm sorry but I'm not sure about what 'sub stream is not recovered' means. Could you tell me what 'sub stream is not recovered' means?

Sunser commented 2 years ago

Not a recovery, the translation is a bit hard to read In fact, the stream is not cleaned up and released after the connection is disconnected

naoki9911 commented 2 years ago

I understand what you mean. Just as you said, the streams are not cleaned up after close(2) on the MPTCP socket. I confirmed that using netstat -antlp and it shows the MPTCP streams continue to remain.

$ docker-compose exec client netstat -antlp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.11:32803        0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:5555            0.0.0.0:*               LISTEN      8/mptcp-proxy       
tcp        0      0 10.123.201.3:58251      10.123.201.2:4444       ESTABLISHED -                   
tcp        0      0 10.123.200.3:54284      10.123.200.2:4444       ESTABLISHED - 

I cannot know why such a situation happens. Would you help me if you like?

naoki9911 commented 2 years ago

It's just a guess. When close(2) on the MPTCP socket, read(2) in another thread continues to be blocked?

Sunser commented 2 years ago

I tried running iperf3 with the mptcpize package provided by mptcpd before using your mptcp proxy and didn't see any such issues. But mptcpize is not the best solution, tried using mptcpize your mptcp proxy doesn't work softether vpn

naoki9911 commented 2 years ago

That's interesting. And I also want to use my MPTCP-Proxy for softether VPN :)

Sunser commented 2 years ago

QQ图片20220501233810

Above is the difference between using your mptcp-proxy and mptcpize subflow cleanup

naoki9911 commented 2 years ago

I pushed a commit that fixes this issue.

Could you try this?

Sunser commented 2 years ago

Okay, I'll take the test now, and I'll let you know the results later

naoki9911 commented 2 years ago

I'm going to sleep and I will check your results after waking up

Sunser commented 2 years ago

QQ图片20220501233810

iperf3 sending data will be interrupted, it seems that the substream is terminated before the substream is terminated。

Sunser commented 2 years ago

mptcp-proxy err log: resource temporarily unavailable

naoki9911 commented 2 years ago

Oops, I should do write(2) with blocking. I fixed that issue.

Sunser commented 2 years ago

The latest code has been tested, the previous interruption problem has been fixed, but the log still exists write/read connection reset by peer.

naoki9911 commented 2 years ago

Hmm, it seems that the proxy has to close connections with shutdown(2)

By the way, the latest MPTCP-Proxy can handle SoftEther VPN connections in my environment. VPN client needs to disable UDP acceleration.

Sunser commented 2 years ago

Ok, I will deploy and test it tonight when I have time to let you know if there is a problem.

Sunser commented 2 years ago

I saw that a transparent mode was added, what is this for? I didn't see you adding a document and it was a little confusing

naoki9911 commented 2 years ago

The transparent mode is for debugging. SE-VPN works without it. I will add documents about the mode and SE-VPN later.

Sunser commented 2 years ago

I found that no matter how much bandwidth throughput is used in iperf3 speed measurement, the cpu usage of mptcp-proxy is always the same. For example, 8Gbps/s cpu overhead is 200%, and 100Mbps/s cpu overhead is still 200%

Sunser commented 2 years ago

The sevpn script test found that the throughput through the mptcp-proxy proxy is extremely low, and the iperf3 through the mptcp-proxy proxy can reach 100Mbps/s, while the speed of sevpn after passing through the proxy is abnormally low, only hovering between 500Kbps - 10Mbps. The above test is based on tencent lighthouse to me home network

naoki9911 commented 2 years ago

I will treat these issues in #2 and #3