aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2007-03-20 14:31:56 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:27:04 -0400
commit30833ffead66e1f0052150a51db0b45151189ac1 (patch)
tree2fcd4907a8d6295455c686e54aa6d02fa9533934 /net
parent89560b53b92a07c529e13a462aa7fd87a844f1f5 (diff)
[CCID3]: Use initial RTT sample from SYN exchange
The patch follows the following recommendation made in an erratum to RFC 4342: "Senders MAY additionally make use of other available RTT measurements, including those from the initial Request-Response packet exchange." It implements larger initial windows with regard to this inital RTT measurement, using the mechanism suggested in draft-ietf-dccp-rfc3448bis, section 4.2. Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Signed-off-by: Ian McDonald <ian.mcdonald@jandi.co.nz> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/dccp/ccids/ccid3.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index f4097ddf2504..c3abd7695d55 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -334,19 +334,30 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, struct sk_buff *skb)
334 usecs_to_jiffies(TFRC_INITIAL_TIMEOUT))); 334 usecs_to_jiffies(TFRC_INITIAL_TIMEOUT)));
335 hctx->ccid3hctx_last_win_count = 0; 335 hctx->ccid3hctx_last_win_count = 0;
336 hctx->ccid3hctx_t_last_win_count = now; 336 hctx->ccid3hctx_t_last_win_count = now;
337 ccid3_hc_tx_set_state(sk, TFRC_SSTATE_NO_FBACK);
338
339 /* Set initial sending rate X/s to 1pps (X is scaled by 2^6) */
340 hctx->ccid3hctx_x = hctx->ccid3hctx_s = skb->len;
341 hctx->ccid3hctx_x <<= 6;
342
343 /* First timeout, according to [RFC 3448, 4.2], is 1 second */
344 hctx->ccid3hctx_t_ipi = USEC_PER_SEC;
345 /* Initial delta: minimum of 0.5 sec and t_gran/2 */
346 hctx->ccid3hctx_delta = TFRC_OPSYS_HALF_TIME_GRAN;
347 337
348 /* Set t_0 for initial packet */ 338 /* Set t_0 for initial packet */
349 hctx->ccid3hctx_t_nom = now; 339 hctx->ccid3hctx_t_nom = now;
340
341 hctx->ccid3hctx_s = skb->len;
342
343 /*
344 * Use initial RTT sample when available: recommended by erratum
345 * to RFC 4342. This implements the initialisation procedure of
346 * draft rfc3448bis, section 4.2. Remember, X is scaled by 2^6.
347 */
348 if (dp->dccps_syn_rtt) {
349 ccid3_pr_debug("SYN RTT = %uus\n", dp->dccps_syn_rtt);
350 hctx->ccid3hctx_rtt = dp->dccps_syn_rtt;
351 hctx->ccid3hctx_x = rfc3390_initial_rate(sk);
352 hctx->ccid3hctx_t_ld = now;
353 } else {
354 /* Sender does not have RTT sample: X = MSS/second */
355 hctx->ccid3hctx_x = dp->dccps_mss_cache;
356 hctx->ccid3hctx_x <<= 6;
357 }
358 ccid3_update_send_interval(hctx);
359
360 ccid3_hc_tx_set_state(sk, TFRC_SSTATE_NO_FBACK);
350 break; 361 break;
351 case TFRC_SSTATE_NO_FBACK: 362 case TFRC_SSTATE_NO_FBACK:
352 case TFRC_SSTATE_FBACK: 363 case TFRC_SSTATE_FBACK: