From: Samuel Jero <sj323707@ohio.edu>
To: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Cc: <dccp@vger.kernel.org>, <netdev@vger.kernel.org>
Subject: Re: dccp test-tree [RFC] [Patch 2/2] dccp: CCID2 check ack ratio when reducing cwnd
Date: Tue, 15 Mar 2011 00:53:17 -0400 [thread overview]
Message-ID: <1300164797.20638.65.camel@jero-laptop> (raw)
In-Reply-To: <20110311113042.GB4876@gerrit.erg.abdn.ac.uk>
[-- Attachment #1: Type: text/plain, Size: 2541 bytes --]
This patch causes CCID2 to check the ack ratio after reducing the
congestion window. If the ack ratio is greater than the congestion
window, it is reduced. This prevents timeouts caused by an ack ratio
larger than the congestion window.
In this situation, we choose to set the ack ratio to half the congestion
window (or one if that's zero) so that if we loose one ack we don't
trigger a timeout.
---
Signed-off-by: Samuel Jero
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c
index 1475ba3..b7f7dbd 100644
--- a/net/dccp/ccids/ccid2.c
+++ b/net/dccp/ccids/ccid2.c
@@ -118,4 +118,22 @@ static void ccid2_change_l_seq_window(struct sock *sk, u64 val)
dccp_feat_signal_nn_change(sk, DCCPF_SEQUENCE_WINDOW, val);
}
+
+static void ccid2_check_l_ack_ratio(struct sock *sk)
+{
+ struct ccid2_hc_tx_sock *hc = ccid2_hc_tx_sk(sk);
+
+ /*
+ * After a loss, idle period, application limited period, or RTO we
+ * need tocheck that the ack ratio is still less than the congestion
+ * window. Otherwise, we will send an entire congestion window of
+ * packets and got no response because we haven't sent ack ratio
+ * packets yet.
+ * If the ack ratio does need to be reduced, we reduce it to half of
+ * the congestion window (or 1 if that's zero) instead of to the
+ * congestion window. This prevents problems if one ack is lost.
+ */
+ if (dccp_feat_get_nn_next_val(sk, DCCPF_ACK_RATIO) > hc->tx_cwnd)
+ ccid2_change_l_ack_ratio(sk, hc->tx_cwnd/2 ? : 1U);
+}
static void ccid2_hc_tx_rto_expire(unsigned long data)
@@ -203,6 +214,8 @@ static void ccid2_cwnd_application_limited(struct sock *sk, const u32 now)
}
hc->tx_cwnd_used = 0;
hc->tx_cwnd_stamp = now;
+
+ ccid2_check_l_ack_ratio(sk);
}
/* This borrows the code of tcp_cwnd_restart() */
@@ -221,6 +234,8 @@ static void ccid2_cwnd_restart(struct sock *sk, const u32 now)
hc->tx_cwnd_stamp = now;
hc->tx_cwnd_used = 0;
+
+ ccid2_check_l_ack_ratio(sk);
}
static void ccid2_hc_tx_packet_sent(struct sock *sk, unsigned int len)
@@ -490,9 +505,7 @@ static void ccid2_congestion_event(struct sock *sk, struct ccid2_seq *seqp)
hc->tx_cwnd = hc->tx_cwnd / 2 ? : 1U;
hc->tx_ssthresh = max(hc->tx_cwnd, 2U);
- /* Avoid spurious timeouts resulting from Ack Ratio > cwnd */
- if (dccp_sk(sk)->dccps_l_ack_ratio > hc->tx_cwnd)
- ccid2_change_l_ack_ratio(sk, hc->tx_cwnd);
+ ccid2_check_l_ack_ratio(sk);
}
static int ccid2_hc_tx_parse_options(struct sock *sk, u8 packet_type,
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2011-03-15 4:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-28 11:25 dccp test-tree [RFC] [Patch 1/1] dccp: Only activate NN values after receiving the Confirm option Gerrit Renker
2011-03-08 4:50 ` Samuel Jero
2011-03-11 11:30 ` Gerrit Renker
2011-03-13 20:34 ` Samuel Jero
2011-03-14 11:55 ` Gerrit Renker
2011-03-15 4:53 ` Samuel Jero
2011-03-18 11:30 ` Gerrit Renker
2011-03-22 1:49 ` Samuel Jero
2011-03-25 11:39 ` Gerrit Renker
2011-03-15 4:53 ` Samuel Jero [this message]
2011-03-18 11:33 ` dccp test-tree [RFC] [Patch 2/2] dccp: CCID2 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=1300164797.20638.65.camel@jero-laptop \
--to=sj323707@ohio.edu \
--cc=dccp@vger.kernel.org \
--cc=gerrit@erg.abdn.ac.uk \
--cc=netdev@vger.kernel.org \
/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