Skip to contentSkip to conversation

: Accurately determine idle & application-limited periods

PATCH New Gerrit Renker 1 participant 1 message Apr 11, 2007 Networking

lore
Share & tools
lore
#0 lore raw

PATCH v2 27/43 : Accurately determine idle & application-limited periods

I have taken your feedback on board, below is the revised patch. Uploaded as 13b_CCID3_Idle-and-Data-Limited-Periods.diff

INTERDIFF (also shows the reason for name - fitted in 80 chars/line):

@@ -111,11 +111,12 @@
}

/**

- *  ccid3_hc_tx_idle  -  Whether sender is idle or application-limited
+ *  ccid3_hc_tx_idle_rtt  -  Identify whether sender is idle/application-limited
  *  @now: Current time needs to be supplied
  *  Returns the number of full RTTs during which the sender has been idle.

*/
-static int ccid3_hc_tx_idle(struct ccid3_hc_tx_sock *hctx, struct timeval *now) +static int ccid3_hc_tx_idle_rtt(struct ccid3_hc_tx_sock *hctx,
+ struct timeval *now)
{
struct timeval last_send;
suseconds_t delta;
@@ -153,7 +154,7 @@
* a sender is idle if it has not sent anything over a 2-RTT-period.
* For consistency with X and X_recv, min_rate is also scaled by 2^6. */
- if (ccid3_hc_tx_idle(hctx, now) >= 2) {
+ if (ccid3_hc_tx_idle_rtt(hctx, now) >= 2) {
min_rate = rfc3390_initial_rate(sk);
min_rate = max(min_rate, 2 * hctx->ccid3hctx_x_recv);
}

------------------------> Patch v2 <----------------------------- [CCID3]: Accurately determine idle & application-limited periods

This fixes/updates the handling of idle and application-limited periods in CCID3, which currently is broken: there is no detection as to how long a sender has been idle; there is only one flag which is toggled in between function calls.

This patch implements detection of idle/application-limited periods on the basis of draft rfc3448bis-01, taking into account the time during which the sender has indeed not sent anything (i.e. has been idle); the condition now is:
If the sender has not sent anything during the last two RTTs,
it gets the bonus of a larger initial window (from RFC 3390).
Further support for this definition of idleness is found in the specification of CCID 2 (RFC 4341): in section 6.2.1, the timeout interval for detecting quiescence (aka idleness) is set to max(0.2 sec, 2 * RTT).

Being obsolete now, the `idle' flag is removed.

NB: This patch could be extended at a later stage to experiment with different idleness
definitions (e.g. RFC 2581, 4.1), by using selectable functions which codify the respective definition and which could be configured to use. However, the main purpose here is to fix the currently broken quiescence-detection by using a workable solution.

---
 net/dccp/ccids/ccid3.c              |   56 +++++++++++++++++++++---------------
 net/dccp/ccids/ccid3.h              |    2 -
 net/dccp/ccids/lib/packet_history.c |   21 +++++++++++++
 net/dccp/ccids/lib/packet_history.h |    1 
 4 files changed, 56 insertions(+), 24 deletions(-)
net/dccp/ccids/ccid3.h +0 -2
@@ -90,7 +90,6 @@ enum ccid3_hc_tx_states {
  * @ccid3hctx_t_last_win_count - Timestamp of earliest packet
  *				 with last_win_count value sent
  * @ccid3hctx_no_feedback_timer - Handle to no feedback timer
- * @ccid3hctx_idle - Flag indicating that sender is idling
  * @ccid3hctx_t_ld - Time last doubled during slow start
  * @ccid3hctx_t_nom - Nominal send time of next packet
  * @ccid3hctx_delta - Send timer delta (RFC 3448, 4.6) in usecs
@@ -109,7 +108,6 @@ struct ccid3_hc_tx_sock {
 	u16				ccid3hctx_s;
 	enum ccid3_hc_tx_states		ccid3hctx_state:8;
 	u8				ccid3hctx_last_win_count;
-	u8				ccid3hctx_idle;
 	struct timeval			ccid3hctx_t_last_win_count;
 	struct timer_list		ccid3hctx_no_feedback_timer;
 	struct timeval			ccid3hctx_t_ld;
net/dccp/ccids/ccid3.c +34 -22

92 lines not on this page · raw message

net/dccp/ccids/lib/packet_history.h +1 -0
@@ -70,6 +70,7 @@ static inline struct dccp_tx_hist_entry 
 
 extern int dccp_tx_hist_get_send_time(struct dccp_tx_hist *, struct list_head *,
 				      u64 seq, struct timeval *t_send);
+extern int dccp_tx_hist_last_send_time(struct list_head *, struct timeval *);
 
 extern void dccp_tx_hist_add_entry(struct list_head *, struct dccp_tx_hist_entry *);
 
net/dccp/ccids/lib/packet_history.c +21 -0
@@ -138,6 +138,27 @@ int dccp_tx_hist_get_send_time(struct dc
 
 EXPORT_SYMBOL_GPL(dccp_tx_hist_get_send_time);
 
+/**
+ *  dccp_tx_hist_last_send_time  -  Retrieve last send timestamp
+ *  @list:   TX history list head
+ *  Returns 1 if a meaningful last send time exists, 0 otherwise.
+ */
+int dccp_tx_hist_last_send_time(struct list_head *list, struct timeval *t_last)
+{
+	struct dccp_tx_hist_entry *last = NULL;
+
+	read_lock_bh(&dccp_tx_hist_lock);
+	if (!list_empty(list)) {
+		last = list_entry(list->next, typeof(*last), dccphtx_node);
+		*t_last = last->dccphtx_tstamp;
+	}
+	read_unlock_bh(&dccp_tx_hist_lock);
+
+	return (last != NULL);
+}
+
+EXPORT_SYMBOL_GPL(dccp_tx_hist_last_send_time);
+
 void dccp_tx_hist_add_entry(struct list_head *list,
 			    struct dccp_tx_hist_entry *entry)
 {