aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Petlund <apetlund@simula.no>2010-02-17 21:45:45 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-18 18:43:07 -0500
commit5aa4b32fc86408705337e941ed716880c63d1590 (patch)
tree7385d30e16f2c7203a74a3723728b7e8c6ecfa7b
parent16cad981863344ef779ab703545bb6f261a0f0ce (diff)
net: TCP thin-stream detection
Inline function to dynamically detect thin streams based on the number of packets in flight. Used to dynamically trigger thin-stream mechanisms if enabled by ioctl or sysctl. Signed-off-by: Andreas Petlund <apetlund@simula.no> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--Documentation/networking/tcp-thin.txt47
-rw-r--r--include/net/tcp.h8
2 files changed, 55 insertions, 0 deletions
diff --git a/Documentation/networking/tcp-thin.txt b/Documentation/networking/tcp-thin.txt
new file mode 100644
index 000000000000..151e229980f1
--- /dev/null
+++ b/Documentation/networking/tcp-thin.txt
@@ -0,0 +1,47 @@
1Thin-streams and TCP
2====================
3A wide range of Internet-based services that use reliable transport
4protocols display what we call thin-stream properties. This means
5that the application sends data with such a low rate that the
6retransmission mechanisms of the transport protocol are not fully
7effective. In time-dependent scenarios (like online games, control
8systems, stock trading etc.) where the user experience depends
9on the data delivery latency, packet loss can be devastating for
10the service quality. Extreme latencies are caused by TCP's
11dependency on the arrival of new data from the application to trigger
12retransmissions effectively through fast retransmit instead of
13waiting for long timeouts.
14
15After analysing a large number of time-dependent interactive
16applications, we have seen that they often produce thin streams
17and also stay with this traffic pattern throughout its entire
18lifespan. The combination of time-dependency and the fact that the
19streams provoke high latencies when using TCP is unfortunate.
20
21In order to reduce application-layer latency when packets are lost,
22a set of mechanisms has been made, which address these latency issues
23for thin streams. In short, if the kernel detects a thin stream,
24the retransmission mechanisms are modified in the following manner:
25
261) If the stream is thin, fast retransmit on the first dupACK.
272) If the stream is thin, do not apply exponential backoff.
28
29These enhancements are applied only if the stream is detected as
30thin. This is accomplished by defining a threshold for the number
31of packets in flight. If there are less than 4 packets in flight,
32fast retransmissions can not be triggered, and the stream is prone
33to experience high retransmission latencies.
34
35Since these mechanisms are targeted at time-dependent applications,
36they must be specifically activated by the application using the
37TCP_THIN_LINEAR_TIMEOUTS and TCP_THIN_DUPACK IOCTLS or the
38tcp_thin_linear_timeouts and tcp_thin_dupack sysctls. Both
39modifications are turned off by default.
40
41References
42==========
43More information on the modifications, as well as a wide range of
44experimental data can be found here:
45"Improving latency for interactive, thin-stream applications over
46reliable transport"
47http://simula.no/research/nd/publications/Simula.nd.477/simula_pdf_file
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 75a00c80bdda..0bdc3f640247 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1386,6 +1386,14 @@ static inline void tcp_highest_sack_combine(struct sock *sk,
1386 tcp_sk(sk)->highest_sack = new; 1386 tcp_sk(sk)->highest_sack = new;
1387} 1387}
1388 1388
1389/* Determines whether this is a thin stream (which may suffer from
1390 * increased latency). Used to trigger latency-reducing mechanisms.
1391 */
1392static inline unsigned int tcp_stream_is_thin(struct tcp_sock *tp)
1393{
1394 return tp->packets_out < 4 && !tcp_in_initial_slowstart(tp);
1395}
1396
1389/* /proc */ 1397/* /proc */
1390enum tcp_seq_states { 1398enum tcp_seq_states {
1391 TCP_SEQ_STATE_LISTENING, 1399 TCP_SEQ_STATE_LISTENING,