From van@helios.ee.lbl.gov  Mon Jun  5 11:20:58 1989
Posted-Date: Mon, 05 Jun 89 11:23:05 PDT
Received-Date: Mon, 5 Jun 89 11:20:58 -0700
Received: from [128.3.112.2] by venera.isi.edu (5.61/5.51)
	id <AA06491>; Mon, 5 Jun 89 11:20:58 -0700
Received: by helios.ee.lbl.gov (5.59/s2.2)
	id AA04329; Mon, 5 Jun 89 11:23:06 PDT
Message-Id: <8906051823.AA04329@helios.ee.lbl.gov>
To: nowicki@sun.com (Bill Nowicki)
Cc: end2end@venera.isi.edu
Subject: Re: Obscure TCP implementation question 
In-Reply-To: Your message of Tue, 16 May 89 15:49:22 PDT.
Date: Mon, 05 Jun 89 11:23:05 PDT
From: Van Jacobson <van@helios.ee.lbl.gov>
Status: R

You're right Bill, that was a bug (I must have had a lot of
brandy that night since the ssthresh initialization (the next
line in the code) was correct.  Since tcp_output always
calculates a window of min(snd_wnd, snd_cwnd), snd_cwnd can be
initialized to MAXINT (which, since it's currently in a u_short,
is 65535).  The code in tcp_mss will take care of trimming
snd_cwnd back to one segment if the destination is not on the
local network (this forces a slow-start).  Here's what the code
looks like now (the XXX is to remind me to change the
initialization when we expand all the windows to 32 bits):

*** /tmp/,RCSt1a04320	Mon Jun  5 11:20:30 1989
--- /sys/netinet/tcp_subr.c	Mon Jun  5 11:08:42 1989
***************
*** 187,191 ****
  	    ((TCPTV_SRTTBASE >> 2) + (TCPTV_SRTTDFLT << 2)) >> 1,
  	    TCPTV_MIN, TCPTV_REXMTMAX);
! 	tp->snd_cwnd = sbspace(&inp->inp_socket->so_snd);
  	tp->snd_ssthresh = 65535;		/* XXX */
  	inp->inp_ppcb = (caddr_t)tp;
--- 187,191 ----
  	    ((TCPTV_SRTTBASE >> 2) + (TCPTV_SRTTDFLT << 2)) >> 1,
  	    TCPTV_MIN, TCPTV_REXMTMAX);
! 	tp->snd_cwnd = 65535;			/* XXX */
  	tp->snd_ssthresh = 65535;		/* XXX */
  	inp->inp_ppcb = (caddr_t)tp;

