From owner-taylor-uucp@gnu.ai.mit.edu Thu Apr 23 07:00:17 1992
Status: RO
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil nil nil nil nil nil nil nil nil nil nil nil "^From:" nil nil nil])
Received: from fuug.fi by dolphin.funet.fi with SMTP id AA03091
  (5.65c/IDA-1.4.3 for ojala); Thu, 23 Apr 1992 07:00:13 +0300
Received: from churchy.gnu.ai.mit.edu by fuug.fi with SMTP id AA22425
  (5.65c/IDA-1.4.4 for <taylor-uucp-list@fuug.fi>); Thu, 23 Apr 1992 06:57:19 +0300
Received: by churchy.gnu.ai.mit.edu (5.65/4.0)
	id <AA04681@churchy.gnu.ai.mit.edu>; Wed, 22 Apr 92 22:01:33 -0400
Received: from relay1.UU.NET by churchy.gnu.ai.mit.edu (5.65/4.0) with SMTP
	id <AA04677@churchy.gnu.ai.mit.edu>; Wed, 22 Apr 92 22:01:30 -0400
Received: from uunet.uu.net (via LOCALHOST.UU.NET) by relay1.UU.NET with SMTP 
	(5.61/UUNET-internet-primary) id AA16135; Wed, 22 Apr 92 22:01:27 -0400
Received: from airs.UUCP by uunet.uu.net with UUCP/RMAIL
	(queueing-rmail) id 220024.9408; Wed, 22 Apr 1992 22:00:24 EDT
Received: by comton.airs.com (5.57/AIRS1.0)
	id AA28470; Wed, 22 Apr 92 21:35:17 -0400
Message-Id: <9204230135.AA28470@comton.airs.com>
In-Reply-To: <199204211851.AA03563@parrot.prv.univie.ac.at>; from "Michael Haberler" at Apr 21, 92 8:51 pm
X-Mailer: ELM [version 2.3 PL11]
From: ian@airs.com (Ian Lance Taylor)
To: mah@ic.co.at
Cc: taylor-uucp@gnu.ai.mit.edu
Subject: Re: Throughput drop/protocol loop
Date: Wed, 22 Apr 92 21:35:16 -0400

Michael Haberler writes:

> - if there are two 1.03's communicating via 'g'
> - there's a transmission error (e.g. unplugging the cable of a direct line
>   for a moment)
> 
> the uucico's get into a protocol loop with very low throughput (the window
> doesnt remain full, as can be seen on the tx/rx leds of the brakout box.
> Sometimes the transmission stops for a timeout period, and restarts with the
> sam strange behaviour.

My slow restart after error code was rather poorly thought out.  After
an error occurred, then if the original window size was greater than
3, the effective window size after the error became 2.  Thanks for
noticing this.

Here is an unofficial patch which should correct that behaviour.  It
seems to be working here, but we never get any errors.  I faked an
error, and it seemed to respond correctly.  I would be interested in
feedback as to how well this works.  It's not a major patch, so it
shouldn't actually break anything.

diff -c -r1.32 protg.c
*** 1.32	1992/04/21 04:21:35
--- protg.c	1992/04/23 01:11:04
***************
*** 967,990 ****
    z[IFRAME_XOR] = (char) (z[IFRAME_K] ^ z[IFRAME_CHECKLOW]
  			  ^ z[IFRAME_CHECKHIGH] ^ z[IFRAME_CONTROL]);
  
!   /* If we've retransmitted a packet, but it hasn't been acked yet,
!      and this isn't the next packet after the retransmitted one (note
!      that iGsendseq has already been incremented at this point) then
!      don't send this packet yet.  The other side is probably not ready
!      for it yet.  Instead, code in fgprocess_data will send the
!      outstanding packets when an ack is received.  */
  
    ++cGsent_packets;
  
!   if (iGretransmit_seq != -1
!       && INEXTSEQ (INEXTSEQ (iGretransmit_seq)) != iGsendseq)
      {
        ++cGdelayed_packets;
        return TRUE;
      }
  
-   iGretransmit_seq = -1;
- 
    DEBUG_MESSAGE2 (DEBUG_PROTO,
  		  "fgsenddata: Sending packet %d (%d bytes)",
  		  CONTROL_XXX (z[IFRAME_CONTROL]), cdata);
--- 967,985 ----
    z[IFRAME_XOR] = (char) (z[IFRAME_K] ^ z[IFRAME_CHECKLOW]
  			  ^ z[IFRAME_CHECKHIGH] ^ z[IFRAME_CONTROL]);
  
!   /* If we're waiting for acks of retransmitted packets, then don't
!      send this packet yet.  The other side may not be ready for it
!      yet.  Instead, code in fggot_ack will send the outstanding
!      packets when an ack is received.  */
  
    ++cGsent_packets;
  
!   if (iGretransmit_seq != -1)
      {
        ++cGdelayed_packets;
        return TRUE;
      }
  
    DEBUG_MESSAGE2 (DEBUG_PROTO,
  		  "fgsenddata: Sending packet %d (%d bytes)",
  		  CONTROL_XXX (z[IFRAME_CONTROL]), cdata);
***************
*** 1248,1254 ****
  
    iGremote_ack = iack;
  
!   if (iack != iGretransmit_seq)
      return TRUE;
  
    inext = INEXTSEQ (iGretransmit_seq);
--- 1243,1249 ----
  
    iGremote_ack = iack;
  
!   if (iGretransmit_seq == -1)
      return TRUE;
  
    inext = INEXTSEQ (iGretransmit_seq);

-- 
Ian Taylor                     ian@airs.com                    uunet!airs!ian
First person to identify this quote wins a free e-mail message:
``Do you make a grievance of weighing so many pounds only, instead of three
  hundred?  Then why fret about living so many years only, instead of more?''

