aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ccids
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2008-09-04 01:30:19 -0400
committerGerrit Renker <gerrit@erg.abdn.ac.uk>2008-09-04 01:45:42 -0400
commit9d497a2c9120e31ff417e75f9f5576c4cde11281 (patch)
tree5837bcdc7b78195e428a9ab7f6297c6b4acae3f3 /net/dccp/ccids
parent88e97a93342c0b9e835d510921e7b2df8547d1bd (diff)
dccp ccid-3: Implement rfc3448bis change to initial-rate computation
The patch updates CCID-3 with regard to the latest rfc3448bis-06: * in the first revisions of the draft, MSS was used for the RFC 3390 window; * then (from revision #1 to revision #2), it used the packet size `s'; * now, in this revision (and apparently final), the value is back to MSS. This change has an implication for the case when no RTT sample is available, at the time of sending the first packet: * with RTT sample, 2*MSS/RTT <= initial_rate <= 4*MSS/RTT; * without RTT sample, the initial rate is one packet (s bytes) per second (sec. 4.2), but using s instead of MSS here creates an imbalance, since this would further reduce the initial sending rate. Hence the patch uses MSS (called MPS in RFC 4340) in all places. Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Diffstat (limited to 'net/dccp/ccids')
-rw-r--r--net/dccp/ccids/ccid3.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index aca072b3edae..d654264c5108 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -53,18 +53,16 @@ static int ccid3_debug;
53/* 53/*
54 * Compute the initial sending rate X_init in the manner of RFC 3390: 54 * Compute the initial sending rate X_init in the manner of RFC 3390:
55 * 55 *
56 * X_init = min(4 * s, max(2 * s, 4380 bytes)) / RTT 56 * X_init = min(4 * MPS, max(2 * MPS, 4380 bytes)) / RTT
57 * 57 *
58 * Note that RFC 3390 uses MSS, RFC 4342 refers to RFC 3390, and rfc3448bis
59 * (rev-02) clarifies the use of RFC 3390 with regard to the above formula.
60 * For consistency with other parts of the code, X_init is scaled by 2^6. 58 * For consistency with other parts of the code, X_init is scaled by 2^6.
61 */ 59 */
62static inline u64 rfc3390_initial_rate(struct sock *sk) 60static inline u64 rfc3390_initial_rate(struct sock *sk)
63{ 61{
64 const struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk); 62 const u32 mps = dccp_sk(sk)->dccps_mss_cache,
65 const __u32 w_init = clamp_t(__u32, 4380U, 2 * hctx->s, 4 * hctx->s); 63 w_init = clamp(4380U, 2 * mps, 4 * mps);
66 64
67 return scaled_div(w_init << 6, hctx->rtt); 65 return scaled_div(w_init << 6, ccid3_hc_tx_sk(sk)->rtt);
68} 66}
69 67
70/** 68/**
@@ -293,7 +291,7 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, struct sk_buff *skb)
293 * - set sending rate X_pps = 1pps as per RFC 3448, 4.2. 291 * - set sending rate X_pps = 1pps as per RFC 3448, 4.2.
294 */ 292 */
295 hctx->rtt = DCCP_FALLBACK_RTT; 293 hctx->rtt = DCCP_FALLBACK_RTT;
296 hctx->x = hctx->s; 294 hctx->x = dp->dccps_mss_cache;
297 hctx->x <<= 6; 295 hctx->x <<= 6;
298 } 296 }
299 ccid3_update_send_interval(hctx); 297 ccid3_update_send_interval(hctx);