18c2ecf20Sopenharmony_ci.. SPDX-License-Identifier: GPL-2.0 28c2ecf20Sopenharmony_ci 38c2ecf20Sopenharmony_ci==================== 48c2ecf20Sopenharmony_ciThin-streams and TCP 58c2ecf20Sopenharmony_ci==================== 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ciA wide range of Internet-based services that use reliable transport 88c2ecf20Sopenharmony_ciprotocols display what we call thin-stream properties. This means 98c2ecf20Sopenharmony_cithat the application sends data with such a low rate that the 108c2ecf20Sopenharmony_ciretransmission mechanisms of the transport protocol are not fully 118c2ecf20Sopenharmony_cieffective. In time-dependent scenarios (like online games, control 128c2ecf20Sopenharmony_cisystems, stock trading etc.) where the user experience depends 138c2ecf20Sopenharmony_cion the data delivery latency, packet loss can be devastating for 148c2ecf20Sopenharmony_cithe service quality. Extreme latencies are caused by TCP's 158c2ecf20Sopenharmony_cidependency on the arrival of new data from the application to trigger 168c2ecf20Sopenharmony_ciretransmissions effectively through fast retransmit instead of 178c2ecf20Sopenharmony_ciwaiting for long timeouts. 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_ciAfter analysing a large number of time-dependent interactive 208c2ecf20Sopenharmony_ciapplications, we have seen that they often produce thin streams 218c2ecf20Sopenharmony_ciand also stay with this traffic pattern throughout its entire 228c2ecf20Sopenharmony_cilifespan. The combination of time-dependency and the fact that the 238c2ecf20Sopenharmony_cistreams provoke high latencies when using TCP is unfortunate. 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ciIn order to reduce application-layer latency when packets are lost, 268c2ecf20Sopenharmony_cia set of mechanisms has been made, which address these latency issues 278c2ecf20Sopenharmony_cifor thin streams. In short, if the kernel detects a thin stream, 288c2ecf20Sopenharmony_cithe retransmission mechanisms are modified in the following manner: 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci1) If the stream is thin, fast retransmit on the first dupACK. 318c2ecf20Sopenharmony_ci2) If the stream is thin, do not apply exponential backoff. 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ciThese enhancements are applied only if the stream is detected as 348c2ecf20Sopenharmony_cithin. This is accomplished by defining a threshold for the number 358c2ecf20Sopenharmony_ciof packets in flight. If there are less than 4 packets in flight, 368c2ecf20Sopenharmony_cifast retransmissions can not be triggered, and the stream is prone 378c2ecf20Sopenharmony_cito experience high retransmission latencies. 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ciSince these mechanisms are targeted at time-dependent applications, 408c2ecf20Sopenharmony_cithey must be specifically activated by the application using the 418c2ecf20Sopenharmony_ciTCP_THIN_LINEAR_TIMEOUTS and TCP_THIN_DUPACK IOCTLS or the 428c2ecf20Sopenharmony_citcp_thin_linear_timeouts and tcp_thin_dupack sysctls. Both 438c2ecf20Sopenharmony_cimodifications are turned off by default. 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ciReferences 468c2ecf20Sopenharmony_ci========== 478c2ecf20Sopenharmony_ciMore information on the modifications, as well as a wide range of 488c2ecf20Sopenharmony_ciexperimental data can be found here: 498c2ecf20Sopenharmony_ci 508c2ecf20Sopenharmony_ci"Improving latency for interactive, thin-stream applications over 518c2ecf20Sopenharmony_cireliable transport" 528c2ecf20Sopenharmony_cihttp://simula.no/research/nd/publications/Simula.nd.477/simula_pdf_file 53