aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_output.c
diff options
context:
space:
mode:
authorNandita Dukkipati <nanditad@google.com>2011-08-21 16:21:57 -0400
committerDavid S. Miller <davem@davemloft.net>2011-08-24 22:40:40 -0400
commita262f0cdf1f2916ea918dc329492abb5323d9a6c (patch)
tree976cd31c3ea365f5810a154a1c77c75fb299c5fe /net/ipv4/tcp_output.c
parentf6fb8f100b807378fda19e83e5ac6828b638603a (diff)
Proportional Rate Reduction for TCP.
This patch implements Proportional Rate Reduction (PRR) for TCP. PRR is an algorithm that determines TCP's sending rate in fast recovery. PRR avoids excessive window reductions and aims for the actual congestion window size at the end of recovery to be as close as possible to the window determined by the congestion control algorithm. PRR also improves accuracy of the amount of data sent during loss recovery. The patch implements the recommended flavor of PRR called PRR-SSRB (Proportional rate reduction with slow start reduction bound) and replaces the existing rate halving algorithm. PRR improves upon the existing Linux fast recovery under a number of conditions including: 1) burst losses where the losses implicitly reduce the amount of outstanding data (pipe) below the ssthresh value selected by the congestion control algorithm and, 2) losses near the end of short flows where application runs out of data to send. As an example, with the existing rate halving implementation a single loss event can cause a connection carrying short Web transactions to go into the slow start mode after the recovery. This is because during recovery Linux pulls the congestion window down to packets_in_flight+1 on every ACK. A short Web response often runs out of new data to send and its pipe reduces to zero by the end of recovery when all its packets are drained from the network. Subsequent HTTP responses using the same connection will have to slow start to raise cwnd to ssthresh. PRR on the other hand aims for the cwnd to be as close as possible to ssthresh by the end of recovery. A description of PRR and a discussion of its performance can be found at the following links: - IETF Draft: http://tools.ietf.org/html/draft-mathis-tcpm-proportional-rate-reduction-01 - IETF Slides: http://www.ietf.org/proceedings/80/slides/tcpm-6.pdf http://tools.ietf.org/agenda/81/slides/tcpm-2.pdf - Paper to appear in Internet Measurements Conference (IMC) 2011: Improving TCP Loss Recovery Nandita Dukkipati, Matt Mathis, Yuchung Cheng Signed-off-by: Nandita Dukkipati <nanditad@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r--net/ipv4/tcp_output.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 0377c061f22f..081dcd6fd0c4 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1796,11 +1796,13 @@ static int tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,
1796 tcp_event_new_data_sent(sk, skb); 1796 tcp_event_new_data_sent(sk, skb);
1797 1797
1798 tcp_minshall_update(tp, mss_now, skb); 1798 tcp_minshall_update(tp, mss_now, skb);
1799 sent_pkts++; 1799 sent_pkts += tcp_skb_pcount(skb);
1800 1800
1801 if (push_one) 1801 if (push_one)
1802 break; 1802 break;
1803 } 1803 }
1804 if (inet_csk(sk)->icsk_ca_state == TCP_CA_Recovery)
1805 tp->prr_out += sent_pkts;
1804 1806
1805 if (likely(sent_pkts)) { 1807 if (likely(sent_pkts)) {
1806 tcp_cwnd_validate(sk); 1808 tcp_cwnd_validate(sk);
@@ -2294,6 +2296,9 @@ begin_fwd:
2294 return; 2296 return;
2295 NET_INC_STATS_BH(sock_net(sk), mib_idx); 2297 NET_INC_STATS_BH(sock_net(sk), mib_idx);
2296 2298
2299 if (inet_csk(sk)->icsk_ca_state == TCP_CA_Recovery)
2300 tp->prr_out += tcp_skb_pcount(skb);
2301
2297 if (skb == tcp_write_queue_head(sk)) 2302 if (skb == tcp_write_queue_head(sk))
2298 inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, 2303 inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS,
2299 inet_csk(sk)->icsk_rto, 2304 inet_csk(sk)->icsk_rto,