diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2008-09-04 01:30:19 -0400 |
---|---|---|
committer | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2008-09-04 01:45:42 -0400 |
commit | c8f41d50adc380bfb38538ce39ca0ffea5926221 (patch) | |
tree | ad2d9b674e2782b271f5ae15eb35630848055fbb /net/dccp | |
parent | 891e4d8a402427bc40dee4c8413213a584710372 (diff) |
dccp ccid-3: Measuring the packet size s with regard to rfc3448bis-06
rfc3448bis allows three different ways of tracking the packet size `s':
1. using the MSS/MPS (at initialisation, 4.2, and in 4.1 (1));
2. using the average of `s' (in 4.1);
3. using the maximum of `s' (in 4.2).
Instead of hard-coding a single interpretation of rfc3448bis, this implements
a choice of all three alternatives and suggests the first as default, since it
is the option which is most consistent with other parts of the specification.
The patch further deprecates the update of t_ipi whenever `s' changes. The
gains of doing this are only small since a change of s takes effect at the
next instant X is updated:
* when the next feedback comes in (within one RTT or less);
* when the nofeedback timer expires (within at most 4 RTTs).
Further, there are complications caused by updating t_ipi whenever s changes:
* if t_ipi had previously been updated to effect oscillation prevention (4.5),
then it is impossible to make the same adjustment to t_ipi again, thus
counter-acting the algorithm;
* s may be updated any time and a modification of t_ipi depends on the current
state (e.g. no oscillation prevention is done in the absence of feedback);
* in rev-06 of rfc3448bis, there are more possible cases, depending on whether
the sender is in slow-start (t_ipi <= R/W_init), or in congestion-avoidance,
limited by X_recv or the throughput equation (t_ipi <= t_mbi).
Thus there are side effects of always updating t_ipi as s changes. These may not
be desirable. The only case I can think of where such an update makes sense is
to recompute X_calc when p > 0 and when s changes (not done by this patch).
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Diffstat (limited to 'net/dccp')
-rw-r--r-- | net/dccp/ccids/Kconfig | 20 | ||||
-rw-r--r-- | net/dccp/ccids/ccid3.c | 27 |
2 files changed, 35 insertions, 12 deletions
diff --git a/net/dccp/ccids/Kconfig b/net/dccp/ccids/Kconfig index dc973abe03b4..fb168be2cb43 100644 --- a/net/dccp/ccids/Kconfig +++ b/net/dccp/ccids/Kconfig | |||
@@ -74,6 +74,26 @@ config IP_DCCP_CCID3_DEBUG | |||
74 | 74 | ||
75 | If in doubt, say N. | 75 | If in doubt, say N. |
76 | 76 | ||
77 | choice | ||
78 | prompt "Select method for measuring the packet size s" | ||
79 | default IP_DCCP_CCID3_MEASURE_S_AS_MPS | ||
80 | |||
81 | config IP_DCCP_CCID3_MEASURE_S_AS_MPS | ||
82 | bool "Always use MPS in place of s" | ||
83 | ---help--- | ||
84 | This use is recommended as it is consistent with the initialisation | ||
85 | of X and suggested when s varies (rfc3448bis, (1) in section 4.1). | ||
86 | config IP_DCCP_CCID3_MEASURE_S_AS_AVG | ||
87 | bool "Use moving average" | ||
88 | ---help--- | ||
89 | An alternative way of tracking s, also supported by rfc3448bis. | ||
90 | This used to be the default for CCID-3 in previous kernels. | ||
91 | config IP_DCCP_CCID3_MEASURE_S_AS_MAX | ||
92 | bool "Track the maximum payload length" | ||
93 | ---help--- | ||
94 | An experimental method based on tracking the maximum packet size. | ||
95 | endchoice | ||
96 | |||
77 | config IP_DCCP_CCID3_RTO | 97 | config IP_DCCP_CCID3_RTO |
78 | int "Use higher bound for nofeedback timer" | 98 | int "Use higher bound for nofeedback timer" |
79 | default 100 | 99 | default 100 |
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c index d654264c5108..d77d3e664b7e 100644 --- a/net/dccp/ccids/ccid3.c +++ b/net/dccp/ccids/ccid3.c | |||
@@ -136,17 +136,18 @@ static void ccid3_hc_tx_update_x(struct sock *sk, ktime_t *stamp) | |||
136 | } | 136 | } |
137 | 137 | ||
138 | /* | 138 | /* |
139 | * Track the mean packet size `s' (cf. RFC 4342, 5.3 and RFC 3448, 4.1) | 139 | * ccid3_hc_tx_measure_packet_size - Measuring the packet size `s' (sec 4.1) |
140 | * @len: DCCP packet payload size in bytes | 140 | * @new_len: DCCP payload size in bytes (not used by all methods) |
141 | */ | 141 | */ |
142 | static inline void ccid3_hc_tx_update_s(struct ccid3_hc_tx_sock *hctx, int len) | 142 | static u32 ccid3_hc_tx_measure_packet_size(struct sock *sk, const u16 new_len) |
143 | { | 143 | { |
144 | const u16 old_s = hctx->s; | 144 | #if defined(CONFIG_IP_DCCP_CCID3_MEASURE_S_AS_AVG) |
145 | 145 | return tfrc_ewma(ccid3_hc_tx_sk(sk)->s, new_len, 9); | |
146 | hctx->s = tfrc_ewma(hctx->s, len, 9); | 146 | #elif defined(CONFIG_IP_DCCP_CCID3_MEASURE_S_AS_MAX) |
147 | 147 | return max(ccid3_hc_tx_sk(sk)->s, new_len); | |
148 | if (hctx->s != old_s) | 148 | #else /* CONFIG_IP_DCCP_CCID3_MEASURE_S_AS_MPS */ |
149 | ccid3_update_send_interval(hctx); | 149 | return dccp_sk(sk)->dccps_mss_cache; |
150 | #endif | ||
150 | } | 151 | } |
151 | 152 | ||
152 | /* | 153 | /* |
@@ -271,8 +272,6 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, struct sk_buff *skb) | |||
271 | /* Set t_0 for initial packet */ | 272 | /* Set t_0 for initial packet */ |
272 | hctx->t_nom = now; | 273 | hctx->t_nom = now; |
273 | 274 | ||
274 | hctx->s = skb->len; | ||
275 | |||
276 | /* | 275 | /* |
277 | * Use initial RTT sample when available: recommended by erratum | 276 | * Use initial RTT sample when available: recommended by erratum |
278 | * to RFC 4342. This implements the initialisation procedure of | 277 | * to RFC 4342. This implements the initialisation procedure of |
@@ -294,6 +293,9 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, struct sk_buff *skb) | |||
294 | hctx->x = dp->dccps_mss_cache; | 293 | hctx->x = dp->dccps_mss_cache; |
295 | hctx->x <<= 6; | 294 | hctx->x <<= 6; |
296 | } | 295 | } |
296 | |||
297 | /* Compute t_ipi = s / X */ | ||
298 | hctx->s = ccid3_hc_tx_measure_packet_size(sk, skb->len); | ||
297 | ccid3_update_send_interval(hctx); | 299 | ccid3_update_send_interval(hctx); |
298 | 300 | ||
299 | } else { | 301 | } else { |
@@ -326,7 +328,8 @@ static void ccid3_hc_tx_packet_sent(struct sock *sk, unsigned int len) | |||
326 | { | 328 | { |
327 | struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk); | 329 | struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk); |
328 | 330 | ||
329 | ccid3_hc_tx_update_s(hctx, len); | 331 | /* Changes to s will become effective the next time X is computed */ |
332 | hctx->s = ccid3_hc_tx_measure_packet_size(sk, len); | ||
330 | 333 | ||
331 | if (tfrc_tx_hist_add(&hctx->hist, dccp_sk(sk)->dccps_gss)) | 334 | if (tfrc_tx_hist_add(&hctx->hist, dccp_sk(sk)->dccps_gss)) |
332 | DCCP_CRIT("packet history - out of memory!"); | 335 | DCCP_CRIT("packet history - out of memory!"); |