dccp: CCID-3 updates
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): ccid3_updates_ecn_and_rfc3448bis
cover dccp: CCID-3 updates
This and the following changesets are updates for the CCID-3 code in the DCCP test tree. They have been in my development tree for a while and seem to be stable. Review and comments would be appreciated.
Purpose:
--------
1. general updates;
2. update the CCID-3 code to support ECN (this is not supported yet);
3. update the CCID-3 code with regard to rfc3448bis-06, which is soon to become an RFC. This work is ongoing and takes time.
Patch #1: Checks if timer resolution is too coarse when loading the module and
refuses to load when under the minimum resolution. This avoids triggering bugs messages such as negative RTT samples.
Patch #2: Simplifies the CCID-3 TX state machine by using a Boolean flag. Patch #3: Suppresses unavoidable "below resolution" warning for CCID-3 loss
rate p (which decays towards 0, past the minimum resolution).
Patch #4: Modifies the TFRC initialisation routine to support early loss
detection (the first-seen sequence number is set to GSR).
Patch #5: Adds early loss detection as enabled by patch #4.
Patch #6: Simplifies updating the average TFRC loss interval I_mean. Patch #7: Replaces a lazy BUG_ON with a conditional.
The test tree is available via
git://eden-feed.erg.abdn.ac.uk/dccp_exp (subtree `dccp')
There is also a web view available.
CCID-4 Notes:
-------------
All changes have been ported to the CCID-4 tree as well and are on
git://eden-feed.erg.abdn.ac.uk/dccp_exp (subtree `ccid4')
The following patches became obsolete as a result of this:
[CCID-3/4] Share TFRC sender states via tfrc_ccids [CCID-3/4] Share ccid3_tx_state_name function via tfrc_ccids
PATCH 1/7 dccp ccid-3: Runtime verification of timer resolution
This prevents module loading when the timer resolution is too low (e.g. when using jiffies as a clocksource or when disabling high resolution timers on sparc64).
Rationale:
----------
The DCCP base time resolution is 10 microseconds (RFC 4340, 13.1...3). Using a timer with a lower resolution than that was found to trigger the following bug warnings/problems on high-speed networks (e.g. local loopback):
* small RTT samples are rounded down to 0
(in some cases, even negative RTT samples occurred);
* the CCID-3 feedback timer complains that the feedback interval is 0, since the coarse-grained resolution rounds RTT-wise intervals down.
The following syslog messages were observed with a low resolution:
11:24:00 kernel: BUG: delta (0) <= 0 at ccid3_hc_rx_send_feedback() 11:26:12 kernel: BUG: delta (0) <= 0 at ccid3_hc_rx_send_feedback() 11:26:30 kernel: dccp_sample_rtt: unusable RTT sample 0, using min 11:26:30 last message repeated 5 times
--- net/dccp/ccids/ccid3.c | 13 +++++++++++++ net/dccp/dccp.h | 5 ++++- net/dccp/timer.c | 3 +-- 3 files changed, 18 insertions(+), 3 deletions(-)
net/dccp/dccp.h +4 -1
@@ -86,10 +86,13 @@ extern void dccp_time_wait(struct sock *sk, int state, int timeo);*/ #define DCCP_RTO_MAX ((unsigned)(64 * HZ)) +/* DCCP base time resolution - 10 microseconds (RFC 4340, 13.1 ... 13.3) */ +#define DCCP_TIME_RESOLUTION 10 +/* * RTT sampling: sanity bounds and fallback RTT value from RFC 4340, section 3.4 */ -#define DCCP_SANE_RTT_MIN 100 +#define DCCP_SANE_RTT_MIN (10 * DCCP_TIME_RESOLUTION)#define DCCP_FALLBACK_RTT (USEC_PER_SEC / 5)#define DCCP_SANE_RTT_MAX (3 * USEC_PER_SEC)
net/dccp/ccids/ccid3.c +13 -0
@@ -869,6 +869,19 @@ MODULE_PARM_DESC(ccid3_debug, "Enable debug messages");static __init int ccid3_module_init (void ) { +struct timespec tp; + +/* +* Without a fine-grained clock resolution, RTTs/X_recv are not sampled +* correctly and feedback is sent either too early or too late. +*/ +hrtimer_get_res (CLOCK_MONOTONIC , &tp); +if (tp.tv_sec || tp.tv_nsec >DCCP_TIME_RESOLUTION *NSEC_PER_USEC ) { +printk (KERN_ERR "%s: Timer too coarse (%ld usec), need %u-usec" +" resolution - check your clocksource.\n" , __func__, + tp.tv_nsec/NSEC_PER_USEC ,DCCP_TIME_RESOLUTION ); +return -ESOCKTNOSUPPORT ; + }return ccid_register (&ccid3); }module_init (ccid3_module_init);
net/dccp/timer.c +1 -2
@@ -281,8 +281,7 @@ u32 dccp_timestamp(void) {s64 delta =ktime_us_delta (ktime_get_real (), dccp_timestamp_seed); -do_div (delta,10 ); -return delta; +return div_u64 (delta,DCCP_TIME_RESOLUTION ); }EXPORT_SYMBOL_GPL (dccp_timestamp);
PATCH 2/7 dccp ccid-3: Simplified handling of TX states
Since CCIDs are only used during the established phase of a connection, they have very little internal state; this specifically reduces to:
* "no packet sent" if and only if s = 0, for the TX packet size s;
* when the first packet has been sent (i.e. `s' > 0), the question is whether or not feedback has been received:
- if a feedback packet is received, "feedback = yes" is set,
- if the nofeedback timer expires, "feedback = no" is set.
Thus the CCID only needs to remember state about whether or not feedback has been received. This is now implemented using a boolean flag, which is toggled when a feedback packet arrives or the nofeedback timer expires.
--- net/dccp/ccids/ccid3.c | 41 ++++++----------------------------------- net/dccp/ccids/ccid3.h | 11 ++--------- 2 files changed, 8 insertions(+), 44 deletions(-)
net/dccp/ccids/ccid3.h +2 -9
@@ -70,13 +70,6 @@ enum ccid3_options { TFRC_OPT_RECEIVE_RATE = 194, }; -/* TFRC sender states */ -enum ccid3_hc_tx_states { -TFRC_SSTATE_NO_SENT =1 , -TFRC_SSTATE_NO_FBACK , -TFRC_SSTATE_FBACK , -}; -/** struct ccid3_hc_tx_sock - CCID3 sender half-connection socket * * @x - Current sending rate in 64 * bytes per second
@@ -87,7 +80,7 @@ enum ccid3_hc_tx_states {* @s - Packet size in bytes * @t_rto - Nofeedback Timer setting in usecs * @t_ipi - Interpacket (send) interval (RFC 3448, 4.6) in usecs -* @state - Sender state, one of %ccid3_hc_tx_states +* @feedback - Whether feedback has been received or not * @last_win_count - Last window counter sent * @t_last_win_count - Timestamp of earliest packet with * last_win_count value sent
@@ -105,7 +98,7 @@ struct ccid3_hc_tx_sock {u32 t_rto;u32 t_ipi;u16 s; - enum ccid3_hc_tx_states state:8; + bool feedback:1;u8 last_win_count;ktime_t t_last_win_count;struct timer_list no_feedback_timer;
net/dccp/ccids/ccid3.c +6 -35
83 lines not on this page · raw message
PATCH 3/7 dccp tfrc: Suppress unavoidable "below resolution" warning
In the congestion-avoidance phase a decay of p towards 0 is natural once fewer losses are encountered. Hence the warning message "p is below resolution" is not necessary, and thus turned into a debug message by this patch.
The TFRC_SMALLEST_P is needed since in theory p never actually reaches 0. When no further losses are encountered, the loss interval I_0 grows in length, causing p to decrease towards 0, causing X_calc = s/(RTT * f(p)) to increase.
With the given minimum-resolution this congestion avoidance phase stops at some fixed value, an approximation formula has been added to the documentation.
--- net/dccp/ccids/lib/tfrc_equation.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-)
net/dccp/ccids/lib/tfrc_equation.c +10 -2
@@ -632,8 +632,16 @@ u32 tfrc_calc_x(u16 s, u32 R, u32 p)if (p <=TFRC_CALC_X_SPLIT ) {/* 0.0000 < p <= 0.05 */ if (p <TFRC_SMALLEST_P ) {/* 0.0000 < p < 0.0001 */ -DCCP_WARN ("Value of p (%d) below resolution. " -"Substituting %d\n" , p,TFRC_SMALLEST_P ); +/* +* In the congestion-avoidance phase p decays towards 0 +* when there are no further losses, so this case is +* natural. Truncating to p_min = 0.01% means that the +* maximum achievable throughput is limited to about +* X_calc_max = 122.4 * s/RTT (see RFC 3448, 3.1); e.g. +* with s00 bytes, RTT=0.01 s: X_calc_max = 147 Mbps. +*/ +tfrc_pr_debug ("Value of p (%d) below resolution. " +"Substituting %d\n" , p,TFRC_SMALLEST_P ); index =0 ; }else /* 0.0001 <= p <= 0.05 */ index = p/TFRC_SMALLEST_P -1 ;
PATCH 4/7 dccp tfrc: Receiver history initialisation routine
This patch
1) separates history allocation and initialisation, to facilitate early
loss detection (implemented by a subsequent patch);
2) removes duplication by using the existing tfrc_rx_hist_purge() if the allocation fails. This is now possible, since the initialisation routine
3) zeroes out the entire history before using it.
--- net/dccp/ccids/ccid3.c | 2 +- net/dccp/ccids/lib/packet_history.c | 52 ++++++++++++++++++++--------------- net/dccp/ccids/lib/packet_history.h | 2 +- 3 files changed, 32 insertions(+), 24 deletions(-)
net/dccp/ccids/lib/packet_history.h +1 -1
@@ -153,7 +153,7 @@ extern int tfrc_rx_handle_loss(struct tfrc_rx_hist *h, struct sock *sk);extern u32 tfrc_rx_hist_sample_rtt (struct tfrc_rx_hist *h,const struct sk_buff *skb); -extern int tfrc_rx_hist_alloc (struct tfrc_rx_hist *h); +extern int tfrc_rx_hist_init (struct tfrc_rx_hist *h,struct sock *sk);extern void tfrc_rx_hist_purge (struct tfrc_rx_hist *h);#endif /* _DCCP_PKT_HIST_ */
net/dccp/ccids/lib/packet_history.c +30 -22
64 lines not on this page · raw message
net/dccp/ccids/ccid3.c +1 -1
@@ -766,7 +766,7 @@ static int ccid3_hc_rx_init(struct ccid *ccid, struct sock *sk) hcrx->state =TFRC_RSTATE_NO_DATA ;tfrc_lh_init (&hcrx->li_hist); -return tfrc_rx_hist_alloc (&hcrx->hist); +return tfrc_rx_hist_init (&hcrx->hist, sk); }static void ccid3_hc_rx_exit (struct sock *sk)
PATCH 5/7 dccp tfrc: Perform early loss detection
This enables the TFRC code to begin loss detection (as soon as the module is loaded), using the latest updates from rfc3448bis-06, 6.3.1:
* when the first data packet(s) are lost or marked, set
* X_target = s/(2*R) => f(p) = s/(R * X_target) = 2,
* corresponding to a loss rate of ~ 20.64%.
The handle_loss() function is now called right at the begin of rx_packet_recv() and thus no longer protected against duplicates: hence a call to rx_duplicate() has been added. Such a call makes sense now, as the previous patch initialises the first entry with a sequence number of GSR.
--- net/dccp/ccids/ccid3.c | 48 ++++++++++++++++++++++++++++------ net/dccp/ccids/lib/packet_history.c | 3 ++ 2 files changed, 42 insertions(+), 9 deletions(-)
net/dccp/ccids/ccid3.c +39 -9
@@ -577,6 +577,28 @@ static void ccid3_hc_rx_send_feedback(struct sock *sk, hcrx->p_inverse = ~0U ;/* see RFC 4342, 8.5 */ break ;case CCID3_FBACK_PARAM_CHANGE : +if (unlikely (hcrx->state =TFRC_RSTATE_NO_DATA )) { +/* +* rfc3448bis-06, 6.3.1: First packet(s) lost or marked +* FIXME: in rfc3448bis the receiver returns X_recv=0 +* here as it normally would in the first feedback packet. +* However this is not possible yet, since the code still +* uses RFC 3448, i.e. +* If (p > 0) +* Calculate X_calc using the TCP throughput equation. +* X = max(min(X_calc, 2*X_recv), s/t_mbi); +* would bring X down to s/t_mbi. That is why we return +* X_recv according to rfc3448bis-06 for the moment. +*/ +u32 rtt = hcrx->rtt ? :DCCP_FALLBACK_RTT , s = hcrx->s; + +if (s =0 ) { +DCCP_WARN ("No sample for s, using fallback\n" ); + s =TCP_MIN_RCVMSS ; + } + hcrx->x_recv =scaled_div32 (s,2 * rtt); +break ; + }/* * When parameters change (new loss or p > p_prev), we do not * have a reliable estimate for R_m of [RFC 3448, 6.2] and so
@@ -650,6 +672,14 @@ static u32 ccid3_first_li(struct sock *sk)u32 x_recv, p, delta;u64 fval; +/* +* rfc3448bis-06, 6.3.1: First data packet(s) are marked or lost. Set p +* to give the equivalent of X_target = s/(2*R). Thus fval = 2 and so p +* is about 20.64%. This yields an interval length of 4.84 (rounded up). +*/ +if (unlikely (hcrx->state =TFRC_RSTATE_NO_DATA )) +return 5 ; +if (hcrx->rtt =0 ) {DCCP_WARN ("No RTT estimate available, using fallback RTT\n" ); hcrx->rtt =DCCP_FALLBACK_RTT ;
@@ -683,6 +713,15 @@ static void ccid3_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb)const u64 ndp =dccp_sk (sk)->dccps_options_received.dccpor_ndp;const bool is_data_packet =dccp_data_packet (skb); +/* +* Perform loss detection and handle pending losses +*/ +if (tfrc_rx_handle_loss (&hcrx->hist, &hcrx->li_hist, + skb, ndp, ccid3_first_li, sk)) { + do_feedback =CCID3_FBACK_PARAM_CHANGE ; + goto done_receiving; + } +if (unlikely (hcrx->state =TFRC_RSTATE_NO_DATA )) {if (is_data_packet) {const u32 payload = skb->len -dccp_hdr (skb)->dccph_doff *4 ;
@@ -710,15 +749,6 @@ static void ccid3_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb) hcrx->bytes_recv += payload; } -/* -* Perform loss detection and handle pending losses -*/ -if (tfrc_rx_handle_loss (&hcrx->hist, &hcrx->li_hist, - skb, ndp, ccid3_first_li, sk)) { - do_feedback =CCID3_FBACK_PARAM_CHANGE ; - goto done_receiving; - } -if (tfrc_rx_hist_loss_pending (&hcrx->hist))return ;/* done receiving */
net/dccp/ccids/lib/packet_history.c +3 -0
@@ -335,6 +335,9 @@ int tfrc_rx_handle_loss(struct tfrc_rx_hist *h, {int is_new_loss =0 ; +if (tfrc_rx_hist_duplicate (h, skb)) +return 0 ; +if (h->loss_count =0 ) {__do_track_loss (h, skb, ndp); }else if (h->loss_count =1 ) {
PATCH 6/7 dccp tfrc: Return type of update_i_mean is void
This changes the return type of tfrc_lh_update_i_mean() to void, since that function returns always `false'. This is due to
len = dccp_delta_seqno(cur->li_seqno, DCCP_SKB_CB(skb)->dccpd_seq) + 1;
if (len - (s64)cur->li_length <= 0) /* duplicate or reordered */
return 0;
which means that update_i_mean can only increase the length of the open loss interval I_0, and hence the value of I_tot0 (RFC 3448, 5.4). Consequently the test `i_mean < old_i_mean' at the end of the function always evaluates to false.
There is no known way by which a loss interval can suddenly become shorter, therefore the return type of the function is changed to void. (That is, under the given circumstances step (3) in RFC 3448, 6.1 will not occur.)
Further changes:
----------------
* the function is now called from tfrc_rx_handle_loss, which is equivalent to the previous way of calling from rx_packet_recv (it was called whenever there was no new or pending loss, now it is also updated when there is a pending loss - this increases the accuracy a bit);
* added a FIXME to possibly consider NDP counting as per RFC 4342 (this is not implemented yet).
--- net/dccp/ccids/ccid3.c | 8 -------- net/dccp/ccids/lib/loss_interval.c | 20 +++++++++++--------- net/dccp/ccids/lib/loss_interval.h | 2 +- net/dccp/ccids/lib/packet_history.c | 5 +++++ 4 files changed, 17 insertions(+), 18 deletions(-)
net/dccp/ccids/lib/loss_interval.h +1 -1
@@ -69,7 +69,7 @@ struct tfrc_rx_hist;extern int tfrc_lh_interval_add (struct tfrc_loss_hist *,struct tfrc_rx_hist *,u32 (*first_li)(struct sock *),struct sock *); -extern u8 tfrc_lh_update_i_mean (struct tfrc_loss_hist *lh,struct sk_buff *); +extern void tfrc_lh_update_i_mean (struct tfrc_loss_hist *lh,struct sk_buff *);extern void tfrc_lh_cleanup (struct tfrc_loss_hist *lh);#endif /* _DCCP_LI_HIST_ */
net/dccp/ccids/lib/loss_interval.c +11 -9
@@ -84,21 +84,26 @@ static void tfrc_lh_calc_i_mean(struct tfrc_loss_hist *lh)/** * tfrc_lh_update_i_mean - Update the `open' loss interval I_0 -* For recomputing p: returns `true' if p > p_prev <=> 1/p < 1/p_prev +* This updates I_mean as the sequence numbers increase. As a consequence, the +* open loss interval I_0 increases, hence p = W_tot/max(I_tot0, I_tot1) +* decreases, and thus there is no need to send renewed feedback. */ -u8 tfrc_lh_update_i_mean (struct tfrc_loss_hist *lh,struct sk_buff *skb) +void tfrc_lh_update_i_mean (struct tfrc_loss_hist *lh,struct sk_buff *skb) {struct tfrc_loss_interval *cur =tfrc_lh_peek (lh); -u32 old_i_mean = lh->i_mean;s64 len;if (cur =NULL )/* not initialised */ -return 0 ; +return ; + +/* FIXME: should probably also count non-data packets (RFC 4342, 6.1) */ +if (!dccp_data_packet (skb)) +return ; len =dccp_delta_seqno (cur->li_seqno,DCCP_SKB_CB (skb)->dccpd_seq) +1 ;if (len - (s64 )cur->li_length <=0 )/* duplicate or reordered */ -return 0 ; +return ;if (SUB16 (dccp_hdr (skb)->dccph_ccval, cur->li_ccval) >4 )/*
@@ -112,14 +117,11 @@ u8 tfrc_lh_update_i_mean(struct tfrc_loss_hist *lh, struct sk_buff *skb) cur->li_is_closed =1 ;if (tfrc_lh_length (lh) =1 )/* due to RFC 3448, 6.3.1 */ -return 0 ; +return ; cur->li_length = len;tfrc_lh_calc_i_mean (lh); - -return (lh->i_mean < old_i_mean); } -EXPORT_SYMBOL_GPL (tfrc_lh_update_i_mean);/* Determine if `new_loss' does begin a new loss interval [RFC 4342, 10.2] */ static inline u8 tfrc_lh_is_new_loss(struct tfrc_loss_interval *cur,
net/dccp/ccids/ccid3.c +0 -8
@@ -767,15 +767,7 @@ static void ccid3_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb)*/ if (sample !=0 ) hcrx->rtt =tfrc_ewma (hcrx->rtt, sample,9 ); - - }else if (tfrc_lh_update_i_mean (&hcrx->li_hist, skb)) { -/* -* Step (3) of [RFC 3448, 6.1]: Recompute I_mean and, if I_mean -* has decreased (resp. p has increased), send feedback now. -*/ - do_feedback =CCID3_FBACK_PARAM_CHANGE ; } -/* * Check if the periodic once-per-RTT feedback is due; RFC 4342, 10.3 */
net/dccp/ccids/lib/packet_history.c +5 -0
@@ -351,6 +351,11 @@ int tfrc_rx_handle_loss(struct tfrc_rx_hist *h, is_new_loss =tfrc_lh_interval_add (lh, h, calc_first_li, sk);__three_after_loss (h); } + +/* RFC 3448, 6.1: update I_0, whose growth implies p <= p_prev */ +if (!is_new_loss) +tfrc_lh_update_i_mean (lh, skb); +return is_new_loss; }EXPORT_SYMBOL_GPL (tfrc_rx_handle_loss);
PATCH 7/7 dccp ccid-3: Replace lazy BUG_ON with condition
The BUG_ON(w_tot = 0) only holds if there is no more than 1 loss interval in the loss history. If there is only a single loss interval, the calc_i_mean() routine need in fact not be called (RFC 3448, 6.3.1).
--- net/dccp/ccids/lib/loss_interval.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
net/dccp/ccids/lib/loss_interval.c +4 -2
@@ -67,7 +67,10 @@ static void tfrc_lh_calc_i_mean(struct tfrc_loss_hist *lh)u32 i_i, i_tot0 =0 , i_tot1 =0 , w_tot =0 ;int i, k =tfrc_lh_length (lh) -1 ;/* k is as in rfc3448bis, 5.4 */ -for (i=0 ; i <= k; i++) { +if (k <=0 ) +return ; + +for (i =0 ; i <= k; i++) { i_i =tfrc_lh_get_interval (lh, i);if (i < k) {
@@ -78,7 +81,6 @@ static void tfrc_lh_calc_i_mean(struct tfrc_loss_hist *lh) i_tot1 += i_i * tfrc_lh_weights[i-1 ]; } -BUG_ON (w_tot =0 ); lh->i_mean =max (i_tot0, i_tot1) / w_tot; }
Re: [PATCH 3/7] dccp tfrc: Suppress unavoidable "below resolution" warning
In reply to Gerrit RenkerQuoted 4 lines · Gerrit Renker
In the congestion-avoidance phase a decay of p towards 0 is natural once fewer losses are encountered. Hence the warning message "p is below resolution" is not necessary, and thus turned into a debug message by this patch.
Quoted 8 lines
The
TFRC_SMALLEST_Pis needed since in theory p never actually reaches 0. When no further losses are encountered, the loss intervalI_0grows in length, causing p to decrease towards 0, causingX_calc= s/(RTT * f(p)) to increase.With the given minimum-resolution this congestion avoidance phase stops at some fixed value, an approximation formula has been added to the documentation.
Signed-off-by Gerrit Renker <[email protected]>
Re: [PATCH 2/7] dccp ccid-3: Simplified handling of TX states
In reply to Gerrit RenkerQuoted 10 lines · Gerrit Renker
Since CCIDs are only used during the established phase of a connection, they have very little internal state; this specifically reduces to:
* "no packet sent" if and only if s = 0, for the TX packet size s;
* when the first packet has been sent (i.e. `s' > 0), the question is whether or not feedback has been received:
- if a feedback packet is received, "feedback = yes" is set,
- if the nofeedback timer expires, "feedback = no" is set.
Quoted 5 lines
Thus the CCID only needs to remember state about whether or not feedback has been received. This is now implemented using a boolean flag, which is toggled when a feedback packet arrives or the nofeedback timer expires.
Signed-off-by Gerrit Renker <[email protected]>
Re: [PATCH 1/7] dccp ccid-3: Runtime verification of timer resolution
In reply to Gerrit RenkerQuoted 16 lines · Gerrit Renker
This prevents module loading when the timer resolution is too low (e.g. when using jiffies as a clocksource or when disabling high resolution timers on sparc64).
Rationale:
----------
The DCCP base time resolution is 10 microseconds (RFC 4340, 13.1...3). Using a timer with a lower resolution than that was found to trigger the following bug warnings/problems on high-speed networks (e.g. local loopback):* small RTT samples are rounded down to 0
(in some cases, even negative RTT samples occurred);
* the CCID-3 feedback timer complains that the feedback interval is 0, since the coarse-grained resolution rounds RTT-wise intervals down.
Quoted 7 lines
The following syslog messages were observed with a low resolution:
11:24:00 kernel: BUG: delta (0) <= 0 atccid3_hc_rx_send_feedback()11:26:12 kernel: BUG: delta (0) <= 0 atccid3_hc_rx_send_feedback()11:26:30 kernel:dccp_sample_rtt: unusable RTT sample 0, using min 11:26:30 last message repeated 5 timesSigned-off-by Gerrit Renker <[email protected]>
I don't think this is the right direction to head. I think it is acceptable to have not perfect performance if HR timers aren't loaded (and I'm sure ways could be made to improve this) but to disable CCID3 altogether is quite drastic. Where will CCID3 be used - think embedded multimedia home devices. These may not have HR timers....
So I disagree with this one.
Ian
Re: [PATCH 1/7] dccp ccid-3: Runtime verification of timer resolution
| > | > This prevents module loading when the timer resolution is too low | > (e.g. when using jiffies as a clocksource or when disabling high | > resolution timers on sparc64). | > | > Rationale: | > ---------- | > The DCCP base time resolution is 10 microseconds (RFC 4340, 13.1...3). Using a | > timer with a lower resolution than that was found to trigger the following bug | > warnings/problems on high-speed networks (e.g. local loopback): | > | > * small RTT samples are rounded down to 0 | > (in some cases, even negative RTT samples occurred); | > * the CCID-3 feedback timer complains that the feedback interval is 0, | > since the coarse-grained resolution rounds RTT-wise intervals down. | > | > The following syslog messages were observed with a low resolution: | > 11:24:00 kernel: BUG: delta (0) <= 0 at ccid3_hc_rx_send_feedback() | > 11:26:12 kernel: BUG: delta (0) <= 0 at ccid3_hc_rx_send_feedback() | > 11:26:30 kernel: dccp_sample_rtt: unusable RTT sample 0, using min | > 11:26:30 last message repeated 5 times <snip> | | I don't think this is the right direction to head. I think it is | acceptable to have not perfect performance if HR timers aren't loaded | (and I'm sure ways could be made to improve this) but to disable CCID3 | altogether is quite drastic. Where will CCID3 be used - think embedded | multimedia home devices. These may not have HR timers.... | | So I disagree with this one. |
I think we need to continue this discussion on two levels
1. what should/could be done
2. what the code currently supports.
With regard to the first point I fully agree with you. If it would be possible to use a jiffy-based timer basis for the TFRC (CCID-3/4) code it would make things easier. The code changes that this requires are however too big. It will take a lot of time to find something usable.
In this regard, here is one of the most urgent ToDos: developing an RFC1323-style algorithm for use with DCCP timestamps and elapsed time option. This would kill several birds with one stone, since the CCID-2 RTT estimation code is currently below par (not even as good as the TCP code). But RTT sampling is just one part of the problem, the other problem is the interval between feedback packets. If you look at the patch which computes X_recv - when the interval is too small/large, the reported value of X_recv becomes too large/small, respectively.
The second question under point (1) is whether the embedded devices actually lack high-resolution timer support. I am CC:-ing this to Leandro, who I hope will be able to provide some information about whether this will cause problems on the Maemo platform.
Or hopefully some knowledgeable embedded-systems people on this list will shed some light regarding availability of high-res. (<= 10 usec) timers.
Regarding point (2): the code implicitly depends on a time resolution in the order of 10s of microseconds. The most recent example was the bug reported by Tomasz, which resulted from a loopback RTT of less than 4 microseconds. Many people now use virtualisation and will want DCCP to still work even with extremely low RTTs.
Even if embedded systems do not have high resolution timers, I think it is not good to remove this protection, since frankly the code does not work without a fine-grained timer resolution. The protection is there to ensure that the code gets the conditions it implicitly requires.