MPTCP Fast Open in linux kernel

This set of patches will bring “Fast Open” Option support to MPTCP in linux kernel. The aim of Fast Open Mechanism is to eliminate one round trip time from a MPTCP conversation by allowing data to be included as part of the SYN segment that initiates the connection.

IETF RFC 8684: Appendix B. TCP Fast Open and MPTCP. IETF RFC LINK

Versions and their details are presented below:

_PATCH v2_ includes client-server partial support + more impact on existing TCP and MPTCP code. (Expand me)

1. MPTCP cookie request from client.
2. MPTCP cookie offering from server.
3. MPTCP SYN+DATA+COOKIE from client.
4. subsequent write + read on the opened socket.

This patch is Work In Progress and an early draft.

The patch is build against 5.16.0-rc8 net-next.

The patch is located in the next mailing list: https://patchew.org/MPTCP/[email protected]/

The pcap dump:

_PATCH v4_ client-server partial support + less impact on existing TCP and MPTCP code. (Expand me)

The differences between previous versions and v4:
1. An attempt to reduce impact on existing TCP code.
2. 2 files related to mptcp_fastopen are created(*.h + *.c).
3. “subflow_v4_conn_request” is used to call “mptcp_conn_request”(located in “mptcp_fastopen.c”) to process the received packet on the listener side when “SYN” is received during 3way handshake.
4. This chain adds “skb” to “&msk->sk_receive_queue” (“subflow_v4_conn_request”->”mptcp_conn_request”->”mptcp_try_fastopen”->”mptcp_fastopen_create_child”->”mptcp_fastopen_add_skb”)
5. Some minor comments from mailing list are not yet included in the current version of the PATCH.

The patch is located in the next mailing list: https://lore.kernel.org/mptcp/[email protected]/

You can download a TCPDUMP pcap from this link: Download tcpdump pcap

Thoughts on RST issue:
With gdb I got a backtrace for “tcp_send_active_reset”:

We can see here that it executed from “subflow_check_data_avail” (“/net/mptcp/subflow.c”)

We now check the “subflow_check_data_avail” line 1260 and in code snippet#2 see that it is located in the fallback “section” that leads us to possible lines, that lead us in code snippet#1 -> MAPPING_INVALID or MUPPING_DUMMY.

Further investigation of MAPPING INVALID seems to lead us to line 1081 of code snippet #3.

Backtrace:

code snippet#1

code snippet#2

code snippet #3

Userspace programs:

Server specifics:
Create socket for listening in C with IPPROTO_MPTCP:

Set socket option “TCP_FASTOPEN” implemented by the patch.

Client specifics:
Set IPPROTO_MPTCP with MSG_FASTOPEN option on the client side.