Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 May 2001 15:00:47 -0700
From:      jayanth <jayanth@yahoo-inc.com>
To:        net@FreeBSD.ORG
Cc:        jlemon@flugsvamp.com
Subject:   t/tcp behaviour has changed in -current and -stable 
Message-ID:  <20010510150047.F45897@yahoo-inc.com>

next in thread | raw e-mail | index | archive | help
I would like to back out the DELAY_ACK macro changes
for now.
The ttcp code behaviour has changed because of the
addition of the DELAY_ACK macro. 
The macro is forcing the ttcp code to send an immediate
SYN, ACK  for an initial ttcp segment which has the
SYN/FIN/PSH flag set.
Instead the SYN,ACK should be delayed such that
next segment should be SYN/FIN/PSH from the server side.

Change the macro to 
	DELAY_ACK(tp) \
		(tcp_delack_enabled)
instead of 
#define DELAY_ACK(tp) \
        	(tcp_delack_enabled && !callout_pending(tp->tt_delack))

All version before r1.124 seem to work fine
http://www.FreeBSD.org/cgi/cvsweb.cgi/src/sys/netinet/tcp_input.c.diff?r1=1.123
&r2=1.124&f=h

> 
> /* TTCP Code in tcp_input.c*/
> 	if ((to.to_flag & TOF_CC) != 0) {
>                     if (((tp->t_flags & TF_NOPUSH) != 0) &&
>                         taop->tao_cc != 0 && CC_GT(to.to_cc, taop->tao_cc)) {
>                         taop->tao_cc = to.to_cc;
>                         tp->t_starttime = ticks;
>                         tp->t_state = TCPS_ESTABLISHED;
> 			/* 
>                          * If there is a FIN, or if there is data and the
>                          * connection is local, then delay SYN,ACK(SYN) in
>                          * the hope of piggy-backing it on a response
>                          * segment.  Otherwise must send ACK now in case
>                          * the other side is slow starting.
>                          */
>                         if (DELAY_ACK(tp) && ((thflags & TH_FIN) ||
>                             (tlen != 0 &&
>                             in_localaddr(inp->inp_faddr)))) {
>                                 callout_reset(tp->tt_delack, tcp_delacktime,
>                                     tcp_timer_delack, tp);
>                                 tp->t_flags |= TF_NEEDSYN;
> 				^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> At this point NEEDSYN is set and so is the delack timer....
> 
>                         } else
>                                 tp->t_flags |= (TF_ACKNOW | TF_NEEDSYN);
> 
> ....................................................
> 
> if (thflags & TH_FIN) {
>                 if (TCPS_HAVERCVDFIN(tp->t_state) == 0) {  
>                         socantrcvmore(so);
>                         /*
>                          *  If connection is half-synchronized
>                          *  (ie NEEDSYN flag on) then delay ACK,  
>                          *  so it may be piggybacked when SYN is sent.
>                          *  Otherwise, since we received a FIN then no
>                          *  more input can be expected, send ACK now.
>                          */
>                         if (DELAY_ACK(tp) && (tp->t_flags & TF_NEEDSYN))
> 			^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> At this point the DELAY_ACK macro returns false because there is a 
> callout_pending(). Hence the TF_ACKNOW will be set.
> 			^^^^^^^^^^^^^
> 
>                                 callout_reset(tp->tt_delack, tcp_delacktime,
>                                     tcp_timer_delack, tp);
>                         else
>                                 tp->t_flags |= TF_ACKNOW;
> 

jayanth

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




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