xref: /OK3568_Linux_fs/kernel/Documentation/networking/tcp-thin.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun.. SPDX-License-Identifier: GPL-2.0
2*4882a593Smuzhiyun
3*4882a593Smuzhiyun====================
4*4882a593SmuzhiyunThin-streams and TCP
5*4882a593Smuzhiyun====================
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunA wide range of Internet-based services that use reliable transport
8*4882a593Smuzhiyunprotocols display what we call thin-stream properties. This means
9*4882a593Smuzhiyunthat the application sends data with such a low rate that the
10*4882a593Smuzhiyunretransmission mechanisms of the transport protocol are not fully
11*4882a593Smuzhiyuneffective. In time-dependent scenarios (like online games, control
12*4882a593Smuzhiyunsystems, stock trading etc.) where the user experience depends
13*4882a593Smuzhiyunon the data delivery latency, packet loss can be devastating for
14*4882a593Smuzhiyunthe service quality. Extreme latencies are caused by TCP's
15*4882a593Smuzhiyundependency on the arrival of new data from the application to trigger
16*4882a593Smuzhiyunretransmissions effectively through fast retransmit instead of
17*4882a593Smuzhiyunwaiting for long timeouts.
18*4882a593Smuzhiyun
19*4882a593SmuzhiyunAfter analysing a large number of time-dependent interactive
20*4882a593Smuzhiyunapplications, we have seen that they often produce thin streams
21*4882a593Smuzhiyunand also stay with this traffic pattern throughout its entire
22*4882a593Smuzhiyunlifespan. The combination of time-dependency and the fact that the
23*4882a593Smuzhiyunstreams provoke high latencies when using TCP is unfortunate.
24*4882a593Smuzhiyun
25*4882a593SmuzhiyunIn order to reduce application-layer latency when packets are lost,
26*4882a593Smuzhiyuna set of mechanisms has been made, which address these latency issues
27*4882a593Smuzhiyunfor thin streams. In short, if the kernel detects a thin stream,
28*4882a593Smuzhiyunthe retransmission mechanisms are modified in the following manner:
29*4882a593Smuzhiyun
30*4882a593Smuzhiyun1) If the stream is thin, fast retransmit on the first dupACK.
31*4882a593Smuzhiyun2) If the stream is thin, do not apply exponential backoff.
32*4882a593Smuzhiyun
33*4882a593SmuzhiyunThese enhancements are applied only if the stream is detected as
34*4882a593Smuzhiyunthin. This is accomplished by defining a threshold for the number
35*4882a593Smuzhiyunof packets in flight. If there are less than 4 packets in flight,
36*4882a593Smuzhiyunfast retransmissions can not be triggered, and the stream is prone
37*4882a593Smuzhiyunto experience high retransmission latencies.
38*4882a593Smuzhiyun
39*4882a593SmuzhiyunSince these mechanisms are targeted at time-dependent applications,
40*4882a593Smuzhiyunthey must be specifically activated by the application using the
41*4882a593SmuzhiyunTCP_THIN_LINEAR_TIMEOUTS and TCP_THIN_DUPACK IOCTLS or the
42*4882a593Smuzhiyuntcp_thin_linear_timeouts and tcp_thin_dupack sysctls. Both
43*4882a593Smuzhiyunmodifications are turned off by default.
44*4882a593Smuzhiyun
45*4882a593SmuzhiyunReferences
46*4882a593Smuzhiyun==========
47*4882a593SmuzhiyunMore information on the modifications, as well as a wide range of
48*4882a593Smuzhiyunexperimental data can be found here:
49*4882a593Smuzhiyun
50*4882a593Smuzhiyun"Improving latency for interactive, thin-stream applications over
51*4882a593Smuzhiyunreliable transport"
52*4882a593Smuzhiyunhttp://simula.no/research/nd/publications/Simula.nd.477/simula_pdf_file
53