Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 111548
b: refs/heads/master
c: c8f41d5
h: refs/heads/master
v: v3
  • Loading branch information
Gerrit Renker committed Sep 4, 2008
1 parent a3415fd commit ded58f7
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 891e4d8a402427bc40dee4c8413213a584710372
refs/heads/master: c8f41d50adc380bfb38538ce39ca0ffea5926221
20 changes: 20 additions & 0 deletions trunk/net/dccp/ccids/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,26 @@ config IP_DCCP_CCID3_DEBUG

If in doubt, say N.

choice
prompt "Select method for measuring the packet size s"
default IP_DCCP_CCID3_MEASURE_S_AS_MPS

config IP_DCCP_CCID3_MEASURE_S_AS_MPS
bool "Always use MPS in place of s"
---help---
This use is recommended as it is consistent with the initialisation
of X and suggested when s varies (rfc3448bis, (1) in section 4.1).
config IP_DCCP_CCID3_MEASURE_S_AS_AVG
bool "Use moving average"
---help---
An alternative way of tracking s, also supported by rfc3448bis.
This used to be the default for CCID-3 in previous kernels.
config IP_DCCP_CCID3_MEASURE_S_AS_MAX
bool "Track the maximum payload length"
---help---
An experimental method based on tracking the maximum packet size.
endchoice

config IP_DCCP_CCID3_RTO
int "Use higher bound for nofeedback timer"
default 100
Expand Down
27 changes: 15 additions & 12 deletions trunk/net/dccp/ccids/ccid3.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,18 @@ static void ccid3_hc_tx_update_x(struct sock *sk, ktime_t *stamp)
}

/*
* Track the mean packet size `s' (cf. RFC 4342, 5.3 and RFC 3448, 4.1)
* @len: DCCP packet payload size in bytes
* ccid3_hc_tx_measure_packet_size - Measuring the packet size `s' (sec 4.1)
* @new_len: DCCP payload size in bytes (not used by all methods)
*/
static inline void ccid3_hc_tx_update_s(struct ccid3_hc_tx_sock *hctx, int len)
static u32 ccid3_hc_tx_measure_packet_size(struct sock *sk, const u16 new_len)
{
const u16 old_s = hctx->s;

hctx->s = tfrc_ewma(hctx->s, len, 9);

if (hctx->s != old_s)
ccid3_update_send_interval(hctx);
#if defined(CONFIG_IP_DCCP_CCID3_MEASURE_S_AS_AVG)
return tfrc_ewma(ccid3_hc_tx_sk(sk)->s, new_len, 9);
#elif defined(CONFIG_IP_DCCP_CCID3_MEASURE_S_AS_MAX)
return max(ccid3_hc_tx_sk(sk)->s, new_len);
#else /* CONFIG_IP_DCCP_CCID3_MEASURE_S_AS_MPS */
return dccp_sk(sk)->dccps_mss_cache;
#endif
}

/*
Expand Down Expand Up @@ -271,8 +272,6 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, struct sk_buff *skb)
/* Set t_0 for initial packet */
hctx->t_nom = now;

hctx->s = skb->len;

/*
* Use initial RTT sample when available: recommended by erratum
* to RFC 4342. This implements the initialisation procedure of
Expand All @@ -294,6 +293,9 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, struct sk_buff *skb)
hctx->x = dp->dccps_mss_cache;
hctx->x <<= 6;
}

/* Compute t_ipi = s / X */
hctx->s = ccid3_hc_tx_measure_packet_size(sk, skb->len);
ccid3_update_send_interval(hctx);

} else {
Expand Down Expand Up @@ -326,7 +328,8 @@ static void ccid3_hc_tx_packet_sent(struct sock *sk, unsigned int len)
{
struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk);

ccid3_hc_tx_update_s(hctx, len);
/* Changes to s will become effective the next time X is computed */
hctx->s = ccid3_hc_tx_measure_packet_size(sk, len);

if (tfrc_tx_hist_add(&hctx->hist, dccp_sk(sk)->dccps_gss))
DCCP_CRIT("packet history - out of memory!");
Expand Down

0 comments on commit ded58f7

Please sign in to comment.