netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gerrit Renker <gerrit@erg.abdn.ac.uk>
To: davem@davemloft.net
Cc: dccp@vger.kernel.org, netdev@vger.kernel.org,
	Samuel Jero <sj323707@ohio.edu>
Subject: [PATCH 6/7] dccp ccid-2: increment cwnd correctly
Date: Mon, 25 Jul 2011 07:36:35 -0600	[thread overview]
Message-ID: <1311600996-6712-7-git-send-email-gerrit@erg.abdn.ac.uk> (raw)
In-Reply-To: <test_tree_patch_set_update_2011-07-25>

From: Samuel Jero <sj323707@ohio.edu>

This patch fixes an issue where CCID-2 will not increase the congestion
window for numerous RTTs after an idle period, application-limited period,
or a loss once the algorithm is in Congestion Avoidance.

What happens is that, when CCID-2 is in Congestion Avoidance mode, it will
increase hc->tx_packets_acked by one for every packet and will increment cwnd
every cwnd packets. However, if there is now an idle period in the connection,
cwnd will be reduced, possibly below the slow start threshold. This will
cause the connection to go into Slow Start. However, in Slow Start CCID-2
performs this test to increment cwnd every second ack:

	++hc->tx_packets_acked == 2

Unfortunately, this will be incorrect, if cwnd previous to the idle period
was larger than 2 and if tx_packets_acked was close to cwnd. For example:
	cwnd=50  and  tx_packets_acked=45.

In this case, the current code, will increment tx_packets_acked until it
equals two, which will only be once tx_packets_acked (an unsigned 32-bit
integer) overflows.

My fix is simply to change that test for tx_packets_acked greater than or
equal to two in slow start.

Signed-off-by: Samuel Jero <sj323707@ohio.edu>
Acked-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
---
 net/dccp/ccids/ccid2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

--- a/net/dccp/ccids/ccid2.c
+++ b/net/dccp/ccids/ccid2.c
@@ -411,7 +411,7 @@ static void ccid2_new_ack(struct sock *sk, struct ccid2_seq *seqp,
 	if (hc->tx_cwnd < dp->dccps_l_seq_win &&
 	    r_seq_used < dp->dccps_r_seq_win) {
 		if (hc->tx_cwnd < hc->tx_ssthresh) {
-			if (*maxincr > 0 && ++hc->tx_packets_acked == 2) {
+			if (*maxincr > 0 && ++hc->tx_packets_acked >= 2) {
 				hc->tx_cwnd += 1;
 				*maxincr    -= 1;
 				hc->tx_packets_acked = 0;

  parent reply	other threads:[~2011-07-25 13:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <test_tree_patch_set_update_2011-07-25>
2011-07-25 13:36 ` net-next-2.6 [PATCH 0/7] dccp: add support for dynamic parameter updates Gerrit Renker
2011-08-01  7:10   ` David Miller
2011-08-01 14:43     ` Gerrit Renker
2011-08-02  0:37       ` David Miller
2011-07-25 13:36 ` [PATCH 1/7] dccp: support for the exchange of NN options in established state 1/2 Gerrit Renker
2011-07-25 13:36 ` [PATCH 2/7] dccp: support for exchanging of NN options in established state 2/2 Gerrit Renker
2011-07-25 13:36 ` [PATCH 3/7] dccp: send Confirm options only once Gerrit Renker
2011-07-25 13:36 ` [PATCH 4/7] dccp ccid-2: use feature-negotiation to report Ack Ratio changes Gerrit Renker
2011-07-25 13:36 ` [PATCH 5/7] dccp ccid-2: prevent cwnd > Sequence Window Gerrit Renker
2011-07-25 13:36 ` Gerrit Renker [this message]
2011-07-25 13:36 ` [PATCH 7/7] dccp ccid-2: check Ack Ratio when reducing cwnd Gerrit Renker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1311600996-6712-7-git-send-email-gerrit@erg.abdn.ac.uk \
    --to=gerrit@erg.abdn.ac.uk \
    --cc=davem@davemloft.net \
    --cc=dccp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sj323707@ohio.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).