$linuxjunkies
>

TCP_FASTOPEN

also: TFO, Fast Open

TCP_FASTOPEN is a Linux kernel feature that allows applications to send data during the TCP connection handshake, reducing latency by eliminating one full round-trip time (RTT) from connection establishment.

TCP_FASTOPEN (TFO) is an optimization that bypasses part of the standard three-way TCP handshake. Instead of waiting for the handshake to complete before sending application data, a client can include data in the initial SYN packet if it has a valid TFO cookie from a previous connection to that server.

The server stores a cryptographic cookie on the client during the first connection. On subsequent connections, the client includes this cookie in the SYN packet along with initial data. The server validates the cookie and can begin processing the application data immediately, rather than waiting for the final ACK of the handshake.

Example: A web browser connecting to a frequently-visited site can include the HTTP request in the SYN packet, reducing connection time by ~25-40%. This is enabled per-socket using the TCP_FASTOPEN socket option or globally via /proc/sys/net/ipv4/tcp_fastopen.

Related terms