Skip to contentSkip to conversation

: Accurately determine idle & application-limited periods

PATCH In review Gerrit Renker 1 participant 1 message Apr 5, 2007 Networking

lore
Share & tools
lore
#0 lore raw

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

[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              |   55 +++++++++++++++++++++---------------
 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, 55 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 +33 -22

91 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)
 {