Discussion:
CVS commit: src
(too old to reply)
YAMAMOTO Takashi
2006-10-10 09:31:34 UTC
Permalink
Module Name: src
Committed By: rpaulo
Date: Mon Oct 9 16:27:08 UTC 2006
src/distrib/sets/lists/comp: mi
src/lib/libc/gen: sysctl.3
src/share/man/man9: Makefile
src/sys/netinet: files.netinet tcp.h tcp_input.c tcp_output.c
tcp_subr.c tcp_timer.c tcp_usrreq.c tcp_var.h
src/share/man/man9: tcp_congctl.9
src/sys/netinet: tcp_congctl.c tcp_congctl.h
Modular (I tried ;-) TCP congestion control API. Whenever certain conditions
happen in the TCP stack, this interface calls the specified callback to
handle the situation according to the currently selected congestion
control algorithm.
A new sysctl node was created: net.inet.tcp.congctl.{available,selected}
with obvious meanings.
The old net.inet.tcp.newreno MIB was removed.
The API is discussed in tcp_congctl(9).
In the near future, it will be possible to selected a congestion control
algorithm on a per-socket basis.
Discussed on tech-net and reviewed by <yamt>.
tcp_reno_newack does:

if (SEQ_GEQ(th->th_ack, tp->snd_recover))
tp->snd_cwnd = min(cw + incr, TCP_MAXWIN << tp->snd_scale);

but snd_recover is not updated unless we're doing fast retransmit.
what's the intention of the code?

YAMAMOTO Takashi

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Rui Paulo
2006-10-10 10:01:41 UTC
Permalink
Post by YAMAMOTO Takashi
if (SEQ_GEQ(th->th_ack, tp->snd_recover))
tp->snd_cwnd = min(cw + incr, TCP_MAXWIN << tp->snd_scale);
but snd_recover is not updated unless we're doing fast retransmit.
what's the intention of the code?
I'm sorry, that was a huge typo.
I think the correct code is:

Index: tcp_congctl.c
===================================================================
RCS file: /cvsroot/src/sys/netinet/tcp_congctl.c,v
retrieving revision 1.1
diff -u -p -r1.1 tcp_congctl.c
--- tcp_congctl.c 9 Oct 2006 16:27:07 -0000 1.1
+++ tcp_congctl.c 10 Oct 2006 10:01:38 -0000
@@ -491,24 +491,21 @@ tcp_reno_fast_retransmit_newack(struct t
static void
tcp_reno_newack(struct tcpcb *tp, struct tcphdr *th)
{
- u_int cw;
- u_int incr;
-
/*
* When new data is acked, open the congestion window.
* If the window gives us less than ssthresh packets
* in flight, open exponentially (segsz per packet).
* Otherwise open linearly: segsz per window
- * (segsz^2 / cwnd per packet), plus a constant
- * fraction of a packet (segsz/8) to help larger windows
- * open quickly enough.
+ * (segsz^2 / cwnd per packet).
*/
- cw = tp->snd_cwnd;
- incr = tp->t_segsz;
- if (cw > tp->snd_ssthresh)
+
+ u_int cw = tp->snd_cwnd;
+ u_int incr = tp->t_segsz;
+
+ if (cw > = tp->snd_ssthresh)
incr = incr * incr / cw;
- if (SEQ_GEQ(th->th_ack, tp->snd_recover))
- tp->snd_cwnd = min(cw + incr, TCP_MAXWIN << tp->snd_scale);
+
+ tp->snd_cwnd = min(cw + incr, TCP_MAXWIN << tp->snd_scale);
}
struct tcp_congctl tcp_reno_ctl = {
@@ -610,22 +607,14 @@ tcp_newreno_fast_retransmit_newack(struc
static void
tcp_newreno_newack(struct tcpcb *tp, struct tcphdr *th)
{
- u_int cw;
- u_int incr;
-
/*
- * When new data is acked, open the congestion window.
- * If the window gives us less than ssthresh packets
- * in flight, open exponentially (segsz per packet).
- * Otherwise open linearly: segsz per window
- * (segsz^2 / cwnd per packet), plus a constant
- * fraction of a packet (segsz/8) to help larger windows
- * open quickly enough.
+ * If we are still in fast recovery (meaning we are using
+ * NewReno and we have only received partial acks), do not
+ * inflate the window yet.
*/
- cw = tp->snd_cwnd;
- incr = tp->t_segsz;
- if (cw > tp->snd_ssthresh)
- incr = incr * incr / cw;
+
+ if (tp->t_partialacks < 0)
+ tcp_reno_newack(tp, th);
}


--
Rui Paulo



--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
YAMAMOTO Takashi
2006-10-10 10:34:19 UTC
Permalink
Post by Rui Paulo
+ if (cw > = tp->snd_ssthresh)
s/> =/>=/

otherwise seems fine to me.

YAMAMOTO Takashi

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...