162306a36Sopenharmony_ci.. SPDX-License-Identifier: GPL-2.0 262306a36Sopenharmony_ci 362306a36Sopenharmony_ci==================== 462306a36Sopenharmony_ciThin-streams and TCP 562306a36Sopenharmony_ci==================== 662306a36Sopenharmony_ci 762306a36Sopenharmony_ciA wide range of Internet-based services that use reliable transport 862306a36Sopenharmony_ciprotocols display what we call thin-stream properties. This means 962306a36Sopenharmony_cithat the application sends data with such a low rate that the 1062306a36Sopenharmony_ciretransmission mechanisms of the transport protocol are not fully 1162306a36Sopenharmony_cieffective. In time-dependent scenarios (like online games, control 1262306a36Sopenharmony_cisystems, stock trading etc.) where the user experience depends 1362306a36Sopenharmony_cion the data delivery latency, packet loss can be devastating for 1462306a36Sopenharmony_cithe service quality. Extreme latencies are caused by TCP's 1562306a36Sopenharmony_cidependency on the arrival of new data from the application to trigger 1662306a36Sopenharmony_ciretransmissions effectively through fast retransmit instead of 1762306a36Sopenharmony_ciwaiting for long timeouts. 1862306a36Sopenharmony_ci 1962306a36Sopenharmony_ciAfter analysing a large number of time-dependent interactive 2062306a36Sopenharmony_ciapplications, we have seen that they often produce thin streams 2162306a36Sopenharmony_ciand also stay with this traffic pattern throughout its entire 2262306a36Sopenharmony_cilifespan. The combination of time-dependency and the fact that the 2362306a36Sopenharmony_cistreams provoke high latencies when using TCP is unfortunate. 2462306a36Sopenharmony_ci 2562306a36Sopenharmony_ciIn order to reduce application-layer latency when packets are lost, 2662306a36Sopenharmony_cia set of mechanisms has been made, which address these latency issues 2762306a36Sopenharmony_cifor thin streams. In short, if the kernel detects a thin stream, 2862306a36Sopenharmony_cithe retransmission mechanisms are modified in the following manner: 2962306a36Sopenharmony_ci 3062306a36Sopenharmony_ci1) If the stream is thin, fast retransmit on the first dupACK. 3162306a36Sopenharmony_ci2) If the stream is thin, do not apply exponential backoff. 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_ciThese enhancements are applied only if the stream is detected as 3462306a36Sopenharmony_cithin. This is accomplished by defining a threshold for the number 3562306a36Sopenharmony_ciof packets in flight. If there are less than 4 packets in flight, 3662306a36Sopenharmony_cifast retransmissions can not be triggered, and the stream is prone 3762306a36Sopenharmony_cito experience high retransmission latencies. 3862306a36Sopenharmony_ci 3962306a36Sopenharmony_ciSince these mechanisms are targeted at time-dependent applications, 4062306a36Sopenharmony_cithey must be specifically activated by the application using the 4162306a36Sopenharmony_ciTCP_THIN_LINEAR_TIMEOUTS and TCP_THIN_DUPACK IOCTLS or the 4262306a36Sopenharmony_citcp_thin_linear_timeouts and tcp_thin_dupack sysctls. Both 4362306a36Sopenharmony_cimodifications are turned off by default. 4462306a36Sopenharmony_ci 4562306a36Sopenharmony_ciReferences 4662306a36Sopenharmony_ci========== 4762306a36Sopenharmony_ciMore information on the modifications, as well as a wide range of 4862306a36Sopenharmony_ciexperimental data can be found here: 4962306a36Sopenharmony_ci 5062306a36Sopenharmony_ci"Improving latency for interactive, thin-stream applications over 5162306a36Sopenharmony_cireliable transport" 5262306a36Sopenharmony_cihttp://simula.no/research/nd/publications/Simula.nd.477/simula_pdf_file 53