All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 6/25] Reduce allowed sending rate by a factor that accounts for packet header size
@ 2007-11-01  0:30 Leandro
  2007-11-03  6:28 ` Ian McDonald
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Leandro @ 2007-11-01  0:30 UTC (permalink / raw)
  To: dccp

[CCID-4] Reduce allowed sending rate by a factor that accounts for packet header size

Signed-off-by: Leandro Melo de Sales <leandro@embedded.ufcg.edu.br>
Signed-off-by: Tommi Saviranta <wnd@iki.fi>

Index: leandro.new/net/dccp/ccids/ccid4.c
=================================--- leandro.new.orig/net/dccp/ccids/ccid4.c
+++ leandro.new/net/dccp/ccids/ccid4.c
@@ -135,6 +135,17 @@ static u32 ccid4_hc_tx_idle_rtt(struct c
 }
 
 /**
+ * ccid4_hc_tx_x_header_penalty  -  Update allower sending rate X
+ * @hctx: half-connection to adjust
+ * This function adjusts sending rate according to [TFRC-SP, Section 5]
+ */
+static inline void ccid4_hc_tx_x_header_penalty(struct ccid4_hc_tx_sock *hctx)
+{
+        hctx->ccid4hctx_x *= hctx->ccid4hctx_s;
+        do_div(hctx->ccid4hctx_x, (hctx->ccid4hctx_s + CCID4HCTX_H));
+}
+
+/**
  * ccid4_hc_tx_update_x  -  Update allowed sending rate X
  * @stamp: most recent time if available - can be left NULL.
  * This function tracks draft rfc3448bis, check there for latest details.
@@ -170,6 +181,7 @@ static void ccid4_hc_tx_update_x(struct 
 		hctx->ccid4hctx_x = max(hctx->ccid4hctx_x,
 					(((__u64)hctx->ccid4hctx_s) << 6) /
 								TFRC_T_MBI);
+                ccid4_hc_tx_x_header_penalty(hctx);
 
 	} else if (ktime_us_delta(now, hctx->ccid4hctx_t_ld)
 				- (s64)hctx->ccid4hctx_rtt >= 0) {
@@ -178,6 +190,8 @@ static void ccid4_hc_tx_update_x(struct 
 			max(min(2 * hctx->ccid4hctx_x, min_rate),
 			    scaled_div(((__u64)hctx->ccid4hctx_s) << 6,
 				       hctx->ccid4hctx_rtt));
+
+                ccid4_hc_tx_x_header_penalty(hctx);
 		hctx->ccid4hctx_t_ld = now;
 	}
 
Index: leandro.new/net/dccp/ccids/ccid4.h
=================================--- leandro.new.orig/net/dccp/ccids/ccid4.h
+++ leandro.new/net/dccp/ccids/ccid4.h
@@ -71,6 +71,11 @@
 /* Mininum sending rate as per CCID-4 draft */
 #define MIN_SEND_RATE              10000
 
+/* The header size on data packets is estimated as 36 bytes as per CCID-4
+ * draft, [Section 5].
+ */
+#define CCID4HCTX_H    36
+
 enum ccid4_options {
 	TFRC_OPT_LOSS_EVENT_RATE = 192,
 	TFRC_OPT_LOSS_INTERVALS	 = 193,

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-11-10 12:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-01  0:30 [PATCH 6/25] Reduce allowed sending rate by a factor that accounts for packet header size Leandro
2007-11-03  6:28 ` Ian McDonald
2007-11-08 10:15 ` Gerrit Renker
2007-11-09 13:14 ` [PATCH 6/25] Reduce allowed sending rate by a factor that Tommi Saviranta
2007-11-09 15:03 ` [PATCH 6/25] Reduce allowed sending rate by a factor that accounts for packet header size Gerrit Renker
2007-11-09 20:46 ` [PATCH 6/25] Reduce allowed sending rate by a factor that Tommi Saviranta
2007-11-10 12:09 ` [PATCH 6/25] Reduce allowed sending rate by a factor that accounts for packet header size Gerrit Renker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.