pyroute2 icon indicating copy to clipboard operation
pyroute2 copied to clipboard

Add MPTCP Support

Open pgagne opened this issue 3 years ago • 8 comments

Hello,

Recently MPTCP configuration was added to iproute2.

https://man7.org/linux/man-pages/man8/ip-mptcp.8.html

It would be useful to have this in pyroute2.

Please let me know if there is anything I can do to help with this.

pgagne avatar Apr 14 '21 14:04 pgagne

Thanks for heads-up!

svinota avatar Apr 14 '21 18:04 svinota

@pgagne basic endpoint management has been added: https://github.com/svinota/pyroute2/commit/db1c48e7089419d64f307e4db0e4387a6966a9a6

Limits support and flags will be done this weekend.

svinota avatar Apr 16 '21 22:04 svinota

Limits support has been added: https://github.com/svinota/pyroute2/commit/4e194b99f0ff016d75a8eefd29f81d4d0c0a7c13

Corresponding tests are to be added asap.

svinota avatar Apr 17 '21 13:04 svinota

@pgagne I believe the mptcp support is more or less tolerable. Please let me know if you miss something.

svinota avatar Apr 17 '21 16:04 svinota

Thanks @svinota I'll take a look and let you know.

pgagne avatar Apr 19 '21 13:04 pgagne

@svinota is there support to set the endpoint flags when adding the endpoint (ie signal, subflow, backup), the equivalent of

ip mptcp endpoint add <addr> subflow

pgagne avatar Aug 23 '21 21:08 pgagne

I think i figure out how to set the endpoint flags,

class MPTCPFlags(IntFlag):
    # via https://github.com/torvalds/linux/blob/9d31d2338950293ec19d9b095fbaa9030899dcb4/include/uapi/linux/mptcp.h#L73
    MPTCP_PM_ADDR_FLAG_SIGNAL = (1 << 0)
    MPTCP_PM_ADDR_FLAG_SUBFLOW = (1 << 1)
    MPTCP_PM_ADDR_FLAG_BACKUP = (1 << 2)

mptcp.endpoint("add", addr=str(ip), flags=MPTCPFlags.MPTCP_PM_ADDR_FLAG_SUBFLOW)

this will work for me for now.

pgagne avatar Aug 24 '21 19:08 pgagne

Hi, is there a way to do an equivalent of ip mptcp add ADDRESS dev NAME?

Kuba314 avatar Nov 28 '23 13:11 Kuba314