History

tcp: add TCP_INFO status for failed client TFO

The TCPI_OPT_SYN_DATA bit as part of tcpi_options currently reports whether or not data-in-SYN was ack'd on both the client and server side. We'd like to gather more information on the client-side in the failure case in order to indicate the reason for the failure. This can be useful for not only debugging TFO, but also for creating TFO socket policies. For example, if a middle box removes the TFO option or drops a data-in-SYN, we can can detect this case, and turn off TFO for these connections saving the extra retransmits. The newly added tcpi_fastopen_client_fail status is 2 bits and has the following 4 states: 1) TFO_STATUS_UNSPEC Catch-all state which includes when TFO is disabled via black hole detection, which is indicated via LINUX_MIB_TCPFASTOPENBLACKHOLE. 2) TFO_COOKIE_UNAVAILABLE If TFO_CLIENT_NO_COOKIE mode is off, this state indicates that no cookie is available in the cache. 3) TFO_DATA_NOT_ACKED Data was sent with SYN, we received a SYN/ACK but it did not cover the data portion. Cookie is not accepted by server because the cookie may be invalid or the server may be overloaded. 4) TFO_SYN_RETRANSMITTED Data was sent with SYN, we received a SYN/ACK which did not cover the data after at least 1 additional SYN was sent (without data). It may be the case that a middle-box is dropping data-in-SYN packets. Thus, it would be more efficient to not use TFO on this connection to avoid extra retransmits during connection establishment. These new fields do not cover all the cases where TFO may fail, but other failures, such as SYN/ACK + data being dropped, will result in the connection not becoming established. And a connection blackhole after session establishment shows up as a stalled connection.

Jason Baron committed 7 years ago

Commit 48027471 parent 79f20565 files · +20 −3Browse files

Showing the changes to include/uapi/linux (1 of 5 files). Show all

Unified · Split

include/uapi/linux/tcp.h+9−1
@@ -155,6 +155,14 @@ enum { · 154 unmodified lines
155155 TCP_QUEUES_NR,
156156 };
157157
158+/* why fastopen failed from client perspective */
159+enum tcp_fastopen_client_fail {
160+ TFO_STATUS_UNSPEC, /* catch-all */
161+ TFO_COOKIE_UNAVAILABLE, /* if not in TFO_CLIENT_NO_COOKIE mode */
162+ TFO_DATA_NOT_ACKED, /* SYN-ACK did not ack SYN data */
163+ TFO_SYN_RETRANSMITTED, /* SYN-ACK did not ack SYN data after timeout */
164+};
165+
158166 /* for TCP_INFO socket option */
159167 #define TCPI_OPT_TIMESTAMPS 1
160168 #define TCPI_OPT_SACK 2
@@ -211,7 +219,7 @@ struct tcp_info { · 50 unmodified lines
211219 __u8 tcpi_backoff;
212220 __u8 tcpi_options;
213221 __u8 tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
214− __u8 tcpi_delivery_rate_app_limited:1;
222+ __u8 tcpi_delivery_rate_app_limited:1, tcpi_fastopen_client_fail:2;
215223
216224 __u32 tcpi_rto;
217225 __u32 tcpi_ato;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t