Why 3 and 7? (was Re: patching uucico)

Greg Andrews gandrews at netcom.COM
Sun Jun 9 16:30:22 AEST 1991

In article <1991Jun8.205320.2659 at highspl> burris at highspl (David Burris) writes:
>> Well, uucp "g" can't go above a window size of 7, as I mentioned in my
>> last article.  
>Yes, the max is seven, though it doesn't seem it needs to be. The
>value used for the window size is a char. There are two spots where
>the code checks for != 0 and two spots where the code sets the window
>size back to 3 if it is greater than 7. If one wanted to find the
>spots to patch the checks for greater that 7, it could be patched to
>window_size = BUFSIZ/64. Check your /usr/include/stdio.h file for

Oh?  A simple patch will allow packet ID numbers greater than 7?  Take a
look at the code that extracts the packet number from the received data
bytes.  Surprise!

As has meen mentioned in a previous article (not mine), the uucp "g"
protocol uses a SINGLE BYTE to send the packet information.  There are
five other bytes in the packet header, but they don't carry the info
for the window.  For data packets that byte contains three pieces of 

  o The packet type (most significant two bits)
  o The packet identification number (next most significant three bits)
  o The ID number of the last acked packet (least significant three bits)

So, for data packets, there are only three bits in the ID field.  That means
packets can only have eight ID numbers, zero through seven.

A windowed protocol must NEVER have a window size equal to or greater than
the packet numbering scheme.  The window size must ALWAYS be at least one 
less than the packet numbering scheme.  Since uucp "g" uses eight packet
numbers (because the packet counter is three-bits wide), the window size
cannot be larger than 7.

You can patch your tests to check if the packet number is equal to 8, or 9
or 23 if you like, but all it will do is give you a BROKEN protocol.  You
can't use more than eight packet ID numbers, so you can't use a window
larger than 7.

Someone could certainly patch their system to insert an extra byte as the
packet counter and use window sizes up to 255, but so what?  It wouldn't
be uucp "g" anymore.  It would be a new protocol incompatible with all other
uucp systems.

>David Burris					Aurora,Il.
>burris at highspl		           ..!linac!highspl!burris

 |  Greg Andrews   |       UUCP: {apple,amdahl,claris}!netcom!gandrews    |
 |                 |   Internet: gandrews at netcom.COM                      |

More information about the Comp.sys.3b1 mailing list