Skip to content
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

feat: add MPTCP support #3109

Merged
merged 2 commits into from
Aug 19, 2024
Merged

feat: add MPTCP support #3109

merged 2 commits into from
Aug 19, 2024

Conversation

AkinoKaede
Copy link
Contributor

@AkinoKaede AkinoKaede commented Aug 8, 2024

Background

Multipath TCP or MPTCP is an extension to the standard TCP and is described in RFC 8684. It allows a device to make use of multiple interfaces at once to send and receive TCP packets over a single MPTCP connection. MPTCP can aggregate the bandwidth of multiple interfaces or prefer the one with the lowest latency.

Support for Multipath TCP was first added in Go 1.21. In a future Go release we may enable Multipath TCP by default on systems that support it.
Go 1.21 Release Note

Other proxy softwares that written in Go had add it.

Behavior

If mptcp is not set in sockopt, V2Ray will not do any action about MPTCP, and MPTCP is disabled by default on latest Go currently. If mptcp is set to true, V2Ray will try to enable MPTCP, but it only works on Linux now. On other platforms, it will make any impact.

If one of the server and the client does not support MPTCP, MPTCP will not work and the connection will be the same as a normal TCP connection.

Go versions

This PR can only be compiled with Go 1.21 or newer versions. The minimal Go version in v2ray-core and quic-go in main branch is Go 1.21, so I think this PR not make any impact to this problem.

go 1.21

Test Results

On Linux, sudo ip mptcp monitor can monitor the status of MPTCP connections.
image

On other platforms, this PR will not make any impact currently. (I just tested it on macOS)

@AkinoKaede
Copy link
Contributor Author

I think the errors reported by Lint are not caused by this PR

@codecov-commenter
Copy link

codecov-commenter commented Aug 8, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 29.16667% with 34 lines in your changes missing coverage. Please review.

Project coverage is 35.60%. Comparing base (346ca66) to head (7ac7bba).
Report is 45 commits behind head on master.

Files with missing lines Patch % Lines
transport/internet/config.pb.go 3.70% 26 Missing ⚠️
transport/internet/system_listener.go 50.00% 3 Missing and 1 partial ⚠️
infra/conf/cfgcommon/socketcfg/socket.go 71.42% 1 Missing and 1 partial ⚠️
transport/internet/system_dialer.go 66.66% 2 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3109      +/-   ##
==========================================
+ Coverage   35.59%   35.60%   +0.01%     
==========================================
  Files         729      729              
  Lines       41613    41660      +47     
==========================================
+ Hits        14812    14834      +22     
- Misses      25167    25193      +26     
+ Partials     1634     1633       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@xiaokangwang xiaokangwang self-requested a review August 19, 2024 20:38
Copy link
Contributor

@xiaokangwang xiaokangwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this pull request is ready to be merged. Thanks for your contribution.

Documentation pull request for this merge request is welcomed. To reduce time to process merge request, documentation are no longer release blocker.

@xiaokangwang xiaokangwang merged commit 11ef2b5 into v2fly:master Aug 19, 2024
38 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants