diff options
author | Yuchung Cheng <ycheng@google.com> | 2012-05-02 09:30:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-02 20:56:10 -0400 |
commit | eed530b6c67624db3f2cf477bac7c4d005d8f7ba (patch) | |
tree | c07096807ead2adb9d85e85d1a9cd1ada85755ac /include/net/tcp.h | |
parent | 1fbc340514fc3003514bd681b372e1f47ae6183f (diff) |
tcp: early retransmit
This patch implements RFC 5827 early retransmit (ER) for TCP.
It reduces DUPACK threshold (dupthresh) if outstanding packets are
less than 4 to recover losses by fast recovery instead of timeout.
While the algorithm is simple, small but frequent network reordering
makes this feature dangerous: the connection repeatedly enter
false recovery and degrade performance. Therefore we implement
a mitigation suggested in the appendix of the RFC that delays
entering fast recovery by a small interval, i.e., RTT/4. Currently
ER is conservative and is disabled for the rest of the connection
after the first reordering event. A large scale web server
experiment on the performance impact of ER is summarized in
section 6 of the paper "Proportional Rate Reduction for TCP”,
IMC 2011. http://conferences.sigcomm.org/imc/2011/docs/p155.pdf
Note that Linux has a similar feature called THIN_DUPACK. The
differences are THIN_DUPACK do not mitigate reorderings and is only
used after slow start. Currently ER is disabled if THIN_DUPACK is
enabled. I would be happy to merge THIN_DUPACK feature with ER if
people think it's a good idea.
ER is enabled by sysctl_tcp_early_retrans:
0: Disables ER
1: Reduce dupthresh to packets_out - 1 when outstanding packets < 4.
2: (Default) reduce dupthresh like mode 1. In addition, delay
entering fast recovery by RTT/4.
Note: mode 2 is implemented in the third part of this patch series.
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r-- | include/net/tcp.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index 0fb84de6da36..685437a16c97 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -252,6 +252,7 @@ extern int sysctl_tcp_max_ssthresh; | |||
252 | extern int sysctl_tcp_cookie_size; | 252 | extern int sysctl_tcp_cookie_size; |
253 | extern int sysctl_tcp_thin_linear_timeouts; | 253 | extern int sysctl_tcp_thin_linear_timeouts; |
254 | extern int sysctl_tcp_thin_dupack; | 254 | extern int sysctl_tcp_thin_dupack; |
255 | extern int sysctl_tcp_early_retrans; | ||
255 | 256 | ||
256 | extern atomic_long_t tcp_memory_allocated; | 257 | extern atomic_long_t tcp_memory_allocated; |
257 | extern struct percpu_counter tcp_sockets_allocated; | 258 | extern struct percpu_counter tcp_sockets_allocated; |
@@ -797,6 +798,20 @@ static inline void tcp_enable_fack(struct tcp_sock *tp) | |||
797 | tp->rx_opt.sack_ok |= TCP_FACK_ENABLED; | 798 | tp->rx_opt.sack_ok |= TCP_FACK_ENABLED; |
798 | } | 799 | } |
799 | 800 | ||
801 | /* TCP early-retransmit (ER) is similar to but more conservative than | ||
802 | * the thin-dupack feature. Enable ER only if thin-dupack is disabled. | ||
803 | */ | ||
804 | static inline void tcp_enable_early_retrans(struct tcp_sock *tp) | ||
805 | { | ||
806 | tp->do_early_retrans = sysctl_tcp_early_retrans && | ||
807 | !sysctl_tcp_thin_dupack && sysctl_tcp_reordering == 3; | ||
808 | } | ||
809 | |||
810 | static inline void tcp_disable_early_retrans(struct tcp_sock *tp) | ||
811 | { | ||
812 | tp->do_early_retrans = 0; | ||
813 | } | ||
814 | |||
800 | static inline unsigned int tcp_left_out(const struct tcp_sock *tp) | 815 | static inline unsigned int tcp_left_out(const struct tcp_sock *tp) |
801 | { | 816 | { |
802 | return tp->sacked_out + tp->lost_out; | 817 | return tp->sacked_out + tp->lost_out; |