Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 04 Sep 1999 09:50:26 -0700
From:      bmah@CA.Sandia.GOV (Bruce A. Mah)
To:        freebsd-net@freebsd.org
Cc:        bmah@CA.Sandia.GOV
Subject:   RFC 2414 patch
Message-ID:  <199909041650.JAA05434@stennis.ca.sandia.gov>

next in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Hi all--

The experimental RFC 2414 specifies "an increase in the permitted 
initial window for TCP from one segment to roughly 4K bytes".  The RFC 
explains the various issues far better than I could.

Mostly as an intellectual exercise, I wrote up a small patch for RFC
2414 support, which can be enabled or disabled via a sysctl (it defaults
to "disabled", of course).  This patch applies against 3.2-RELEASE.

I've attached the patch in the hope that it'll be useful to someone. I
don't know enough about the issues to advocate a position for or against
including it in the source tree, but tcpdump verified that it at least
did what it I thought it was supposed to do.

Cheers,

Bruce.

PS.  It's about the start of a new semester/quarter/term for most 
schools.  Doing a few experiments with this might make a nice, 
tractable class project for someone, after appropriate researching of 
the literature to see what's already been done.

PPS.  Also, if either Scott Shenker of ACIRI or Hui Zhang of CMU is
interested in doing something with this and want a co-author on any
resulting SIGCOMM submission, they can let me know.



[-- Attachment #2 --]
diff -c -r sys/netinet/tcp_input.c sys.new/netinet/tcp_input.c
*** sys/netinet/tcp_input.c	Tue Apr 20 12:09:15 1999
--- sys.new/netinet/tcp_input.c	Wed Jun  2 16:57:12 1999
***************
*** 88,93 ****
--- 88,97 ----
  SYSCTL_INT(_net_inet_tcp, OID_AUTO, delayed_ack, CTLFLAG_RW, 
  	&tcp_delack_enabled, 0, "");
  
+ int tcp_do_rfc2414 = 0;
+ SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC2414, rfc2414,
+ 	CTLFLAG_RW, &tcp_do_rfc2414 , 0, "Use RFC 2414 initial windows");
+ 
  u_long	tcp_now;
  struct inpcbhead tcb;
  struct inpcbinfo tcbinfo;
***************
*** 2200,2206 ****
  	 * Don't force slow-start on local network.
  	 */
  	if (!in_localaddr(inp->inp_faddr))
! 		tp->snd_cwnd = mss;
  
  	if (rt->rt_rmx.rmx_ssthresh) {
  		/*
--- 2204,2210 ----
  	 * Don't force slow-start on local network.
  	 */
  	if (!in_localaddr(inp->inp_faddr))
! 		tp->snd_cwnd = tcp_init_cwnd(mss);
  
  	if (rt->rt_rmx.rmx_ssthresh) {
  		/*
***************
*** 2228,2231 ****
--- 2232,2248 ----
  		return tcp_mssdflt;
  
  	return rt->rt_ifp->if_mtu - sizeof(struct tcpiphdr);
+ }
+ 
+ /*
+  * Compute initial cwnd according to RFC 2414, if applicable.
+  */
+ int
+ tcp_init_cwnd(mss)
+ 	int mss;
+ {
+ 	if (!tcp_do_rfc2414)
+ 		return mss;
+ 	else
+ 		return min(4 * mss, max(2 * mss, 4380));
  }
Only in sys.new/netinet: tcp_input.c~
diff -c -r sys/netinet/tcp_output.c sys.new/netinet/tcp_output.c
*** sys/netinet/tcp_output.c	Wed Apr  7 15:25:52 1999
--- sys.new/netinet/tcp_output.c	Wed Jun  2 17:29:19 1999
***************
*** 98,105 ****
  		 * We have been idle for "a while" and no acks are
  		 * expected to clock out any data we send --
  		 * slow start to get ack "clock" running again.
  		 */
! 		tp->snd_cwnd = tp->t_maxseg;
  again:
  	sendalot = 0;
  	off = tp->snd_nxt - tp->snd_una;
--- 98,108 ----
  		 * We have been idle for "a while" and no acks are
  		 * expected to clock out any data we send --
  		 * slow start to get ack "clock" running again.
+ 		 * Note: RFC 2414 should never increase snd_cwnd 
+ 		 * here.
  		 */
! 		tp->snd_cwnd = min(tp->snd_cwnd,
! 				   tcp_init_cwnd(tp->t_maxseg));
  again:
  	sendalot = 0;
  	off = tp->snd_nxt - tp->snd_una;
Only in sys.new/netinet: tcp_output.c~
diff -c -r sys/netinet/tcp_var.h sys.new/netinet/tcp_var.h
*** sys/netinet/tcp_var.h	Wed Jan 20 09:32:00 1999
--- sys.new/netinet/tcp_var.h	Wed Jun  2 16:54:37 1999
***************
*** 305,311 ****
  #define	TCPCTL_RECVSPACE	9	/* receive buffer space */
  #define	TCPCTL_KEEPINIT		10	/* receive buffer space */
  #define	TCPCTL_PCBLIST		11	/* list of all outstanding PCBs */
! #define TCPCTL_MAXID		12
  
  #define TCPCTL_NAMES { \
  	{ 0, 0 }, \
--- 305,312 ----
  #define	TCPCTL_RECVSPACE	9	/* receive buffer space */
  #define	TCPCTL_KEEPINIT		10	/* receive buffer space */
  #define	TCPCTL_PCBLIST		11	/* list of all outstanding PCBs */
! #define	TCPCTL_DO_RFC2414	12	/* use RFC-2414 initial cwnd */
! #define TCPCTL_MAXID		13
  
  #define TCPCTL_NAMES { \
  	{ 0, 0 }, \
***************
*** 320,325 ****
--- 321,327 ----
  	{ "recvspace", CTLTYPE_INT }, \
  	{ "keepinit", CTLTYPE_INT }, \
  	{ "pcblist", CTLTYPE_STRUCT }, \
+ 	{ "rfc2414", CTLTYPE_INT }, \
  }
  
  #ifdef KERNEL
***************
*** 342,347 ****
--- 344,350 ----
  struct rmxp_tao *
  	 tcp_gettaocache __P((struct inpcb *));
  void	 tcp_init __P((void));
+ int	 tcp_init_cwnd __P((int mss));
  void	 tcp_input __P((struct mbuf *, int));
  void	 tcp_mss __P((struct tcpcb *, int));
  int	 tcp_mssopt __P((struct tcpcb *));
Only in sys.new/netinet: tcp_var.h~

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199909041650.JAA05434>