xref: /openbmc/linux/Documentation/networking/tcp-thin.rst (revision 4b4193256c8d3bc3a5397b5cd9494c2ad386317d)
1*ff159f4fSMauro Carvalho Chehab.. SPDX-License-Identifier: GPL-2.0
2*ff159f4fSMauro Carvalho Chehab
3*ff159f4fSMauro Carvalho Chehab====================
4*ff159f4fSMauro Carvalho ChehabThin-streams and TCP
5*ff159f4fSMauro Carvalho Chehab====================
6*ff159f4fSMauro Carvalho Chehab
7*ff159f4fSMauro Carvalho ChehabA wide range of Internet-based services that use reliable transport
8*ff159f4fSMauro Carvalho Chehabprotocols display what we call thin-stream properties. This means
9*ff159f4fSMauro Carvalho Chehabthat the application sends data with such a low rate that the
10*ff159f4fSMauro Carvalho Chehabretransmission mechanisms of the transport protocol are not fully
11*ff159f4fSMauro Carvalho Chehabeffective. In time-dependent scenarios (like online games, control
12*ff159f4fSMauro Carvalho Chehabsystems, stock trading etc.) where the user experience depends
13*ff159f4fSMauro Carvalho Chehabon the data delivery latency, packet loss can be devastating for
14*ff159f4fSMauro Carvalho Chehabthe service quality. Extreme latencies are caused by TCP's
15*ff159f4fSMauro Carvalho Chehabdependency on the arrival of new data from the application to trigger
16*ff159f4fSMauro Carvalho Chehabretransmissions effectively through fast retransmit instead of
17*ff159f4fSMauro Carvalho Chehabwaiting for long timeouts.
18*ff159f4fSMauro Carvalho Chehab
19*ff159f4fSMauro Carvalho ChehabAfter analysing a large number of time-dependent interactive
20*ff159f4fSMauro Carvalho Chehabapplications, we have seen that they often produce thin streams
21*ff159f4fSMauro Carvalho Chehaband also stay with this traffic pattern throughout its entire
22*ff159f4fSMauro Carvalho Chehablifespan. The combination of time-dependency and the fact that the
23*ff159f4fSMauro Carvalho Chehabstreams provoke high latencies when using TCP is unfortunate.
24*ff159f4fSMauro Carvalho Chehab
25*ff159f4fSMauro Carvalho ChehabIn order to reduce application-layer latency when packets are lost,
26*ff159f4fSMauro Carvalho Chehaba set of mechanisms has been made, which address these latency issues
27*ff159f4fSMauro Carvalho Chehabfor thin streams. In short, if the kernel detects a thin stream,
28*ff159f4fSMauro Carvalho Chehabthe retransmission mechanisms are modified in the following manner:
29*ff159f4fSMauro Carvalho Chehab
30*ff159f4fSMauro Carvalho Chehab1) If the stream is thin, fast retransmit on the first dupACK.
31*ff159f4fSMauro Carvalho Chehab2) If the stream is thin, do not apply exponential backoff.
32*ff159f4fSMauro Carvalho Chehab
33*ff159f4fSMauro Carvalho ChehabThese enhancements are applied only if the stream is detected as
34*ff159f4fSMauro Carvalho Chehabthin. This is accomplished by defining a threshold for the number
35*ff159f4fSMauro Carvalho Chehabof packets in flight. If there are less than 4 packets in flight,
36*ff159f4fSMauro Carvalho Chehabfast retransmissions can not be triggered, and the stream is prone
37*ff159f4fSMauro Carvalho Chehabto experience high retransmission latencies.
38*ff159f4fSMauro Carvalho Chehab
39*ff159f4fSMauro Carvalho ChehabSince these mechanisms are targeted at time-dependent applications,
40*ff159f4fSMauro Carvalho Chehabthey must be specifically activated by the application using the
41*ff159f4fSMauro Carvalho ChehabTCP_THIN_LINEAR_TIMEOUTS and TCP_THIN_DUPACK IOCTLS or the
42*ff159f4fSMauro Carvalho Chehabtcp_thin_linear_timeouts and tcp_thin_dupack sysctls. Both
43*ff159f4fSMauro Carvalho Chehabmodifications are turned off by default.
44*ff159f4fSMauro Carvalho Chehab
45*ff159f4fSMauro Carvalho ChehabReferences
46*ff159f4fSMauro Carvalho Chehab==========
47*ff159f4fSMauro Carvalho ChehabMore information on the modifications, as well as a wide range of
48*ff159f4fSMauro Carvalho Chehabexperimental data can be found here:
49*ff159f4fSMauro Carvalho Chehab
50*ff159f4fSMauro Carvalho Chehab"Improving latency for interactive, thin-stream applications over
51*ff159f4fSMauro Carvalho Chehabreliable transport"
52*ff159f4fSMauro Carvalho Chehabhttp://simula.no/research/nd/publications/Simula.nd.477/simula_pdf_file
53