multipath-tcp / mptcp

⚠️⚠️⚠️ Deprecated 🚫 Out-of-tree Linux Kernel implementation of MultiPath TCP. 👉 Use https://github.com/multipath-tcp/mptcp_net-next repo instead ⚠️⚠️⚠️
https://github.com/multipath-tcp/mptcp_net-next
Other
890 stars 336 forks source link

Support IP_TRANSPARENT #495

Closed grapexy closed 2 years ago

grapexy commented 2 years ago

There was a similar issue https://github.com/multipath-tcp/mptcp_net-next/issues/217 with v1 and it was resolved. Could we have support for this in v0 too?

I'm using MPTCP with TPROXY and subflows are unable bind to non-local addresses.

matttbe commented 2 years ago

Hi,

MPTCPv1 and v0 are referring to versions of the specifications (RFC6824 vs RFC8684), not the Linux implementation, see https://github.com/multipath-tcp/mptcp_net-next/wiki#upstream-vs-out-of-tree-implementations

IP_TRANSPARENT is supposed to be supported in the MPTCP out-of-tree implementation for quite a while now. You should be able to do a bind to a non-local address for the initial sublow.

What errors do you have? Which kernel version are you using?

matttbe commented 2 years ago

Also, does it work with plain TCP?

Maybe in your use case, you also need IP_FREEBIND, SO_REUSEADDR and others. But you should face the same issues without MPTCP (plain TCP).

grapexy commented 2 years ago

Hi Matthieu,

You're right, IP_TRANSPARENT works just fine. I'm using ndiffports with 4 subflows and IP_FREEBIND (sysctl ip_nonlocal_bind=1 to be precise) and was getting socket error 101 on all subflows except for the first one. But as I understand now, non-local bound sockets will not be able to connect to anything, so that makes sense.

I solved my case by simply making those addresses local with AnyIP. Sorry for the trouble and thanks for pointing out IP_FREEBIND and SO_REUSEADDR, that has put me on the right path during a research.