
             Excerpt from SMUG of Montreal's March 1988 Newsletter
                               Vol. 4  No. 5

                              MODEM PROTOCOLS
                           By: Frances Fontaine

     Modem  Protocols  are basically a standardized set of rules  used  for
modem  communications,  which is handled by the communications program that
you  are using.  The protocols were set up to facilitate data transfer  and
eliminate garbled communications via modem.
     One  of the first modem protocols for microcomputers was developed  by
Ward Christensen and it is called "XMODEM".
     XMODEM transmits in packets of 128 characters.  After the first packet
is  sent  an  acknowledgement  of the reception of the  packet  has  to  be
received  before  the  next  packet of 128  characters  can  be  sent.  The
acknowledgement  signal is one of three things, "ACK" (Acknowledge),  "NAK"
(Negative  Acknowledge) or Time Out which means that some of  the  previous
characters has not been received after a specific time period.
     "ACK"  means  that the first packet received was alright and  now  the
next packet can be sent. "NAK" means that the machine on the receiving  end
has detected an error in the packet and is awaiting retransmission of  that
packet.  Timeout  can mean almost anything happened,  including  the  "ACK"
being garbled.
     Following  is  an explanation of how XMODEM verifies the  transmission
for errors.
     XMODEM  transmissions  start  with an ASCII character "SOH"  known  as
Start  of  Header,  followed  by the binary representation  of  the  packet
number.  The  first  packet of course would be numbered 1,  so  the  binary
representation  would  be "00000001".  This then would be followed  by  the
one's compliment of the packet number.  Which means that one's are  changed
to zeros and zeros are changed to ones.  So the compliment to one would be,
"11111110" which represents 254 or FE in hexadecimal.
      Packet  numbers are sent like this to check for redundancy.  A binary
function known as "exclusive or" checks the bits and if the results are all
zeros then the packet number was received correctly. Then it checks to make
sure the number you get is the next one it was expecting.
     Once the packet header is sent the following 128 characters are  those
of  the actual file being transmitted,  which is then followed by an  error
detection byte or bytes.
     XMODEM  uses the "Checksum" method of detecting errors.  The  checksum
simply  counts  up  the  number of 1 bits of the  packet  being  sent,  the
receiving  machine  then  compares  it's checksum with  the  one  sent,  to
determine  whether  or  not there are errors in the  data  being  received.
However,  if  there  is more than one "glitch" on  the  phone  line  during
transmission the errors may even out the checksum, and get received by  the
receiving  machine as OK. Thereby evoking an "ACK" signal to be sent,  when
in fact it was garbled in transmission.
     Another  method  used to detect transmission errors is  known  as  CRC
(Cumulo  Redundancy Check).  This is a mathematical algorithm that operates
on  data to come up with a number.  This number is then used as  the  error
detection  bytes as it is 2 bytes long (16 bits),  whereas the checksum  is
only  one byte or 8 bits long.  CRC has proven to be a more effective error
detection method than the checksum method is.
     The  next modem protocol to come along was known as YMODEM which  uses
most  of XMODEM's features along with other enhancements.  YMODEM transmits
packets  of  1024  characters which reduces the  number  of  packets  being
transmitted and also the waiting for acknowledgments since there are fewer.
It  also had a "Header Packet" which included the name of the file and  the
size of the file being sent.
     Following  that was BATCH YMODEM which allowed a bunch of files to  be
sent all at once, and also the use of "Wildcard characters".
     ZMODEM  incorporates  all  of  the  features  from  all  the  previous
protocols and is downwardly compatible.
     Then there's a protocol which allows micros to communicate with  minis
and  mainframes.  This  protocol  is known as KERMIT and was  developed  by
students at Columbia University of New York.
     Many  good communications programs available today will include one or
more of these protocols.
     Some of the best communications programs on the market today are to be
found right here in SMUG of Montreal's public domain library.  In MS-DOS we
have Telix,  Procomm,  QMODEM and PC-DIAL available from the public domain.
According  to  many  SysOps the best communications  program  available  is
Telix.
     In  CP/M we have MEX and KERMIT which are both patched or with patches
to  run on the SVI-328.  These are also available from SMUG  of  Montreal's
public domain library.
     Have  fun communicating with each other via modem.  Try not to get too
hooked to it, as your phone bill may bare the consequences
