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

net: add func (*TCPConn) MultipathTCP() (bool, error) #59166

Closed
matttbe opened this issue Mar 21, 2023 · 9 comments
Closed

net: add func (*TCPConn) MultipathTCP() (bool, error) #59166

matttbe opened this issue Mar 21, 2023 · 9 comments

Comments

@matttbe
Copy link
Contributor

matttbe commented Mar 21, 2023

Hello,

While working on #56539, I noticed I misunderstood the use of MultipathTCP() when it was discussed.

Despite the fact Apple and others have been pushing to avoid that, it can happen some middleboxes explicitly or accidentally block MPTCP, e.g. transparent proxy, some firewalls blocking all TCP extensions, etc. When this happens, MPTCP connections will fallback to TCP and continue to work with only one path.

App developers explicitly requiring MPTCP might want to know if a fallback to TCP has been done. The idea would then be to add a method to check such a thing, e.g.

pkg net, method (*TCPConn) MultipathTCP() (bool, error)

Similar to other TCPConn methods (KeepAlive, No Delay, Linger, etc.), an error can be emitted if the connection is not OK.

The Linux kernel can tell us that: example.

A draft implementation has been shared on Gerrit.

@gopherbot gopherbot added this to the Proposal milestone Mar 21, 2023
@gopherbot
Copy link

Change https://go.dev/cl/471140 mentions this issue: net: mptcp: add UsingMultipathTCP checker

@gopherbot
Copy link

Change https://go.dev/cl/471139 mentions this issue: internal/poll: add GetsockoptInt

@ianlancetaylor ianlancetaylor changed the title proposal: net/tcp: mptcp: abilitity to check if a connection has fallen back to TCP proposal: net: mptcp: abilitity to check if a connection has fallen back to TCP Mar 21, 2023
@rsc
Copy link
Contributor

rsc commented Mar 29, 2023

Given that the getter method on Listener and Dialer is just MultipathTCP, it seems like the TCPConn method should be that too (not Using...). Otherwise sounds good.

@rsc
Copy link
Contributor

rsc commented Mar 29, 2023

This proposal has been added to the active column of the proposals project
and will now be reviewed at the weekly proposal review meetings.
— rsc for the proposal review group

@matttbe
Copy link
Contributor Author

matttbe commented Mar 30, 2023

Given that the getter method on Listener and Dialer is just MultipathTCP, it seems like the TCPConn method should be that too (not Using...). Otherwise sounds good.

@rsc: Thank you for having looked!

I'm fine with the shorter version (MultipathTCP).

@ianlancetaylor: you suggested adding this Using prefix. Is it OK for you without it?

@matttbe matttbe changed the title proposal: net: mptcp: abilitity to check if a connection has fallen back to TCP proposal: net: mptcp: ability to check if a connection has fallen back to TCP Mar 30, 2023
@ianlancetaylor
Copy link
Contributor

@matttbe MultipathTCP is fine with me. Thanks.

@rsc rsc changed the title proposal: net: mptcp: ability to check if a connection has fallen back to TCP proposal: net: add func (*TCPConn) MultipathTCP() (bool, error) Apr 5, 2023
@rsc
Copy link
Contributor

rsc commented Apr 6, 2023

Based on the discussion above, this proposal seems like a likely accept.
— rsc for the proposal review group

@rsc
Copy link
Contributor

rsc commented Apr 12, 2023

No change in consensus, so accepted. 🎉
This issue now tracks the work of implementing the proposal.
— rsc for the proposal review group

@rsc rsc changed the title proposal: net: add func (*TCPConn) MultipathTCP() (bool, error) net: add func (*TCPConn) MultipathTCP() (bool, error) Apr 12, 2023
@rsc rsc modified the milestones: Proposal, Backlog Apr 12, 2023
gopherbot pushed a commit that referenced this issue Apr 18, 2023
This new function wraps the getsockopt network call with an integer
argument, similar to SetsockoptInt.

This will be used in MPTCP in the following commit.

This work has been co-developed by Gregory Detal
<gregory.detal@tessares.net>.

Updates #59166

Change-Id: I8f6aa00ea2535683d9bbf436993c23e9c6ca2af3
Reviewed-on: https://go-review.googlesource.com/c/go/+/471139
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
@gopherbot
Copy link

Change https://go.dev/cl/498601 mentions this issue: doc/go1.21: mention multipath TCP support

gopherbot pushed a commit that referenced this issue May 30, 2023
For #56539
For #59166

Change-Id: Ief392464916a1a74a8fcc6c3c7bdb213e8c6ef98
Reviewed-on: https://go-review.googlesource.com/c/go/+/498601
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Eli Bendersky <eliben@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
@dmitshur dmitshur modified the milestones: Backlog, Go1.21 Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants