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
887 stars 334 forks source link

not define the IPPROTO_MPTCP #493

Closed yuyujunjiang closed 1 year ago

yuyujunjiang commented 1 year ago

Hello there,

I hope you are doing well. I have a simple question, would you please help me?

When I create a MPTCP socket, I used "sockfd = socket(AF_INET, SOCK_STREAM, IPPROTO_MPTCP)) == -1" . I have included <linux/in.h> and I am sure that there is the defiene about IPPROTO_MPTCP. But when I compile the code, it still came to not define the IPPROTO_MPTCP. Did I miss other head files? Thank you

matttbe commented 1 year ago

Hi @yuyujunjiang

When I create a MPTCP socket, I used "sockfd = socket(AF_INET, SOCK_STREAM, IPPROTO_MPTCP)) == -1"

Which kernel are you using?

Creating a socket with IPPROTO_MPTCP is what you need to do when using the "Upstream MPTCP kernel", not for this fork here, see: https://github.com/multipath-tcp/mptcp_net-next/wiki#upstream-vs-out-of-tree-implementations

If you use MPTCP with a kernel < v5.6, you are using the fork here and you just need to do sysctl net.mptcp.mptcp_enabled=1 to have all your TCP sockets using MPTCP, see https://multipath-tcp.org/pmwiki.php/Users/ConfigureMPTCP

yuyujunjiang commented 1 year ago

Thanks for your reply! It is very helpful . I am using v4.19.239. Acutually I am a student research MPTCP. In my initial assumption, I can write a mptcp_server.c and a mptcp_client.c to transform data. How can I control the transmission in my code without creating a MPTCP socket. Like how many suflow to connect, how fast the congestion window is and so on. By the way, you have mention the "out of tree" which I am not familiar with. Do you mind give me some advice about this way? What kind tools I can use Thanks you

VenkateswaranJ commented 1 year ago

By the way, you mentioned the "out-of-tree" which I am unfamiliar with. Do you mind giving me some advice about this way? What kind of tools can I use?

Two RFCs exist for MPTCP.

  1. RFC 6824 (Old RFC and also called MPTCP version 0)
  2. RFC 8684 (New RFC and also called MPTCP version 1)

Two mptcp implementations exist.

  1. https://github.com/multipath-tcp/mptcp also called out-of-tree implementation (which implements the RFC 6824 and partial implementation of RFC 8684)
  2. https://github.com/multipath-tcp/mptcp_net-next also called upstream implementation ( only implements RFC 8684)

If you are using kernel version <= 5.4 then use https://github.com/multipath-tcp/mptcp ( This page has all the details on how to install mptcp out-of-tree to your Linux distro) If you are using kernel version >= 5.6 then you don't need to install anything because from 5.6 onwards Mptcp will be shipped with the upstream kernel (This page has information on how to use upstream kernel mptcp )

I can write a mptcp_server.c and a mptcp_client.c to transform data. How can I control the transmission in my code without creating an MPTCP socket?

Once you establish the Mptcp connection between server and client you can control its sublow (add/delete) in two different ways, Either using kernel space path manager (These are pre-defined set of algorithms which adds and remove subflows from the Mptcp connections) or you can use Netlink path manager to create your custom workflow of adding and removing subflows from the Mptcp connection.

I suggest you watch the videos and articles mentioned here that clarify most of your general questions. https://github.com/multipath-tcp/mptcp_net-next/wiki#talks-and-articles

matttbe commented 1 year ago

@VenkateswaranJ thank you for this reply!

I guess we can now close this ticket. Feel free to re-open it if there is still an issue.

PS: with the "upstream kernel" (kernel >= v5.6), you can also force "TCP sockets" to use MPTCP, e.g. https://www.tessares.net/mptcp-proxy-setup-at-home-easier-now/