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