by linsomniac · 4y ago · 0 comments
I will say that for seamless wireless/wired switching, Linux bonding works very well. ~15+ years ago I had my laptop set up with eth and wifi bonded, with eth as the preferred, I believe using link-beat as the method. I could be running a big copy, plug in the ethernet and the transfer rate would almost instantly shoot up, and then when done I could unplug and all of my connections would stay up.
As WiFi got faster and faster, I used this less and less, so I haven't had it set up for for quite a few years now. But it does show the promise of MPTCP.
Before that I was even doing awful things like forcing the same IP onto both eth and wifi :D
No need to bond interfaces or apply the same IP to both interfaces. Let them both acquire different IP addresses in the same subnet. Linux will start announcing its ARP replies on the ethernet path since it has a better path metric. Thus the return path for both the wifi IP and the ethernet IP will become the ethernet link. Any existing connections that were traveling over the wifi link will just move onto the ethernet link automatically.
The only difficulty is new connections. Since the ethernet path has the better metric, new connections will establish with the ethernet link's IP address. But the routing table can be adjusted to instead make the wifi link's IP address the default for both the wifi and the ethernet links. Then new connections will always use the wifi IP, and will migrate over to the wifi link when the ethernet link disappears.
This should work as long as your wifi link always remains up whether or not you're in the dock.
As for rp_filter, it's set to "2" on my machines, which seems to allow return packets on the "wrong" port as long as it's an address that any other port owns.
For MPTCP, as of today the applications over the mptcp-stream (which has subflows over the 2 media) need to be modified to use MPTCP, or an additional layer like with shadowsocks needs to be used to transparently encapsulate traffic over the link.
With the tooling already there, I think this makes for an excellent use case for MPTCP.
If aggregation of bandwidth over the various underlying media is important for you: depending on the exact mode, aggregation might not work. Even if working, via bonding you might only get aggregation if the traffic goes over multiple TCP channels, while MPTCP also aggregates for a single TCP channel.