home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / internet / arcuserman / USERMAN
Encoding:
Text File  |  1992-03-23  |  269.0 KB  |  6,264 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.                         The KA9Q Internet Software Package
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.                           Updated for 890421.1 Revision
  28.  
  29.                                    May 8, 1989
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.                                         by
  43.  
  44.                                Bdale Garbee, N3EUA
  45.  
  46.  
  47.  
  48.                          Copyright 1989 by Bdale Garbee.
  49.                                All Rights Reserved.
  50.  
  51.                      This Document may be reproduced in whole
  52.                     or in part for any non-commercial purpose,
  53.                       as long as credit is given the author.
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                                       - 2 -
  71.  
  72.  
  73.                                   Caveat Emptor
  74.  
  75.      This document is a major rewrite of the document included with  871225.0
  76.      release  of the KA9Q package, but it is in the author's opinion very far
  77.      from perfect. I believe that the bulk of the material here is  factually
  78.      correct,  but the formatting is rough, and there are no doubt some juicy
  79.      tidbits missing that should have been included.
  80.  
  81.      I would greatly appreciate reports of problems with  the  documentation,
  82.      particularly  if  they are accompanied by suggested fixes!  I promise to
  83.      back up the document sources this time  around,  so  that  disk  crashes
  84.      won't  force  me to start over from scratch (which is what happened this
  85.      time...).
  86.  
  87.      If you have comments or suggestions about the documentation, contact  me
  88.      via  email  at  bdale@col.hp.com  on the Internet, ...!winfree!bdale via
  89.      UUCP, or as 76430,3323 on Compuserve.
  90.  
  91.      My profound thanks to the folks who contributed to this release, partic-
  92.      ularly Bob Hoffman N3CVL and Ron Henderson WA7TAS, without whom it would
  93.      have been impossible.
  94.                                                           Bdale Garbee, N3EUA
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.                                       - 3 -
  137.  
  138.  
  139.      1.  Introduction to TCP/IP and the KA9Q Software
  140.  
  141.      This document describes the KA9Q Internet Package, which is an implemen-
  142.      tation  of the network protocol family originally created as part of the
  143.      Arpanet project. The protocol family is commonly refered to as "TCP/IP",
  144.      acronyms for two of the many protocols included.
  145.  
  146.      The KA9Q package is the result of several years of development  by  Phil
  147.      Karn,  KA9Q,  and  his "merry band of implementors". The "TCP group" has
  148.      grown to include hundreds of individuals worldwide, many  of  whom  have
  149.      contributed  ideas  and  software to this release. All of the sources to
  150.      the software are included, and  interested  parties  are  encouraged  to
  151.      experiment  and  contribute changes resulting from their efforts back to
  152.      the group. This is discussed further in the technical appendix.
  153.  
  154.      1.1.  An Overview of the TCP/IP Protocol Family
  155.  
  156.      Following is an overview of the protocol family supported  by  the  KA9Q
  157.      package.   While reading this section will give you a wonderful overview
  158.      of what's going on, you can feel free to skip ahead and try out the pro-
  159.      gram  first,  then  come  back  and  read this section to flesh out your
  160.      understanding.
  161.  
  162.      1.1.1.  Acknowledgement
  163.  
  164.      The material in this section was adapted  from  a  document  written  by
  165.      Charles L. Hedrick, of RUTGERS, The State University of New Jersey.  The
  166.      original document was Copyright 1987 by  Charles  L.  Hedrick,  and  the
  167.      material excerpted for this section is used by permission.
  168.  
  169.      1.1.2.  Introduction
  170.  
  171.      This document is a brief introduction to TCP/IP, followed by  advice  on
  172.      what  to  read  for more information. This  is  not  intended  to  be  a
  173.      complete  description. It  can  give  you   a  reasonable  idea  of  the
  174.      capabilities  of  the  protocols. But if you need to know any details of
  175.      the  technology, you  will  want  to  read   the   standards   yourself.
  176.      Throughout  the  text, you will find references to the standards, in the
  177.      form of "RFC" or "IEN" numbers. These are document  numbers.  The  final
  178.      section  of  this   document  tells  you how  to  get  copies  of  those
  179.      standards.
  180.  
  181.      1.1.3.  What is TCP/IP?
  182.  
  183.      TCP/IP  is a set of protocols developed to allow  cooperating  computers
  184.      to share resources across a network. It was developed by a  community of
  185.      researchers centered around the ARPAnet. Certainly the  ARPAnet  is  the
  186.      best-known  TCP/IP  network. However as of June, 87, at  least  130 dif-
  187.      ferent  vendors  had products that support TCP/IP, and thousands of net-
  188.      works  of  all  kinds  use  it. Over time, the original ARPAnet has been
  189.      phased out, and is being replaced by a variety of networks  running  the
  190.      same protocols loosely referred to as "The Internet".
  191.  
  192.      First some basic definitions. The most accurate name for  the   set   of
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.                                       - 4 -
  203.  
  204.  
  205.      protocols we are describing is the "Internet protocol suite". TCP and IP
  206.      are two of the protocols in this  suite.   (They   will   be   described
  207.      below.)  Because  TCP and IP are the best known of the protocols, it has
  208.      become common to use the term TCP/IP or IP/TCP  to  refer  to  the whole
  209.      family.  It  is probably not worth fighting this habit. However this can
  210.      lead to some oddities. For example, I  find  myself  talking about   NFS
  211.      as  being  based  on  TCP/IP, even though it doesn't use TCP at all. (It
  212.      does use IP. But it  uses  an  alternative  protocol,  UDP, instead   of
  213.      TCP.  All  of  this  alphabet  soup will be unscrambled in the following
  214.      pages.)
  215.  
  216.      The Internet is a  collection  of  networks,  including   the   Arpanet,
  217.      NSFnet,  regional  networks such as NYsernet, local networks at a number
  218.      of University and research institutions,  and  a  number   of   military
  219.      networks.  The  term  "Internet" applies to this entire set of networks.
  220.      The subset of them that is managed by the  Department  of   Defense   is
  221.      referred   to   as  the "DDN" (Defense Data Network). This includes some
  222.      research-oriented networks, such as  the  Arpanet,  as  well   as   more
  223.      strictly  military  ones. (Because much of the funding for Internet pro-
  224.      tocol developments is done via   the   DDN   organization,   the   terms
  225.      Internet  and  DDN  can  sometimes  seem  equivalent.) All of these net-
  226.      works are connected to each other. Users can  send  messages   from  any
  227.      of  them  to  any other, except where there are security or other policy
  228.      restrictions on access. Officially  speaking,   the   Internet  protocol
  229.      documents   are   simply  standards  adopted  by  the Internet community
  230.      for its own use. More recently, the Department   of   Defense  issued  a
  231.      MILSPEC  definition  of  TCP/IP.  This  was intended to be a more formal
  232.      definition, appropriate for use in  purchasing  specifications.  However
  233.      most  of  the  TCP/IP community continues to use the Internet standards.
  234.      The MILSPEC version is intended to be consistent with it.
  235.  
  236.      Whatever it is called, TCP/IP is a family of protocols.  A  few  provide
  237.      "low-level"  functions  needed  for many applications. These include IP,
  238.      TCP, and UDP. (These will be described in a bit  more   detail   later.)
  239.      Others  are  protocols for doing specific tasks, e.g. transferring files
  240.      between computers, sending mail, or finding out who is  logged   in   on
  241.      another    computer. Initially  TCP/IP  was  used  mostly  between mini-
  242.      computers or mainframes. These machines had their own disks,   and  gen-
  243.      erally   were  self-contained.  Thus  the  most  important "traditional"
  244.      TCP/IP services are:
  245.  
  246.         - file transfer.  The file transfer protocol (FTP) allows a user on
  247.           any computer to get files from another computer, or to send files
  248.           to another computer.  Security is handled by requiring  the  user
  249.           to  specify  a  user  name  and  password for the other computer.
  250.           Provisions are made for handling file transfer  between  machines
  251.           with different character set, end of line conventions, etc.  This
  252.           is not quite the same thing as more recent "network file  system"
  253.           or  "netbios"  protocols, which will be described below.  Rather,
  254.           FTP is a utility that you run any time you want to access a  file
  255.           on  another  system.    You  use  it to copy the file to your own
  256.           system.  You then work with the local copy.   (See  RFC  959  for
  257.           specifications for FTP.)
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.                                       - 5 -
  269.  
  270.  
  271.         - remote  login.    The network terminal protocol (TELNET) allows a
  272.           user to log in on any other computer on the network.  You start a
  273.           remote session by specifying a computer to connect to.  From that
  274.           time until you finish the session, anything you type is  sent  to
  275.           the  other  computer.   Note that you are really still talking to
  276.           your own computer.  But the telnet program effectively makes your
  277.           computer invisible while it is running.  Every character you type
  278.           is sent directly to the other system.  Generally, the  connection
  279.           to  the  remote  computer  behaves much like a dialup connection.
  280.           That is, the remote system will ask you to  log  in  and  give  a
  281.           password, in whatever manner it would normally ask a user who had
  282.           just dialed it up.  When you log off of the other  computer,  the
  283.           telnet  program exits, and you will find yourself talking to your
  284.           own computer.  Microcomputer implementations of telnet  generally
  285.           include  a  terminal  emulator  for some common type of terminal.
  286.           (See RFC's 854 and 855 for specifications for  telnet.    By  the
  287.           way,  the  telnet protocol should not be confused with Telenet, a
  288.           vendor of commercial network services.)
  289.  
  290.         - computer mail.  This allows you to  send  messages  to  users  on
  291.           other  computers.    Originally, people tended to use only one or
  292.           two specific computers.  They  would  maintain  "mail  files"  on
  293.           those machines.  The computer mail system is simply a way for you
  294.           to add a message to another user's mail file.    There  are  some
  295.           problems  with  this  in  an environment where microcomputers are
  296.           used.  The most serious is that a micro is  not  well  suited  to
  297.           receive  computer  mail.    When you send mail, the mail software
  298.           expects to be able  to  open  a  connection  to  the  addressee's
  299.           computer, in order to send the mail.  If this is a microcomputer,
  300.           it may be turned off, or it may be running an  application  other
  301.           than  the mail system.  For this reason, mail is normally handled
  302.           by a larger system, where it is practical to have a  mail  server
  303.           running all the time.  Microcomputer mail software then becomes a
  304.           user interface that retrieves mail from the mail  server.    (See
  305.           RFC  821  and  822 for specifications for computer mail.  See RFC
  306.           937 for a protocol designed for microcomputers to use in  reading
  307.           mail from a mail server.)
  308.  
  309.      These  services  should  be  present  in any implementation  of  TCP/IP,
  310.      except  that  micro-oriented implementations may  not  support  computer
  311.      mail. These traditional applications still play a very important role in
  312.      TCP/IP-based  networks. However more recently,  the  way  in  which net-
  313.      works  are  used has been changing. The  older  model  of  a  number  of
  314.      large,  self-sufficient  computers  is  beginning  to  change. Now  many
  315.      installations    have    several   kinds   of    computers,    including
  316.      microcomputers, workstations, minicomputers, and  mainframes. These com-
  317.      puters  are  likely  to be  configured  to  perform  specialized  tasks.
  318.      Although  people  are still likely to work with one  specific  computer,
  319.      that  computer  will  call on other systems on the net  for  specialized
  320.      services.  This  has   led  to  the  "server/client"  model  of  network
  321.      services. A server is a system that provides a specific service for  the
  322.      rest  of  the network. A client is another system  that  uses  that ser-
  323.      vice. (Note  that the server and client need not be on different comput-
  324.      ers.   They  could  be   different   programs   running   on   the  same
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.                                       - 6 -
  335.  
  336.  
  337.      computer.) Here  are  the  kinds  of  servers  typically  present  in  a
  338.      modern  computer  setup.  Note that these computer services can  all  be
  339.      provided within the framework of TCP/IP.
  340.  
  341.         - network  file  systems.   This allows a system to access files on
  342.           another computer in a somewhat more  closely  integrated  fashion
  343.           than FTP.  A network file system provides the illusion that disks
  344.           or other devices from one system are directly connected to  other
  345.           systems.    There  is no need to use a special network utility to
  346.           access a file on another system.  Your computer simply thinks  it
  347.           has  some  extra disk drives.  These extra "virtual" drives refer
  348.           to the other system's disks.    This  capability  is  useful  for
  349.           several different purposes.  It lets you put large disks on a few
  350.           computers, but still give others access to the disk space.  Aside
  351.           from the obvious economic benefits, this allows people working on
  352.           several computers  to  share  common  files.    It  makes  system
  353.           maintenance  and  backup  easier, because you don't have to worry
  354.           about updating  and  backing  up  copies  on  lots  of  different
  355.           machines.    A  number  of  vendors  now  offer  high-performance
  356.           diskless computers.  These computers have no disk drives at  all.
  357.           They  are  entirely dependent upon disks attached to common "file
  358.           servers".   (See  RFC's  1001  and  1002  for  a  description  of
  359.           PC-oriented   NetBIOS   over   TCP.     In  the  workstation  and
  360.           minicomputer area, Sun's Network File System is more likely to be
  361.           used.    Protocol  specifications  for  it are available from Sun
  362.           Microsystems.)
  363.  
  364.         - remote printing.  This allows you to  access  printers  on  other
  365.           computers  as if they were directly attached to yours.  (The most
  366.           commonly used protocol is the remote  lineprinter  protocol  from
  367.           Berkeley  Unix.  Unfortunately, there is no protocol document for
  368.           this.  However the C code is easily obtained  from  Berkeley,  so
  369.           implementations are common.)
  370.  
  371.         - remote  execution.   This allows you to request that a particular
  372.           program be run on a different computer.  This is useful when  you
  373.           can  do  most  of  your work on a small computer, but a few tasks
  374.           require the resources of a larger system.  There are a number  of
  375.           different  kinds  of remote execution.  Some operate on a command
  376.           by command basis.  That is, you request that a  specific  command
  377.           or  set  of commands should run on some specific computer.  (More
  378.           sophisticated versions will choose a system that  happens  to  be
  379.           free.)    However  there are also "remote procedure call" systems
  380.           that allow a program to  call  a  subroutine  that  will  run  on
  381.           another  computer.    (There  are  many  protocols  of this sort.
  382.           Berkeley Unix contains two servers to execute commands  remotely:
  383.           rsh  and  rexec.   The man pages describe the protocols that they
  384.           use.  The user-contributed software with Berkeley 4.3 contains  a
  385.           "distributed  shell"  that  will  distribute tasks among a set of
  386.           systems, depending upon load.  Remote procedure  call  mechanisms
  387.           have  been  a  topic  for research for a number of years, so many
  388.           organizations have implementations of such facilities.  The  most
  389.           widespread commercially-supported remote procedure call protocols
  390.           seem to be Xerox's Courier and Sun's RPC.  Protocol documents are
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.                                       - 7 -
  401.  
  402.  
  403.           available  from  Xerox and Sun.  There is a public implementation
  404.           of Courier over TCP as part of the user-contributed software with
  405.           Berkeley  4.3.   An implementation of RPC was posted to Usenet by
  406.           Sun, and also appears as part of  the  user-contributed  software
  407.           with Berkeley 4.3.)
  408.  
  409.         - name  servers.    In  large  installations, there are a number of
  410.           different collections of names that have to  be  managed.    This
  411.           includes  users  and their passwords, names and network addresses
  412.           for computers, and accounts.  It becomes  very  tedious  to  keep
  413.           this data up to date on all of the computers.  Thus the databases
  414.           are kept on a small number of systems.  Other systems access  the
  415.           data over the network.  (RFC 822 and 823 describe the name server
  416.           protocol used to keep track of host names and Internet  addresses
  417.           on  the  Internet.    This  is  now a required part of any TCP/IP
  418.           implementation.  IEN 116 describes an older name server  protocol
  419.           that is used by a few terminal servers and other products to look
  420.           up host names.  Sun's  Yellow  Pages  system  is  designed  as  a
  421.           general  mechanism to handle user names, file sharing groups, and
  422.           other databases commonly used by Unix  systems.    It  is  widely
  423.           available  commercially.    Its  protocol definition is available
  424.           from Sun.)
  425.  
  426.         - terminal servers.  Many installations no longer connect terminals
  427.           directly  to  computers.    Instead they connect them to terminal
  428.           servers.  A terminal server is simply a small computer that  only
  429.           knows  how  to  run  telnet  (or some other protocol to do remote
  430.           login).  If your terminal is  connected  to  one  of  these,  you
  431.           simply  type the name of a computer, and you are connected to it.
  432.           Generally it is possible to have active connections to more  than
  433.           one  computer  at  the  same time.  The terminal server will have
  434.           provisions to switch between connections rapidly, and  to  notify
  435.           you  when  output  is  waiting for another connection.  (Terminal
  436.           servers use the telnet protocol, already mentioned.  However  any
  437.           real terminal server will also have to support name service and a
  438.           number of other protocols.)
  439.  
  440.         - network-oriented  window  systems.      Until   recently,   high-
  441.           performance  graphics  programs had to execute on a computer that
  442.           had  a  bit-mapped  graphics  screen  directly  attached  to  it.
  443.           Network  window  systems  allow  a  program to use a display on a
  444.           different computer.  Full-scale network window systems provide an
  445.           interface  that  lets you distribute jobs to the systems that are
  446.           best  suited  to  handle  them,  but  still  give  you  a  single
  447.           graphically-based  user  interface.  (The most widely-implemented
  448.           window system is X. A  protocol  description  is  available  from
  449.           MIT's  Project  Athena.  A reference implementation is publically
  450.           available from MIT.  A number  of  vendors  are  also  supporting
  451.           NeWS,  a window system defined by Sun.  Both of these systems are
  452.           designed to use TCP/IP.)
  453.  
  454.      Note that some of the  protocols  described  above  were   designed   by
  455.      Berkeley,   Sun,   or other organizations.  Thus they are not officially
  456.      part of the Internet protocol suite.   However  they   are   implemented
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.                                       - 8 -
  467.  
  468.  
  469.      using   TCP/IP,  just as normal TCP/IP application protocols are.  Since
  470.      the protocol definitions are not  considered  proprietary,   and   since
  471.      commercially-support   implementations   are  widely  available,  it  is
  472.      reasonable to think of these protocols as being  effectively   part   of
  473.      the   Internet   suite.   Note that the list above is simply a sample of
  474.      the sort of services  available  through  TCP/IP.    However   it   does
  475.      contain    the   majority  of  the  "major"  applications.    The  other
  476.      commonly-used protocols tend to be specialized facilities  for   getting
  477.      information   of   various  kinds, such as who is logged in, the time of
  478.      day, etc.  However if you need a facility that is not listed  here,   we
  479.      encourage   you   to  look  through  the  current  edition  of  Internet
  480.      Protocols (currently RFC 1011),  which  lists  all  of   the   available
  481.      protocols,    and    also   to   look   at  some  of  the  major  TCP/IP
  482.      implementations to see what various vendors have added.
  483.  
  484.      1.1.4.  General description of the TCP/IP protocols
  485.  
  486.      TCP/IP is a layered set of protocols.  In  order  to   understand   what
  487.      this   means,   it is useful to look at an example.  A typical situation
  488.      is sending mail.  First, there is a protocol for mail.  This  defines  a
  489.      set   of   commands which one machine sends to another, e.g. commands to
  490.      specify who the sender of the message is, who it is being sent  to,  and
  491.      then   the   text  of  the  message.  However this protocol assumes that
  492.      there is a way to communicate  reliably  between  the   two   computers.
  493.      Mail,   like   other  application  protocols,  simply  defines  a set of
  494.      commands and messages to be sent.  It is designed to be  used   together
  495.      with   TCP  and IP. TCP is responsible for making sure that the commands
  496.      get through to the other end.  It keeps track of  what  is   sent,   and
  497.      retransmitts  anything  that did not get through.  If any message is too
  498.      large for one datagram, e.g. the text of the mail, TCP will   split   it
  499.      up   into   several  datagrams,  and  make  sure  that  they  all arrive
  500.      correctly.  Since these functions are needed  for   many   applications,
  501.      they  are  put together into a separate protocol, rather than being part
  502.      of the specifications for sending mail.   You  can  think  of   TCP   as
  503.      forming  a  library of routines that applications can use when they need
  504.      reliable network communications with another computer.   Similarly,  TCP
  505.      calls   on  the services of IP.  Although the services that TCP supplies
  506.      are needed by  many  applications,  there  are  still  some   kinds   of
  507.      applications   that   don't  need them.  However there are some services
  508.      that every application needs.  So these services are put  together  into
  509.      IP.     As   with TCP, you can think of IP as a library of routines that
  510.      TCP calls on, but which is also available to applications   that   don't
  511.      use   TCP.     This  strategy  of building several levels of protocol is
  512.      called "layering".  We think of  the  applications  programs   such   as
  513.      mail,   TCP,  and IP, as being separate "layers", each of which calls on
  514.      the services of the layer below it.   Generally,   TCP/IP   applications
  515.      use 4 layers:
  516.  
  517.         - an application protocol such as mail
  518.  
  519.         - a  protocol  such  as  TCP  that  provides  services need by many
  520.           applications
  521.  
  522.         - IP, which provides the basic  service  of  getting  datagrams  to
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.                                       - 9 -
  533.  
  534.  
  535.           their destination
  536.  
  537.         - the  protocols  needed to manage a specific physical medium, such
  538.           as Ethernet or a point to point line.
  539.  
  540.      TCP/IP is based on the "catenet model".  (This is  described   in   more
  541.      detail   in   IEN 48.)  This model assumes that there are a large number
  542.      of independent networks connected together  by  gateways.     The   user
  543.      should   be  able to access computers or other resources on any of these
  544.      networks.   Datagrams  will  often  pass  through  a   dozen   different
  545.      networks   before   getting  to  their  final  destination.  The routing
  546.      needed to accomplish this should be completely invisible to  the   user.
  547.      As   far   as  the  user  is concerned, all he needs to know in order to
  548.      access another system is an "Internet address".  This  is   an   address
  549.      that  looks  like 128.6.4.194.  It is actually a 32-bit number.  However
  550.      it is normally written as 4 decimal numbers, each representing  8   bits
  551.      of   the   address.  (The term "octet" is used by Internet documentation
  552.      for such 8-bit chunks.  The term "byte" is not used, because  TCP/IP  is
  553.      supported   by   some computers that have byte sizes other than 8 bits.)
  554.      Generally the structure of the  address  gives  you   some   information
  555.      about   how   to  get  to  the  system.  For example, 128.6 is a network
  556.      number assigned by a central authority to Rutgers  University.   Rutgers
  557.      uses   the   next  octet  to  indicate  which of the campus Ethernets is
  558.      involved.  128.6.4 happens to be an  Ethernet  used  by   the   Computer
  559.      Science   Department.     The last octet allows for up to 254 systems on
  560.      each Ethernet.  (It is 254 because 0 and  255  are  not   allowed,   for
  561.      reasons   that   will  be  discussed  later.)  Note that 128.6.4.194 and
  562.      128.6.5.194 would be different systems.  The structure of  an   Internet
  563.      address is described in a bit more detail later.
  564.  
  565.      Of  course  we  normally  refer  to  systems  by  name, rather  than  by
  566.      Internet  address.   When we specify a name, the network software  looks
  567.      it  up  in  a  database,  and comes up with the  corresponding  Internet
  568.      address.   Most  of the network software deals strictly in terms of  the
  569.      address.  (RFC 882 describes the name server technology used  to  handle
  570.      this lookup.)
  571.  
  572.      TCP/IP is  built  on  "connectionless"  technology.     Information   is
  573.      transfered   as   a sequence of "datagrams".  A datagram is a collection
  574.      of data that is sent as a single message.  Each of these  datagrams   is
  575.      sent   through   the network individually.  There are provisions to open
  576.      connections (i.e.  to start a conversation that will continue  for  some
  577.      time).     However  at some level, information from those connections is
  578.      broken up into datagrams, and  those  datagrams  are  treated   by   the
  579.      network   as   completely  separate.    For example, suppose you want to
  580.      transfer a 15000 octet file.  Most networks can't handle a  15000  octet
  581.      datagram.    So  the protocols will break this up into something like 30
  582.      500-octet datagrams.  Each of these datagrams  will  be  sent   to   the
  583.      other   end.     At  that point, they will be put back together into the
  584.      15000-octet file.  However while those datagrams are in   transit,   the
  585.      network  doesn't  know that there is any connection between them.  It is
  586.      perfectly possible  that  datagram  14  will  actually   arrive   before
  587.      datagram   13.     It is also possible that somewhere in the network, an
  588.      error will occur, and some datagram won't get through at all.   In  that
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.                                       - 10 -
  599.  
  600.  
  601.      case, that datagram has to be sent again.
  602.  
  603.      Note  by  the way that the terms "datagram" and "packet" often  seem  to
  604.      be  nearly  interchangable.  Technically, datagram is the right word  to
  605.      use  when  describing  TCP/IP.  A datagram is a unit of data,  which  is
  606.      what  the  protocols deal with.  A packet is a physical thing, appearing
  607.      on an Ethernet or some wire.  In most cases a packet simply  contains  a
  608.      datagram,  so  there is  very  little  difference.    However  they  can
  609.      differ.  When TCP/IP is used on top of X.25, the X.25  interface  breaks
  610.      the  datagrams  up into 128-byte packets.   This  is  invisible  to  IP,
  611.      because  the  packets  are put back together into a single  datagram  at
  612.      the  other  end before being processed by TCP/IP.  So in this case,  one
  613.      IP  datagram  would  be carried by several packets.  However  with  most
  614.      media,  there  are efficiency advantages to  sending  one  datagram  per
  615.      packet, and so the distinction tends to vanish.
  616.  
  617.      Two separate protocols are involved in handling TCP/IP  datagrams.   TCP
  618.      (the  "transmission  control protocol") is responsible for  breaking  up
  619.      the  message  into  datagrams,  reassembling  them  at  the  other  end,
  620.      resending  anything  that gets lost, and  putting  things  back  in  the
  621.      right  order.  IP (the "internet protocol") is responsible  for  routing
  622.      individual  datagrams.   It may seem like TCP is  doing  all  the  work.
  623.      And  in  small networks that is true.  However in the  Internet,  simply
  624.      getting  a  datagram to its  destination  can  be  a  complex  job.    A
  625.      connection  may require the datagram to go through several  networks  at
  626.      Rutgers,  a  serial line to the John von Neuman Supercomputer Center,  a
  627.      couple  of Ethernets there, a series of 56Kbaud phone lines  to  another
  628.      NSFnet  site,  and more Ethernets on another campus.  Keeping  track  of
  629.      the  routes  to all of the destinations and  handling  incompatibilities
  630.      among different transport media turns out to be a complex job.    Note
  631.  
  632.      that  the  interface  between TCP and IP is fairly simple.   TCP  simply
  633.      hands  IP  a datagram with a destination.   IP  doesn't  know  how  this
  634.      datagram relates to any datagram before it or after it.
  635.  
  636.      It  may  have occurred to you that something is missing here.   We  have
  637.      talked  about  Internet addresses, but not about how you keep  track  of
  638.      multiple  connections  to  a given system.  Clearly it isn't  enough  to
  639.      get  a  datagram to the right  destination.    TCP  has  to  know  which
  640.      connection  this  datagram  is  part  of.  This task is referred  to  as
  641.      "demultiplexing."   In  fact, there are several levels of demultiplexing
  642.      going  on in TCP/IP.  The information needed to do  this  demultiplexing
  643.      is  contained  in a series of "headers".  A header is simply a few extra
  644.      octets  tacked  onto  the  beginning of a datagram by some  protocol  in
  645.      order  to  keep track of it.  It's a lot like putting a letter  into  an
  646.      envelope  and  putting  an  address  on  the  outside of  the  envelope.
  647.      Except  with  modern networks it happens several times.  It's  like  you
  648.      put the letter into a little envelope, your secretary puts that  into  a
  649.      somewhat  bigger  envelope, the campus mail center  puts  that  envelope
  650.      into a still bigger one, etc.  Here is an overview of the  headers  that
  651.      get stuck on a message that passes through a typical TCP/IP network:
  652.  
  653.      We start with a single data stream, say a file you are trying  to   send
  654.      to some other computer:
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.                                       - 11 -
  665.  
  666.  
  667.         ......................................................
  668.  
  669.      TCP  breaks  it  up into manageable chunks.  (In order to do  this,  TCP
  670.      has  to  know how large a datagram your network can handle.    Actually,
  671.      the TCP's at each end say how big a datagram they can handle,  and  then
  672.      they pick the smallest size.)
  673.  
  674.         ....   ....   ....   ....   ....   ....   ....   ....
  675.  
  676.      TCP puts a header at the front of each datagram.  This  header  actually
  677.      contains   at  least 20 octets, but the most important ones are a source
  678.      and destination "port number" and  a  "sequence  number".     The   port
  679.      numbers   are  used to keep track of different conversations.  Suppose 3
  680.      different people are transferring files.  Your TCP might  allocate  port
  681.      numbers 1000, 1001, and 1002 to these transfers.  When you are sending a
  682.      datagram, this becomes the "source" port number,  since  you   are   the
  683.      source   of   the  datagram.    Of  course  the TCP at the other end has
  684.      assigned a port number of its own for the conversation.  Your  TCP   has
  685.      to   know  the port number used by the other end as well.  (It finds out
  686.      when the connection starts, as we will explain below.)  It   puts   this
  687.      in   the   "destination" port field.  Of course if the other end sends a
  688.      datagram back to you, the source and destination port numbers  will   be
  689.      reversed,   since   then  it  will  be  the  source  and you will be the
  690.      destination.  Each datagram has a sequence number.  This  is   used   so
  691.      that   the   other  end  can make sure that it gets the datagrams in the
  692.      right  order,  and  that  it  hasn't  missed  any.    (See    the    TCP
  693.      specification  for  details.)  TCP doesn't number the datagrams, but the
  694.      octets.  So if there are 500 octets of  data  in  each   datagram,   the
  695.      first  datagram  might be numbered 0, the second 500, the next 1000, the
  696.      next 1500, etc.  Finally, I will mention the  Checksum.    This   is   a
  697.      number   that   is  computed by adding up all the octets in the datagram
  698.      (more or less - see the TCP spec).  The result is put in   the   header.
  699.      TCP   at   the other end computes the checksum again.  If they disagree,
  700.      then something bad happened to the datagram in transmission, and  it  is
  701.      thrown away.  So here's what the datagram looks like now.
  702.  
  703.          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  704.          |          Source Port          |       Destination Port        |
  705.          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  706.          |                        Sequence Number                        |
  707.          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  708.          |                    Acknowledgment Number                      |
  709.          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  710.          |  Data |           |U|A|P|R|S|F|                               |
  711.          | Offset| Reserved  |R|C|S|S|Y|I|            Window             |
  712.          |       |           |G|K|H|T|N|N|                               |
  713.          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  714.          |           Checksum            |         Urgent Pointer        |
  715.          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  716.          |   your data ... next 500 octets                               |
  717.          |   ......                                                      |
  718.  
  719.      If  we abbreviate the TCP header as "T", the whole file now  looks  like
  720.      this:
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.                                       - 12 -
  731.  
  732.  
  733.         T....   T....   T....   T....   T....   T....   T....
  734.  
  735.      You will note that there are items in  the  header  that  I   have   not
  736.      described   above.     They  are  generally  involved  with managing the
  737.      connection.  In order to make sure the datagram  has  arrived   at   its
  738.      destination,   the   recipient  has  to  send back an "acknowledgement".
  739.      This is a datagram whose "Acknowledgement number" field is  filled   in.
  740.      For   example,   sending  a  packet  with  an  acknowledgement  of  1500
  741.      indicates that you have received all the data up to octet  number  1500.
  742.      If   the   sender  doesn't  get  an  acknowledgement within a reasonable
  743.      amount of time, it sends the data  again.    The  window  is   used   to
  744.      control   how   much  data can be in transit at any one time.  It is not
  745.      practical to wait for each datagram to be acknowledged  before   sending
  746.      the   next   one.    That would slow things down too much.  On the other
  747.      hand, you can't just keep sending, or a fast  computer   might   overrun
  748.      the   capacity   of  a slow one to absorb data.  Thus each end indicates
  749.      how much new data it is currently prepared to absorb  by   putting   the
  750.      number   of   octets  in  its  "Window" field.  As the computer receives
  751.      data, the amount of space left in its window decreases.  When  it   goes
  752.      to   zero,  the sender has to stop.  As the receiver processes the data,
  753.      it increases its window, indicating that it is ready  to   accept   more
  754.      data.   Often  the same datagram can be used to acknowledge receipt of a
  755.      set of data and to give permission for  additional  new  data   (by   an
  756.      updated   window).   The "Urgent" field allows one end to tell the other
  757.      to skip ahead in its processing to a particular octet.  This  is   often
  758.      useful   for   handling asynchronous events, for example when you type a
  759.      control character or other command that interrupts output.   The   other
  760.      fields are beyond the scope of this document.
  761.  
  762.      1.1.5.  The IP level
  763.  
  764.      TCP  sends each of these datagrams to IP.  Of course it has to  tell  IP
  765.      the  Internet  address of the computer at the other end.  Note that this
  766.      is  all  IP  is concerned about.  It doesn't care about what is  in  the
  767.      datagram,  or  even in the TCP header.  IP's job is  simply  to  find  a
  768.      route for the datagram and get it to the other end.  In order  to  allow
  769.      gateways  or  other intermediate systems to  forward  the  datagram,  it
  770.      adds  its  own  header.  The main things in this header are  the  source
  771.      and  destination  Internet address (32-bit addresses, like 128.6.4.194),
  772.      the  protocol  number,  and  another  checksum.    The  source  Internet
  773.      address  is  simply the address of your machine.  (This is necessary  so
  774.      the  other  end  knows where the datagram came from.)   The  destination
  775.      Internet  address  is the address  of  the  other  machine.    (This  is
  776.      necessary  so  any  gateways  in  the  middle  know where you  want  the
  777.      datagram  to  go.)  The protocol number tells IP at  the  other  end  to
  778.      send  the  datagram  to TCP.  Although most IP traffic uses  TCP,  there
  779.      are  other  protocols that can use IP, so you  have  to  tell  IP  which
  780.      protocol  to send the datagram to.  Finally, the checksum allows  IP  at
  781.      the  other  end to verify that the header  wasn't  damaged  in  transit.
  782.      Note  that TCP and IP have separate checksums.  IP needs to be  able  to
  783.      verify that the header didn't get damaged in transit, or it could send a
  784.      message to the wrong place.  For reasons not worth discussing  here,  it
  785.      is  both  more  efficient  and  safer to have  TCP  compute  a  separate
  786.      checksum  for  the  TCP  header  and  data.  Once IP has tacked  on  its
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.                                       - 13 -
  797.  
  798.  
  799.      header, here's what the message looks like:
  800.  
  801.          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  802.          |Version|  IHL  |Type of Service|          Total Length         |
  803.          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  804.          |         Identification        |Flags|      Fragment Offset    |
  805.          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  806.          |  Time to Live |    Protocol   |         Header Checksum       |
  807.          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  808.          |                       Source Address                          |
  809.          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  810.          |                    Destination Address                        |
  811.          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  812.          |  TCP header, then your data ......                            |
  813.          |                                                               |
  814.  
  815.      If we represent the IP header by an "I",  your  file  now   looks   like
  816.      this:
  817.  
  818.         IT....   IT....   IT....   IT....   IT....   IT....   IT....
  819.  
  820.      Again,  the  header contains some additional fields that have  not  been
  821.      discussed.   Most  of them are beyond the scope of this document.    The
  822.      flags  and fragment offset are used to keep track of the pieces  when  a
  823.      datagram  has  to be split up.   This  can  happen  when  datagrams  are
  824.      forwarded through a network for which they are too big.  (This  will  be
  825.      discussed  a  bit more below.)  The time to live is  a  number  that  is
  826.      decremented  whenever  the  datagram passes through a system.   When  it
  827.      goes  to  zero, the datagram is discarded.  This is done in case a  loop
  828.      develops  in the system somehow.  Of course this should  be  impossible,
  829.      but   well-designed   networks  are  built  to  cope  with  "impossible"
  830.      conditions.
  831.  
  832.      At this point, it's possible that no more headers are needed.   If  your
  833.      computer  happens  to have a direct phone  line  connecting  it  to  the
  834.      destination  computer,  or  to  a  gateway,  it  may  simply   send  the
  835.      datagrams  out  on the line (though likely a synchronous  protocol  such
  836.      as  HDLC  would be used, and it would add at least a few octets  at  the
  837.      beginning and end).
  838.  
  839.      1.1.6.  The Ethernet level
  840.  
  841.      However most of our networks these days use Ethernet.  So now  we   have
  842.      to   describe   Ethernet's headers.  Unfortunately, Ethernet has its own
  843.      addresses.  The people who designed Ethernet wanted to make  sure   that
  844.      no   two   machines  would  end  up  with  the  same  Ethernet  address.
  845.      Furthermore, they  didn't  want  the  user  to  have  to   worry   about
  846.      assigning   addresses.     So  each  Ethernet  controller  comes with an
  847.      address builtin from the factory.  In order to  make  sure   that   they
  848.      would   never  have to reuse addresses, the Ethernet designers allocated
  849.      48 bits for the Ethernet address.  People who make  Ethernet   equipment
  850.      have   to   register  with  a  central  authority, to make sure that the
  851.      numbers they assign don't overlap any other manufacturer.  Ethernet is a
  852.      "broadcast  medium".   That  is,  it is in effect like an old party line
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.                                       - 14 -
  863.  
  864.  
  865.      telephone.  When you send a packet out on the Ethernet,  every   machine
  866.      on   the   network sees the packet.  So something is needed to make sure
  867.      that the right machine gets it.  As you might guess, this  involves  the
  868.      Ethernet   header.     Every  Ethernet packet has a 14-octet header that
  869.      includes the source and destination Ethernet address, and a  type  code.
  870.      Each  machine  is supposed to pay attention only to packets with its own
  871.      Ethernet address in the destination field.  (It's   perfectly   possible
  872.      to   cheat,   which  is  one reason that Ethernet communications are not
  873.      terribly secure.)  Note  that  there  is  no  connection   between   the
  874.      Ethernet  address  and the Internet address.  Each machine has to have a
  875.      table of what Ethernet address corresponds to what   Internet   address.
  876.      (We   will   describe  how  this  table is constructed a bit later.)  In
  877.      addition to the addresses, the header contains a type code.   The   type
  878.      code  is  to allow for several different protocol families to be used on
  879.      the same network.  So you can use TCP/IP, DECnet, Xerox  NS,   etc.   at
  880.      the   same   time.   Each of them will put a different value in the type
  881.      field.  Finally,  there  is  a  checksum.    The   Ethernet   controller
  882.      computes  a  checksum of the entire packet.  When the other end receives
  883.      the packet, it recomputes the checksum, and throws the packet  away   if
  884.      the   answer   disagrees  with the original.  The checksum is put on the
  885.      end of the packet, not in the header.  The final result is   that   your
  886.      message looks like this:
  887.  
  888.          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  889.          |       Ethernet destination address (first 32 bits)            |
  890.          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  891.          | Ethernet dest (last 16 bits)  |Ethernet source (first 16 bits)|
  892.          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  893.          |       Ethernet source address (last 32 bits)                  |
  894.          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  895.          |        Type code              |
  896.          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  897.          |  IP header, then TCP header, then your data                   |
  898.          |                                                               |
  899.              ...
  900.          |                                                               |
  901.          |   end of your data                                            |
  902.          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  903.          |                       Ethernet Checksum                       |
  904.          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  905.  
  906.      If  we  represent  the  Ethernet  header  with  "E",  and  the  Ethernet
  907.      checksum with "C", your file now looks like this:
  908.  
  909.         EIT....C   EIT....C   EIT....C   EIT....C   EIT....C
  910.  
  911.      When these packets are received by the other end, of  course   all   the
  912.      headers   are   removed.    The  Ethernet interface removes the Ethernet
  913.      header and the checksum.  It looks at the type code.  Since   the   type
  914.      code   is  the one assigned to IP, the Ethernet device driver passes the
  915.      datagram up to IP.  IP removes the IP header.   It  looks  at   the   IP
  916.      protocol   field.     Since  the  protocol  type  is  TCP, it passes the
  917.      datagram up to TCP.  TCP now looks at the sequence number.     It   uses
  918.      the   sequence   numbers  and  other  information  to  combine  all  the
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.                                       - 15 -
  929.  
  930.  
  931.      datagrams into the original file.
  932.  
  933.      The ends our initial summary of TCP/IP.  There are still  some   crucial
  934.      concepts  we  haven't gotten to, so we'll now go back and add details in
  935.      several areas.  (For detailed descriptions of the items  discussed  here
  936.      see,   RFC   793  for  TCP,  RFC  791  for IP, and RFC's 894 and 826 for
  937.      sending IP over Ethernet.)
  938.  
  939.      1.1.7.  Well-known sockets and the applications layer
  940.  
  941.      So far, we have described how a stream  of  data  is  broken   up   into
  942.      datagrams,   sent   to another computer, and put back together.  However
  943.      something more is needed  in  order  to  accomplish   anything   useful.
  944.      There   has   to  be  a  way for you to open a connection to a specified
  945.      computer, log into it, tell it what file you  want,  and   control   the
  946.      transmission   of   the  file.   (If you have a different application in
  947.      mind, e.g. computer mail, some analogous protocol is needed.)   This  is
  948.      done   by   "application  protocols".  The application protocols run "on
  949.      top" of TCP/IP.  That is, when they want to send a message,  they   give
  950.      the   message   to  TCP.   TCP makes sure it gets delivered to the other
  951.      end.  Because TCP and IP take care of all the networking  details,   the
  952.      applications   protocols  can treat a network connection as if it were a
  953.      simple byte stream, like a terminal or phone line.
  954.  
  955.      Before going into more details about applications programs, we  have  to
  956.      describe  how  you find an application.  Suppose you want to send a file
  957.      to a computer whose Internet address  is  128.6.4.7.    To   start   the
  958.      process,   you   need  more than just the Internet address.  You have to
  959.      connect to the FTP server at the  other  end.    In   general,   network
  960.      programs   are   specialized  for a specific set of tasks.  Most systems
  961.      have separate programs  to  handle  file  transfers,   remote   terminal
  962.      logins,  mail,  etc.  When you connect to 128.6.4.7, you have to specify
  963.      that you want to talk to the FTP server.    This  is  done   by   having
  964.      "well-known   sockets"   for  each  server.    Recall that TCP uses port
  965.      numbers to keep track of  individual  conversations.     User   programs
  966.      normally   use  more or less random port numbers.  However specific port
  967.      numbers are assigned to the programs that sit  waiting   for   requests.
  968.      For   example,   if  you  want  to send a file, you will start a program
  969.      called "ftp".  It will open a connection using some random  number,  say
  970.      1234,   for   the  port number on its end.  However it will specify port
  971.      number 21 for the other end.  This is the official port number  for  the
  972.      FTP  server.   Note that there are two different programs involved.  You
  973.      run ftp on your side.  This is a program designed to   accept   commands
  974.      from   your   terminal  and  pass them on to the other end.  The program
  975.      that you talk to on the other machine  is  the  FTP  server.     It   is
  976.      designed   to   accept commands from the network connection, rather than
  977.      an interactive terminal.  There is no need for your program to   use   a
  978.      well-known   socket   number  for  itself.  Nobody is trying to find it.
  979.      However the servers have to have well-known numbers,  so   that   people
  980.      can   open   connections  to  them and start sending them commands.  The
  981.      official  port  numbers  for  each  program  are  given   in   "Assigned
  982.      Numbers".
  983.  
  984.      Note  that  a  connection is actually described by a set of  4  numbers:
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.                                       - 16 -
  995.  
  996.  
  997.      the  Internet  address at each end, and the TCP port number at each end.
  998.      Every  datagram  has  all  four of those numbers in it.   (The  Internet
  999.      addresses  are  in the IP header, and the TCP port numbers  are  in  the
  1000.      TCP header.)  In order to keep things straight, no two  connections  can
  1001.      have  the  same set of numbers.  However it is enough for any one number
  1002.      to  be  different.    For  example,  it  is perfectly possible  for  two
  1003.      different  users  on a machine to be sending files  to  the  same  other
  1004.      machine.    This  could  result  in  connections  with   the   following
  1005.      parameters:
  1006.  
  1007.                         Internet addresses         TCP ports
  1008.          connection 1  128.6.4.194, 128.6.4.7      1234, 21
  1009.          connection 2  128.6.4.194, 128.6.4.7      1235, 21
  1010.  
  1011.      Since the same machines are involved, the Internet addresses   are   the
  1012.      same.     Since   they  are  both  doing  file transfers, one end of the
  1013.      connection involves the well-known port number  for  FTP.     The   only
  1014.      thing   that   differs is the port number for the program that the users
  1015.      are running.  That's enough of a difference.  Generally, at  least   one
  1016.      end   of   the  connection asks the network software to assign it a port
  1017.      number that is guaranteed to be unique.   Normally,  it's   the   user's
  1018.      end, since the server has to use a well-known number.
  1019.  
  1020.      Now  that  we  know  how  to  open  connections, let's get back  to  the
  1021.      applications  programs.   As mentioned earlier, once TCP  has  opened  a
  1022.      connection,  we  have  something  that might as well be a  simple  wire.
  1023.      All  the  hard parts are handled by TCP and IP.  However we  still  need
  1024.      some  agreement  as  to  what we send over this connection.   In  effect
  1025.      this  is  simply an agreement on what set of  commands  the  application
  1026.      will  understand,  and  the  format  in  which  they  are  to  be  sent.
  1027.      Generally,  what  is sent is a combination of commands and data.    They
  1028.      use  context  to  differentiate.  For example, the mail  protocol  works
  1029.      like  this:  Your mail program opens a connection to the mail server  at
  1030.      the  other end.  Your program gives it your machine's name,  the  sender
  1031.      of the message, and the recipients you want it sent to.  It then sends a
  1032.      command saying that it is starting the  message.   At  that  point,  the
  1033.      other  end   stops  treating  what  it  sees  as  commands,  and  starts
  1034.      accepting  the  message.  Your end then starts sending the text  of  the
  1035.      message.   At  the end of the message, a special mark is sent (a dot  in
  1036.      the first column).  After that, both ends understand that  your  program
  1037.      is  again  sending commands.  This is the simplest way to do things, and
  1038.      the one that most applications use.
  1039.  
  1040.      File  transfer  is  somewhat more complex.  The file  transfer  protocol
  1041.      involves  two  different connections.  It starts  out  just  like  mail.
  1042.      The user's program sends commands like "log me in as this  user",  "here
  1043.      is  my  password", "send me the file with this name".  However once  the
  1044.      command  to  send  data is sent, a second connection is opened  for  the
  1045.      data  itself.   It would certainly be possible to send the data  on  the
  1046.      same  connection,  as  mail does.  However file transfers often  take  a
  1047.      long  time.   The designers of the  file  transfer  protocol  wanted  to
  1048.      allow  the  user  to  continue  issuing commands while the  transfer  is
  1049.      going  on.   For example, the user might make an inquiry,  or  he  might
  1050.      abort  the  transfer.    Thus  the designers felt it was best to  use  a
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.                                       - 17 -
  1061.  
  1062.  
  1063.      separate  connection  for  the  data  and  leave  the  original  command
  1064.      connection  for  commands.    (It  is  also  possible  to  open  command
  1065.      connections  to  two different computers, and tell them to send  a  file
  1066.      from  one  to  the other.  In that case, the data couldn't go  over  the
  1067.      command connection.)
  1068.  
  1069.      Remote terminal connections use another mechanism still.    For   remote
  1070.      logins,   there   is just one connection.  It normally sends data.  When
  1071.      it is necessary to send a command (e.g. to set the terminal type  or  to
  1072.      change   some   mode),  a special character is used to indicate that the
  1073.      next character is a command.  If the user happens to type  that  special
  1074.      character as data, two of them are sent.
  1075.  
  1076.      We  are  not  going to describe the application protocols in  detail  in
  1077.      this  document.   It's better to read the RFC's yourself.  However there
  1078.      are  a  couple of common conventions used by applications that  will  be
  1079.      described  here.   First, the common network representation:  TCP/IP  is
  1080.      intended  to  be  usable  on  any  computer.    Unfortunately,  not  all
  1081.      computers  agree  on how data is represented.  There are differences  in
  1082.      character  codes  (ASCII  vs.  EBCDIC),  in  end  of   line  conventions
  1083.      (carriage  return,  line feed, or a representation using counts), and in
  1084.      whether  terminals expect characters to be sent individually or  a  line
  1085.      at  a  time.   In  order  to  allow  computers  of  different  kinds  to
  1086.      communicate,   each   applications   protocol   defines    a    standard
  1087.      representation.     Note   that  TCP  and  IP  do  not  care  about  the
  1088.      representation.    TCP  simply  sends octets.  However the  programs  at
  1089.      both  ends  have to agree on how the octets are to be interpreted.   The
  1090.      RFC  for  each  application  specifies the standard  representation  for
  1091.      that  application.   Normally it  is  "net  ASCII".    This  uses  ASCII
  1092.      characters,  with end of line denoted by a carriage return followed by a
  1093.      line  feed.   For  remote  login,  there  is  also  a  definition  of  a
  1094.      "standard terminal", which turns out to be a half-duplex  terminal  with
  1095.      echoing  happening  on the local machine.  Most applications  also  make
  1096.      provisions  for  the  two  computers to agree on  other  representations
  1097.      that  they  may find more convenient.  For example, PDP-10's have 36-bit
  1098.      words.    There  is a way that two PDP-10's can agree to send  a  36-bit
  1099.      binary  file.   Similarly, two systems that prefer full-duplex  terminal
  1100.      conversations  can  agree  on  that.    However each application  has  a
  1101.      standard representation, which every machine must support.
  1102.  
  1103.      1.1.8.  An example application: SMTP
  1104.  
  1105.      In order to give a bit better idea what is involved in  the  application
  1106.      protocols,   I'm   going  to  show an example of SMTP, which is the mail
  1107.      protocol.  (SMTP is "simple mail transfer protocol.)  We assume  that  a
  1108.      computer called TOPAZ.RUTGERS.EDU wants to send the following message.
  1109.  
  1110.        Date: Sat, 27 Jun 87 13:26:31 EDT
  1111.        From: hedrick@topaz.rutgers.edu
  1112.        To: levy@red.rutgers.edu
  1113.        Subject: meeting
  1114.  
  1115.        Let's get together Monday at 1pm.
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.                                       - 18 -
  1127.  
  1128.  
  1129.      First,  note  that the format of the message itself is described  by  an
  1130.      Internet  standard  (RFC 822).  The standard specifies the fact that the
  1131.      message  must be transmitted as net ASCII (i.e. it must be  ASCII,  with
  1132.      carriage  return/linefeed  to delimit lines).   It  also  describes  the
  1133.      general  structure, as a group of header lines, then a blank  line,  and
  1134.      then  the  body of the message.  Finally, it describes the syntax of the
  1135.      header  lines in detail.  Generally they consist of a keyword and then a
  1136.      value.
  1137.  
  1138.      Note  that  the  addressee  is  indicated    as    LEVY@RED.RUTGERS.EDU.
  1139.      Initially,   addresses  were simply "person at machine".  However recent
  1140.      standards have made things more flexible.  There  are   now   provisions
  1141.      for   systems   to handle other systems' mail.  This can allow automatic
  1142.      forwarding on behalf of computers not connected to the  Internet.     It
  1143.      can  be  used to direct mail for a number of systems to one central mail
  1144.      server.  Indeed there is no requirement that an actual computer  by  the
  1145.      name   of  RED.RUTGERS.EDU even exist.  The name servers could be set up
  1146.      so that you mail to department names, and each  department's   mail   is
  1147.      routed   automatically  to an appropriate computer.  It is also possible
  1148.      that the part before the @ is something other than a user name.   It  is
  1149.      possible   for   programs  to be set up to process mail.  There are also
  1150.      provisions  to  handle  mailing  lists,  and  generic  names   such   as
  1151.      "postmaster" or "operator".
  1152.  
  1153.      The  way  the  message is to be sent to another system is  described  by
  1154.      RFC's  821  and 974.  The program that is going to be doing the  sending
  1155.      asks  the  name server several queries to determine where to  route  the
  1156.      message.   The  first query is to find out which  machines  handle  mail
  1157.      for  the  name RED.RUTGERS.EDU.  In this case, the server  replies  that
  1158.      RED.RUTGERS.EDU  handles  its own mail.  The program then asks  for  the
  1159.      address of RED.RUTGERS.EDU, which is 128.6.4.2.  Then the  mail  program
  1160.      opens  a  TCP connection to port 25  on  128.6.4.2.    Port  25  is  the
  1161.      well-known  socket  used  for receiving mail.  Once this  connection  is
  1162.      established,  the  mail program starts sending  commands.    Here  is  a
  1163.      typical  conversation.  Each line is labelled as to whether it  is  from
  1164.      TOPAZ or RED.  Note that TOPAZ initiated the connection:
  1165.  
  1166.               RED    220 RED.RUTGERS.EDU SMTP Service at 29 Jun  87  05:17:18
  1167.           EDT
  1168.               TOPAZ  HELO topaz.rutgers.edu
  1169.               RED    250 RED.RUTGERS.EDU - Hello, TOPAZ.RUTGERS.EDU
  1170.               TOPAZ  MAIL From:<hedrick@topaz.rutgers.edu>
  1171.               RED    250 MAIL accepted
  1172.               TOPAZ  RCPT To:<levy@red.rutgers.edu>
  1173.               RED    250 Recipient accepted
  1174.               TOPAZ  DATA
  1175.               RED    354 Start mail input; end with <CRLF>.<CRLF>
  1176.               TOPAZ  Date: Sat, 27 Jun 87 13:26:31 EDT
  1177.               TOPAZ  From: hedrick@topaz.rutgers.edu
  1178.               TOPAZ  To: levy@red.rutgers.edu
  1179.               TOPAZ  Subject: meeting
  1180.               TOPAZ
  1181.               TOPAZ  Let's get together Monday at 1pm.
  1182.               TOPAZ  .
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.                                       - 19 -
  1193.  
  1194.  
  1195.               RED    250 OK
  1196.               TOPAZ  QUIT
  1197.               RED    221 RED.RUTGERS.EDU Service closing transmission channel
  1198.  
  1199.      First, note that commands all use normal text.  This is typical  of  the
  1200.      Internet   standards.     Many  of  the  protocols  use  standard  ASCII
  1201.      commands.  This makes it easy  to  watch  what  is  going  on   and   to
  1202.      diagnose   problems.   For example, the mail program keeps a log of each
  1203.      conversation.  If something goes wrong, the log  file  can   simply   be
  1204.      mailed   to   the  postmaster.  Since it is normal text, he can see what
  1205.      was going on.  It also allows a human to interact  directly   with   the
  1206.      mail   server,   for  testing.  (Some newer protocols are complex enough
  1207.      that this is not practical.  The commands would have to have  a   syntax
  1208.      that  would  require a significant parser.  Thus there is a tendency for
  1209.      newer protocols to use binary formats.  Generally they  are   structured
  1210.      like   C  or Pascal record structures.)  Second, note that the responses
  1211.      all begin with numbers.  This is also typical of   Internet   protocols.
  1212.      The   allowable   responses  are  defined  in the protocol.  The numbers
  1213.      allow the user program to respond unambiguously.    The  rest   of   the
  1214.      response   is   text,  which is normally for use by any human who may be
  1215.      watching or looking at a log.  It has no effect on  the   operation   of
  1216.      the   programs.   (However there is one point at which the protocol uses
  1217.      part of the text of the response.)   The  commands   themselves   simply
  1218.      allow   the   mail  program  on  one  end  to  tell  the mail server the
  1219.      information it needs to know in order to deliver the message.   In  this
  1220.      case,   the   mail  server  could  get the information by looking at the
  1221.      message itself.  But for more complex cases, that would not   be   safe.
  1222.      Every   session   must  begin  with  a HELO, which gives the name of the
  1223.      system that initiated the connection.  Then the sender  and   recipients
  1224.      are  specified.   (There can be more than one RCPT command, if there are
  1225.      several recipients.)  Finally the data itself is sent.  Note  that   the
  1226.      text   of  the message is terminated by a line containing just a period.
  1227.      (If such a line appears in the message, the period is  doubled.)   After
  1228.      the   message   is  accepted,  the  sender  can send another message, or
  1229.      terminate the session as in the example above.
  1230.  
  1231.      Generally, there is a pattern to the response numbers.    The   protocol
  1232.      defines   the   specific set of responses that can be sent as answers to
  1233.      any given command.  However programs that don't want to   analyze   them
  1234.      in   detail   can  just  look at the first digit.  In general, responses
  1235.      that begin with a 2  indicate  success.    Those  that  begin   with   3
  1236.      indicate   that  some further action is needed, as shown above.  4 and 5
  1237.      indicate errors.  4 is a "temporary" error, such as  a   disk   filling.
  1238.      The   message  should be saved, and tried again later.  5 is a permanent
  1239.      error, such as a  non-existent  recipient.    The  message   should   be
  1240.      returned to the sender with an error message.
  1241.  
  1242.      (For  more  details about the protocols mentioned in this  section,  see
  1243.      RFC's  821/822  for mail, RFC 959 for file transfer, and  RFC's  854/855
  1244.      for  remote  logins.  For the well-known port numbers, see  the  current
  1245.      edition of Assigned Numbers, and possibly RFC 814.)
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.                                       - 20 -
  1259.  
  1260.  
  1261.      1.2.  Protocols other than TCP: UDP and ICMP
  1262.  
  1263.      So far, we have described only connections that use TCP.   Recall   that
  1264.      TCP   is   responsible  for  breaking  up  messages  into datagrams, and
  1265.      reassembling them properly.  However in  many  applications,   we   have
  1266.      messages   that   will  always  fit in a single datagram.  An example is
  1267.      name lookup.  When a user attempts to make  a  connection   to   another
  1268.      system,   he   will  generally  specify  the system by name, rather than
  1269.      Internet address.  His system has to translate that name to  an  address
  1270.      before   it   can  do  anything.  Generally, only a few systems have the
  1271.      database used to translate names to addresses.  So the   user's   system
  1272.      will  want  to send a query to one of the systems that has the database.
  1273.      This query is going to be very short.  It will certainly  fit   in   one
  1274.      datagram.     So   will the answer.  Thus it seems silly to use TCP.  Of
  1275.      course TCP does more than just break things up  into   datagrams.     It
  1276.      also   makes   sure  that  the  data  arrives, resending datagrams where
  1277.      necessary.  But for a question that fits  in  a  single   datagram,   we
  1278.      don't   need   all the complexity of TCP to do this.  If we don't get an
  1279.      answer after a few seconds, we can just ask again.    For   applications
  1280.      like this, there are alternatives to TCP.
  1281.  
  1282.      The most common alternative is UDP ("user datagram protocol").   UDP  is
  1283.      designed  for  applications where you don't need  to  put  sequences  of
  1284.      datagrams  together.  It fits into the system much like TCP.  There is a
  1285.      UDP  header.  The network software puts the UDP header on  the  front of
  1286.      your  data, just as it would put a TCP header on the front of your data.
  1287.      Then  UDP sends the data  to  IP,  which  adds  the  IP  header, putting
  1288.      UDP's  protocol number in the protocol field instead of  TCP's  protocol
  1289.      number.   However  UDP  doesn't do as much  as  TCP  does.    It doesn't
  1290.      split data into multiple datagrams.  It doesn't keep track  of  what  it
  1291.      has  sent so it can resend if necessary.  About  all  that  UDP provides
  1292.      is  port  numbers,  so  that several programs can use UDP at once.   UDP
  1293.      port  numbers  are used just like TCP port  numbers.    There are  well-
  1294.      known  port numbers for servers that use UDP.  Note that the UDP  header
  1295.      is  shorter than a TCP header.   It  still  has  source  and destination
  1296.      port  numbers,  and  a checksum,  but  that's  about  it.   No  sequence
  1297.      number, since it is not needed.  UDP is used by the protocols that  han-
  1298.      dle  name  lookups (see IEN 116, RFC 882, and RFC 883), and a number  of
  1299.      similar protocols.
  1300.  
  1301.      Another  alternative  protocol  is  ICMP  ("Internet   control   message
  1302.      protocol").     ICMP   is  used  for  error messages, and other messages
  1303.      intended for the TCP/IP software itself, rather  than   any   particular
  1304.      user   program.   For example, if you attempt to connect to a host, your
  1305.      system may get back an ICMP message saying "host  unreachable".     ICMP
  1306.      can   also  be used to find out some information about the network.  See
  1307.      RFC 792 for details of ICMP.  ICMP is  similar  to  UDP,  in   that   it
  1308.      handles  messages  that fit in one datagram.  However it is even simpler
  1309.      than UDP.  It doesn't even have port numbers in its header.   Since  all
  1310.      ICMP   messages  are interpreted by the network software itself, no port
  1311.      numbers are needed to say where a ICMP message is supposed to go.
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.                                       - 21 -
  1325.  
  1326.  
  1327.      1.3.  Keeping track of names and information: the domain system
  1328.  
  1329.      As we indicated earlier, the network software generally needs  a  32-bit
  1330.      Internet   address   in  order  to open a connection or send a datagram.
  1331.      However users prefer to deal with computer names rather  than   numbers.
  1332.      Thus   there   is  a database that allows the software to look up a name
  1333.      and find the corresponding number.  When the Internet was  small,   this
  1334.      was   easy.   Each system would have a file that listed all of the other
  1335.      systems, giving both their name and number.  There are  now   too   many
  1336.      computers   for   this  approach to be practical.  Thus these files have
  1337.      been replaced by a set of name servers that keep track of   host   names
  1338.      and   the  corresponding Internet addresses.  (In fact these servers are
  1339.      somewhat more general than that.  This is just one kind  of  information
  1340.      stored  in  the domain system.)  Note that a set of interlocking servers
  1341.      are used, rather than a single central one.  There  are  now   so   many
  1342.      different   institutions   connected  to  the  Internet that it would be
  1343.      impractical for them to  notify  a  central  authority   whenever   they
  1344.      installed   or  moved a computer.  Thus naming authority is delegated to
  1345.      individual institutions.  The name servers form a  tree,   corresponding
  1346.      to   institutional   structure.    The names themselves follow a similar
  1347.      structure.  A typical example is the name BORAX.LCS.MIT.EDU.  This  is a
  1348.      computer   at   the  Laboratory  for  Computer Science (LCS) at MIT.  In
  1349.      order to find its Internet address,  you  might  potentially   have   to
  1350.      consult   4   different  servers.  First, you would ask a central server
  1351.      (called the root) where the EDU server is.  EDU is a server  that  keeps
  1352.      track  of  educational institutions.  The root server would give you the
  1353.      names and Internet addresses of several servers for EDU.    (There   are
  1354.      several   servers   at  each  level,  to allow for the possibly that one
  1355.      might be down.)  You would then ask EDU where the server for   MIT   is.
  1356.      Again,   it   would  give  you  names  and Internet addresses of several
  1357.      servers for MIT.  Generally, not all of those servers would be  at  MIT,
  1358.      to   allow  for the possibility of a general power failure at MIT.  Then
  1359.      you would ask MIT where the server for LCS is, and finally   you   would
  1360.      ask  one  of the LCS servers about BORAX.  The final result would be the
  1361.      Internet address for BORAX.LCS.MIT.EDU.    Each  of  these   levels   is
  1362.      referred   to   as  a  "domain".  The entire name, BORAX.LCS.MIT.EDU, is
  1363.      called a "domain name".    (So  are  the  names  of   the   higher-level
  1364.      domains, such as LCS.MIT.EDU, MIT.EDU, and EDU.)
  1365.  
  1366.      Fortunately,  you  don't really have to go through all of this  most  of
  1367.      the  time.   First of all, the root name servers also happen to  be  the
  1368.      name  servers  for  the  top-level domains such as EDU.  Thus  a  single
  1369.      query  to  a root  server  will  get  you  to  MIT.    Second,  software
  1370.      generally  remembers answers that it got before.  So once we look  up  a
  1371.      name  at  LCS.MIT.EDU, our software remembers where to find servers  for
  1372.      LCS.MIT.EDU,  MIT.EDU,  and EDU.  It also remembers the  translation  of
  1373.      BORAX.LCS.MIT.EDU.   Each  of these pieces of information has a "time to
  1374.      live"  associated with it.  Typically this is a few days.   After  that,
  1375.      the  information  expires and has to be looked up again.    This  allows
  1376.      institutions to change things.
  1377.  
  1378.      The  domain  system  is not limited to finding out  Internet  addresses.
  1379.      Each  domain  name is a node in a database.  The node can  have  records
  1380.      that  define  a number of different properties.  Examples  are  Internet
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.                                       - 22 -
  1391.  
  1392.  
  1393.      address,  computer  type, and a list of services provided by a computer.
  1394.      A  program  can  ask  for  a  specific  piece  of  information,  or  all
  1395.      information  about  a given name.  It is possible  for  a  node  in  the
  1396.      database  to  be  marked as an "alias" (or nickname) for  another  node.
  1397.      It  is  also possible to use the  domain  system  to  store  information
  1398.      about users, mailing lists, or other objects.
  1399.  
  1400.      There  is  an  Internet  standard  defining  the  operation   of   these
  1401.      databases,  as  well as the protocols used  to  make  queries  of  them.
  1402.      Every  network utility has to be able to make such queries,  since  this
  1403.      is  now  the official way to evaluate host names.   Generally  utilities
  1404.      will talk to a server on their own system.  This server will  take  care
  1405.      of  contacting  the other servers for them.  This keeps down the  amount
  1406.      of code that has to be in each application program.
  1407.  
  1408.      The  domain  system  is  particularly  important for  handling  computer
  1409.      mail.  There are entry types to define what computer handles mail  for a
  1410.      given  name, to specify where an individual is to receive mail,  and  to
  1411.      define mailing lists.
  1412.  
  1413.      (See RFC's 882, 883, and 973 for specifications of the  domain   system.
  1414.      RFC 974 defines the use of the domain system in sending mail.)
  1415.  
  1416.      1.4.  Routing
  1417.  
  1418.      The   description  above  indicated  that  the  IP   implementation   is
  1419.      responsible  for  getting datagrams to the destination indicated by  the
  1420.      destination address, but little was said about how this would  be  done.
  1421.      The  task  of finding how to  get  a  datagram  to  its  destination  is
  1422.      referred to as "routing".  In fact many of the details depend  upon  the
  1423.      particular implementation.  However some general things can be said.
  1424.  
  1425.      First, it is necessary to understand the model on which IP   is   based.
  1426.      IP  assumes  that a system is attached to some local network.  We assume
  1427.      that the system can send datagrams to any  other  system  on   its   own
  1428.      network.     (In   the  case  of  Ethernet, it simply finds the Ethernet
  1429.      address of the destination system, and puts the datagram  out   on   the
  1430.      Ethernet.)     The   problem  comes  when  a  system  is asked to send a
  1431.      datagram to a system on a different network.  This problem  is   handled
  1432.      by   gateways.    A gateway is a system that connects a network with one
  1433.      or more other networks.  Gateways  are  often  normal   computers   that
  1434.      happen  to have more than one network interface.  For example, we have a
  1435.      Unix machine that has two different Ethernet  interfaces.   Thus  it  is
  1436.      connected   to  networks 128.6.4 and 128.6.3.  This machine can act as a
  1437.      gateway between those two networks.  The software on that  machine  must
  1438.      be   set   up  so that it will forward datagrams from one network to the
  1439.      other.  That is, if a machine on network 128.6.4 sends a   datagram   to
  1440.      the   gateway,   and  the  datagram is addressed to a machine on network
  1441.      128.6.3, the gateway will forward the  datagram  to   the   destination.
  1442.      Major  communications  centers often have gateways that connect a number
  1443.      of different  networks.    (In  many  cases,   special-purpose   gateway
  1444.      systems  provide  better performance or reliability than general-purpose
  1445.      systems acting as gateways.  A number of vendors sell such systems.)
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.                                       - 23 -
  1457.  
  1458.  
  1459.      Routing in IP is  based  entirely  upon  the  network  number   of   the
  1460.      destination   address.     Each computer has a table of network numbers.
  1461.      For each network number, a gateway is listed.  This is the  gateway   to
  1462.      be  used  to get to that network.  Note that the gateway doesn't have to
  1463.      connect directly to the network.  It just has to be the best  place   to
  1464.      go   to   get there.  For example at Rutgers, our interface to NSFnet is
  1465.      at the John von Neuman Supercomputer Center (JvNC). Our  connection   to
  1466.      JvNC   is   via  a  high-speed  serial line connected to a gateway whose
  1467.      address is 128.6.3.12.  Systems on net 128.6.3 will list  128.6.3.12  as
  1468.      the   gateway   for  many  off-campus  networks.  However systems on net
  1469.      128.6.4 will list 128.6.4.1 as the gateway to  those   same   off-campus
  1470.      networks.     128.6.4.1   is  the  gateway  between networks 128.6.4 and
  1471.      128.6.3, so it is the first step in getting to JvNC.
  1472.  
  1473.      When a computer wants to send a datagram, it first checks  to   see   if
  1474.      the   destination  address is on the system's own local network.  If so,
  1475.      the datagram can be sent directly.  Otherwise, the system   expects   to
  1476.      find  an  entry for the network that the destination address is on.  The
  1477.      datagram is sent to the gateway listed in that entry.  This  table   can
  1478.      get  quite  big.  For example, the Internet now includes several hundred
  1479.      individual networks.  Thus various strategies have been   developed   to
  1480.      reduce   the  size of the routing table.  One strategy is to depend upon
  1481.      "default routes".  Often, there is only one gateway out of  a   network.
  1482.      This   gateway  might connect a local Ethernet to a campus-wide backbone
  1483.      network.  In that case, we don't need to have  a  separate   entry   for
  1484.      every   network   in  the  world.    We  simply define that gateway as a
  1485.      "default".  When no specific  route  is  found  for  a   datagram,   the
  1486.      datagram   is   sent to the default gateway.  A default gateway can even
  1487.      be used when there are several gateways  on  a  network.     There   are
  1488.      provisions   for   gateways  to  send a message saying "I'm not the best
  1489.      gateway -- use this one instead."  (The message is sent via  ICMP.   See
  1490.      RFC   792.)   Most network software is designed to use these messages to
  1491.      add entries to their routing tables.  Suppose network 128.6.4  has   two
  1492.      gateways,  128.6.4.59  and 128.6.4.1.  128.6.4.59 leads to several other
  1493.      internal Rutgers networks.  128.6.4.1 leads indirectly to  the   NSFnet.
  1494.      Suppose   we   set  128.6.4.59  as  a default gateway, and have no other
  1495.      routing table entries.  Now what  happens  when  we  need  to   send   a
  1496.      datagram   to   MIT?    MIT  is  network 18.  Since we have no entry for
  1497.      network 18, the datagram will be sent to the default,  128.6.4.59.    As
  1498.      it   happens,   this  gateway  is the wrong one.  So it will forward the
  1499.      datagram to 128.6.4.1.  But it will also send back an error  saying   in
  1500.      effect:  "to  get to network 18, use 128.6.4.1".  Our software will then
  1501.      add an entry to the routing table.  Any future datagrams to   MIT   will
  1502.      then   go   directly to 128.6.4.1.  (The error message is sent using the
  1503.      ICMP protocol.  The message type is called "ICMP redirect.")
  1504.  
  1505.      Most IP experts recommend that individual computers should not  try   to
  1506.      keep   track   of  the  entire network.  Instead, they should start with
  1507.      default gateways, and let the gateways tell them the routes,   as   just
  1508.      described.    However  this doesn't say how the gateways should find out
  1509.      about the routes.  The gateways can't depend upon this  strategy.   They
  1510.      have   to   have fairly complete routing tables.  For this, some sort of
  1511.      routing protocol is needed.  A routing protocol is simply  a   technique
  1512.      for   the   gateways  to  find each other, and keep up to date about the
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.                                       - 24 -
  1523.  
  1524.  
  1525.      best way to get to every network.   RFC  1009  contains  a   review   of
  1526.      gateway   design   and  routing.    However rip.doc is probably a better
  1527.      introduction to the subject.  It contains some tutorial material,  and a
  1528.      detailed description of the most commonly-used routing protocol.
  1529.  
  1530.      1.5.  Details about Internet addresses: subnets and broadcasting
  1531.  
  1532.      As  indicated earlier, Internet addresses are 32-bit  numbers,  normally
  1533.      written as 4 octets (in decimal), e.g. 128.6.4.7.  There are  actually 3
  1534.      different types of address.  The problem is  that  the  address  has  to
  1535.      indicate  both  the network and the host within the  network.    It  was
  1536.      felt  that  eventually  there would be lots of networks.  Many  of  them
  1537.      would  be  small, but probably 24 bits would be needed to represent  all
  1538.      the  IP  networks.  It was also felt that some very big  networks  might
  1539.      need  24  bits to represent all of their hosts.  This would seem to lead
  1540.      to  48  bit  addresses.  But the designers really wanted to use  32  bit
  1541.      addresses.   So  they adopted a kludge.  The assumption is that most  of
  1542.      the  networks will be small.  So they set up three different  ranges  of
  1543.      address.   Addresses  beginning with 1 to 126 use only the  first  octet
  1544.      for  the network number.  The other three octets are available  for  the
  1545.      host  number.   Thus 24 bits are available for hosts.  These numbers are
  1546.      used  for large networks.  But there can only be 126 of these  very  big
  1547.      networks.   The  Arpanet is one, and there are a  few  large  commercial
  1548.      networks.    But  few  normal organizations get one of these  "class  A"
  1549.      addresses.   For  normal large organizations, "class  B"  addresses  are
  1550.      used.    Class  B  addresses  use the first two octets for  the  network
  1551.      number.   Thus  network numbers are 128.1 through 191.254.  (We avoid  0
  1552.      and  255,  for  reasons  that  we  see below.  We also  avoid  addresses
  1553.      beginning  with  127, because that is used by some systems  for  special
  1554.      purposes.)    The  last  two  octets  are available for  host  addesses,
  1555.      giving  16  bits of host address.   This  allows  for  64516  computers,
  1556.      which should be enough for most organizations.  (It is possible  to  get
  1557.      more  than  one class B address, if you run  out.)    Finally,  class  C
  1558.      addresses  use  three  octets,  in  the  range 192.1.1  to  223.254.254.
  1559.      These  allow  only 254 hosts on each network, but there can be  lots  of
  1560.      these  networks.   Addresses above 223 are reserved for future  use,  as
  1561.      class D and E (which are currently not defined).
  1562.  
  1563.      Many large organizations find it convenient to  divide   their   network
  1564.      number into "subnets".  For example, Rutgers has been assigned a class B
  1565.      address, 128.6.  We find it convenient to use the  third  octet  of  the
  1566.      address  to  indicate which Ethernet a host is on.  This division has no
  1567.      significance outside of Rutgers.  A computer  at   another   institution
  1568.      would  treat  all datagrams addressed to 128.6 the same way.  They would
  1569.      not look at the third octet of the address.   Thus   computers   outside
  1570.      Rutgers   would   not have different routes for 128.6.4 or 128.6.5.  But
  1571.      inside Rutgers, we treat 128.6.4 and 128.6.5 as separate  networks.   In
  1572.      effect,  gateways  inside Rutgers have separate entries for each Rutgers
  1573.      subnet, whereas gateways outside  Rutgers  just  have  one   entry   for
  1574.      128.6.   Note   that  we  could  do  exactly  the  same thing by using a
  1575.      separate class C address for each Ethernet.   As  far  as   Rutgers   is
  1576.      concerned,   it   would be just as convenient for us to have a number of
  1577.      class C addresses.  However using class C addresses would  make   things
  1578.      inconvenient  for  the rest of the world.  Every institution that wanted
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.                                       - 25 -
  1589.  
  1590.  
  1591.      to talk to us would have to have a separate entry for each one  of   our
  1592.      networks.    If  every institution did this, there would be far too many
  1593.      networks for any reasonable gateway to keep track of.  By  subdividing a
  1594.      class  B network, we hide our internal structure from everyone else, and
  1595.      save  them  trouble.    This  subnet  strategy  requires  special provi-
  1596.      sions in the network software.  It is described in RFC 950.
  1597.  
  1598.      0  and  255  have  special  meanings.  0 is reserved for  machines  that
  1599.      don't know their address.  In certain circumstances it is possible for a
  1600.      machine not to know the number of the network it is on, or even its  own
  1601.      host  address.   For  example, 0.0.0.23 would be a machine that  knew it
  1602.      was host number 23, but didn't know on what network.
  1603.  
  1604.      255  is  used for "broadcast".  A broadcast is a message that  you  want
  1605.      every  system  on the network to see.    Broadcasts  are  used  in  some
  1606.      situations  where you don't know who to talk to.  For  example,  suppose
  1607.      you  need  to look  up  a  host  name  and  get  its  Internet  address.
  1608.      Sometimes  you  don't know the address of the nearest name  server.   In
  1609.      that  case,  you might send the request as a broadcast.  There are  also
  1610.      cases  where a number of systems are interested in information.   It  is
  1611.      then  less  expensive to send a single broadcast than to send  datagrams
  1612.      individually  to  each host that is interested in the  information.   In
  1613.      order  to  send a broadcast, you use an address that is  made  by  using
  1614.      your  network  address, with all ones in the part of the  address  where
  1615.      the  host  number goes.  For example, if you are on network 128.6.4, you
  1616.      would   use   128.6.4.255  for  broadcasts.    How  this   is   actually
  1617.      implemented  depends  upon the medium.   It  is  not  possible  to  send
  1618.      broadcasts  on the Arpanet, or on point to point lines.  However  it  is
  1619.      possible  on  an Ethernet.  If you use an Ethernet address with all  its
  1620.      bits  on (all ones), every machine on the Ethernet is supposed  to  look
  1621.      at that datagram.
  1622.  
  1623.      Although the official broadcast address for  network  128.6.4   is   now
  1624.      128.6.4.255,   there   are  some  other addresses that may be treated as
  1625.      broadcasts by certain implementations.  For convenience,  the   standard
  1626.      also   allows   255.255.255.255 to be used.  This refers to all hosts on
  1627.      the local network.  It is often simpler to use  255.255.255.255  instead
  1628.      of   finding  out the network number for the local network and forming a
  1629.      broadcast address such as 128.6.4.255.   In  addition,   certain   older
  1630.      implementations   may   use  0  instead  of  255  to  form the broadcast
  1631.      address.    Such  implementations  would  use  128.6.4.0   instead    of
  1632.      128.6.4.255   as   the  broadcast  address on network 128.6.4.  Finally,
  1633.      certain older implementations may not understand about  subnets.    Thus
  1634.      they  consider  the network number to be 128.6.  In that case, they will
  1635.      assume a broadcast address  of  128.6.255.255  or   128.6.0.0.     Until
  1636.      support   for   broadcasts is implemented properly, it can be a somewhat
  1637.      dangerous feature to use.
  1638.  
  1639.      Because 0 and 255 are used for unknown and broadcast  addresses,  normal
  1640.      hosts   should  never be given addresses containing 0 or 255.  Addresses
  1641.      should never begin with 0, 127, or any number above   223.     Addresses
  1642.      violating  these  rules are sometimes referred to as "Martians", because
  1643.      of rumors that the Central University of Mars is using network 225.
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.                                       - 26 -
  1655.  
  1656.  
  1657.      1.6.  Datagram fragmentation and reassembly
  1658.  
  1659.      TCP/IP is designed for use  with  many  different  kinds   of   network.
  1660.      Unfortunately,   network   designers  do not agree about how big packets
  1661.      can be.  Ethernet packets can be 1500 octets long.     Arpanet   packets
  1662.      have   a   maximum  of around 1000 octets.  Some very fast networks have
  1663.      much larger packet sizes.  At first, you might think  that   IP   should
  1664.      simply   settle   on  the  smallest  possible size.  Unfortunately, this
  1665.      would cause serious performance problems.    When   transferring   large
  1666.      files,  big  packets are far more efficient than small ones.  So we want
  1667.      to be able to use the largest packet size possible.  But we  also   want
  1668.      to   be   able  to  handle  networks  with  small limits.  There are two
  1669.      provisions for this.  First, TCP has the ability to  "negotiate"   about
  1670.      datagram   size.   When a TCP connection first opens, both ends can send
  1671.      the maximum datagram size they can  handle.    The  smaller   of   these
  1672.      numbers   is   used  for  the  rest  of the connection.  This allows two
  1673.      implementations that can handle big datagrams to use  them,   but   also
  1674.      lets   them   talk  to  implementations that can't handle them.  However
  1675.      this doesn't completely solve the problem.  The most   serious   problem
  1676.      is   that  the two ends don't necessarily know about all of the steps in
  1677.      between.  For example, when sending data between Rutgers  and  Berkeley,
  1678.      it  is  likely that both computers will be on Ethernets.  Thus they will
  1679.      both  be  prepared  to  handle  1500-octet  datagrams.     However   the
  1680.      connection  will  at some point end up going over the Arpanet.  It can't
  1681.      handle packets of that size.  For this reason, there are  provisions  to
  1682.      split    datagrams    up   into   pieces.    (This  is  referred  to  as
  1683.      "fragmentation".)  The IP header  contains  fields  indicating   the   a
  1684.      datagram   has   been split, and enough information to let the pieces be
  1685.      put back together.  If a gateway connects an Ethernet to  the   Arpanet,
  1686.      it  must  be prepared to take 1500-octet Ethernet packets and split them
  1687.      into pieces that will fit on the Arpanet.    Furthermore,   every   host
  1688.      implementation   of   TCP/IP  must  be prepared to accept pieces and put
  1689.      them back together.  This is referred to as "reassembly".
  1690.  
  1691.      TCP/IP implementations differ in the approach they take to  deciding  on
  1692.      datagram   size.     It  is  fairly  common  for  implementations to use
  1693.      576-byte datagrams whenever they can't verify that the entire  path   is
  1694.      able   to   handle larger packets.  This rather conservative strategy is
  1695.      used because of the number of implementations with bugs in the  code  to
  1696.      reassemble   fragments.     Implementors  often try to avoid ever having
  1697.      fragmentation occur.  Different implementors take  different  approaches
  1698.      to   deciding   when  it  is safe to use large datagrams.  Some use them
  1699.      only for the local network.  Others will use them for any   network   on
  1700.      the    same    campus.    576  bytes  is  a  "safe"  size,  which  every
  1701.      implementation must support.
  1702.  
  1703.      1.7.  Ethernet encapsulation: ARP
  1704.  
  1705.      There was a brief discussion earlier about what IP datagrams  look  like
  1706.      on   an   Ethernet.    The  discussion  showed  the  Ethernet header and
  1707.      checksum.  However it left one hole: It didn't say how to   figure   out
  1708.      what  Ethernet  address to use when you want to talk to a given Internet
  1709.      address.  In fact, there is a separate protocol for this,   called   ARP
  1710.      ("address   resolution  protocol").  (Note by the way that ARP is not an
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.                                       - 27 -
  1721.  
  1722.  
  1723.      IP protocol.  That is, the ARP datagrams  do  not  have   IP   headers.)
  1724.      Suppose   you   are  on  system  128.6.4.194  and you want to connect to
  1725.      system 128.6.4.7.  Your system will first verify that 128.6.4.7  is   on
  1726.      the   same  network, so it can talk directly via Ethernet.  Then it will
  1727.      look up 128.6.4.7 in its ARP table, to see if  it  already   knows   the
  1728.      Ethernet   address.     If  so, it will stick on an Ethernet header, and
  1729.      send the packet.  But suppose this system is not  in  the   ARP   table.
  1730.      There   is   no  way  to  send the packet, because you need the Ethernet
  1731.      address.  So it  uses  the  ARP  protocol  to  send  an   ARP   request.
  1732.      Essentially   an   ARP  request  says  "I  need the Ethernet address for
  1733.      128.6.4.7".  Every system listens to ARP requests.  When a  system  sees
  1734.      an   ARP   request  for itself, it is required to respond.  So 128.6.4.7
  1735.      will see the request, and will respond with an  ARP  reply   saying   in
  1736.      effect  "128.6.4.7  is 8:0:20:1:56:34".  (Recall that Ethernet addresses
  1737.      are 48 bits.  This is 6 octets.  Ethernet addresses  are  conventionally
  1738.      shown   in   hex,  using  the punctuation shown.)  Your system will save
  1739.      this information in its ARP table, so future packets will  go  directly.
  1740.      Most   systems   treat the ARP table as a cache, and clear entries in it
  1741.      if they have not been used in a certain period of time.
  1742.  
  1743.      Note by the way that ARP requests must be sent as  "broadcasts".   There
  1744.      is   no   way  that  an  ARP  request  can be sent directly to the right
  1745.      system.  After all, the whole reason for sending  an  ARP   request   is
  1746.      that   you   don't know the Ethernet address.  So an Ethernet address of
  1747.      all ones is  used,  i.e.  ff:ff:ff:ff:ff:ff.    By   convention,   every
  1748.      machine   on   the Ethernet is required to pay attention to packets with
  1749.      this as an address.  So every system sees every ARP   requests.     They
  1750.      all   look  to see whether the request is for their own address.  If so,
  1751.      they respond.  If not, they could just ignore it.   (Some   hosts   will
  1752.      use   ARP   requests  to update their knowledge about other hosts on the
  1753.      network, even if the request isn't for them.)  Note that  packets  whose
  1754.      IP   address   indicates broadcast (e.g. 255.255.255.255 or 128.6.4.255)
  1755.      are also sent with an Ethernet address that is all ones.
  1756.  
  1757.      1.8.  Getting more information
  1758.  
  1759.      This directory contains  documents  describing  the   major   protocols.
  1760.      There   are  literally hundreds of documents, so we have chosen the ones
  1761.      that seem most important.  Internet standards are called  RFC's.     RFC
  1762.      stands   for   Request  for  Comment.   A proposed standard is initially
  1763.      issued as a proposal, and given an RFC number.   When  it   is   finally
  1764.      accepted,   it  is added to Official Internet Protocols, but it is still
  1765.      referred to by the RFC number.   We  have  also  included   two   IEN's.
  1766.      (IEN's   used   to  be  a  separate  classification  for  more  informal
  1767.      documents.  This classification no longer exists -- RFC's are  now  used
  1768.      for   all   official  Internet documents, and a mailing list is used for
  1769.      more informal reports.)  The convention is that  whenever  an   RFC   is
  1770.      revised,  the  revised version gets a new number.  This is fine for most
  1771.      purposes, but it causes problems with two documents:  Assigned   Numbers
  1772.      and   Official   Internet  Protocols.  These documents are being revised
  1773.      all the time, so the RFC number keeps changing.  You will have  to  look
  1774.      in  rfc-index.txt  to find the number of the latest edition.  Anyone who
  1775.      is seriously interested in TCP/IP should read the  RFC   describing   IP
  1776.      (791).     RFC  1009 is also useful.  It is a specification for gateways
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.                                       - 28 -
  1787.  
  1788.  
  1789.      to be used by NSFnet.  As such, it contains an overview of  a   lot   of
  1790.      the   TCP/IP  technology.  You should probably also read the description
  1791.      of at least one of the application protocols, just to get a   feel   for
  1792.      the   way   things  work.    Mail is probably a good one (821/822).  TCP
  1793.      (793) is of course a very basic specification.  However  the   spec   is
  1794.      fairly   complex,   so  you should only read this when you have the time
  1795.      and patience to think about it carefully.  Fortunately, the  author   of
  1796.      the   major   RFC's  (Jon Postel) is a very good writer.  The TCP RFC is
  1797.      far easier to read than you would expect, given the complexity  of  what
  1798.      it   is   describing.    You  can  look at the other RFC's as you become
  1799.      curious about their subject matter.
  1800.  
  1801.      Here is a list of the documents you are more likely to want:
  1802.  
  1803.           rfc-index list of all RFC's
  1804.  
  1805.           rfc1012   somewhat fuller list of all RFC's
  1806.  
  1807.           rfc1011   Official Protocols.  It's useful to scan  this  to  see
  1808.                     what tasks protocols have been built for.  This defines
  1809.                     which  RFC's  are  actual  standards,  as  opposed   to
  1810.                     requests for comments.
  1811.  
  1812.           rfc1010   Assigned  Numbers.  If you are working with TCP/IP, you
  1813.                     will probably want a hardcopy of this as  a  reference.
  1814.                     It's  not  very  exciting  to  read.   It lists all the
  1815.                     offically defined well-known ports and  lots  of  other
  1816.                     things.
  1817.  
  1818.           rfc1009   NSFnet  gateway  specifications.  A good overview of IP
  1819.                     routing and gateway technology.
  1820.  
  1821.           rfc1001/2 netBIOS: networking for PC's
  1822.  
  1823.           rfc973    update on domains
  1824.  
  1825.           rfc959    FTP (file transfer)
  1826.  
  1827.           rfc950    subnets
  1828.  
  1829.           rfc937    POP2: protocol for reading mail on PC's
  1830.  
  1831.           rfc894    how IP is to be put on Ethernet, see also rfc825
  1832.  
  1833.           rfc882/3  domains (the database used to go  from  host  names  to
  1834.                     Internet  address  and back -- also used to handle UUCP
  1835.                     these days).  See also rfc973
  1836.  
  1837.           rfc854/5  telnet - protocol for remote logins
  1838.  
  1839.           rfc826    ARP - protocol for finding out Ethernet addresses
  1840.  
  1841.           rfc821/2  mail
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.                                       - 29 -
  1853.  
  1854.  
  1855.           rfc814    names and ports - general  concepts  behind  well-known
  1856.                     ports
  1857.  
  1858.           rfc793    TCP
  1859.  
  1860.           rfc792    ICMP
  1861.  
  1862.           rfc791    IP
  1863.  
  1864.           rfc768    UDP
  1865.  
  1866.           rip.doc   details of the most commonly-used routing protocol
  1867.  
  1868.           ien-116   old  name  server  (still  needed  by  several kinds of
  1869.                     system)
  1870.  
  1871.           ien-48    the  Catenet  model,   general   description   of   the
  1872.                     philosophy behind TCP/IP
  1873.  
  1874.      The following documents are somewhat more specialized.
  1875.  
  1876.           rfc813    window and acknowledgement strategies in TCP
  1877.  
  1878.           rfc815    datagram reassembly techniques
  1879.  
  1880.           rfc816    fault isolation and resolution techniques
  1881.  
  1882.           rfc817    modularity and efficiency in implementation
  1883.  
  1884.           rfc879    the maximum segment size option in TCP
  1885.  
  1886.           rfc896    congestion control
  1887.  
  1888.           rfc827,888,904,975,985
  1889.                     EGP and related issues
  1890.  
  1891.      To those of you who may be reading this document remotely   instead   of
  1892.      at   Rutgers:   The  most  important  RFC's  have  been collected into a
  1893.      three-volume set, the DDN Protocol Handbook.  It is available  from  the
  1894.      DDN   Network   Information  Center,  SRI  International, 333 Ravenswood
  1895.      Avenue, Menlo Park, California 94025 (telephone:  800-235-3155).     You
  1896.      should  be able to get them via anonymous FTP from sri-nic.arpa.
  1897.  
  1898.      rip.doc is available  by  anonymous  FTP  from   topaz.rutgers.edu,   as
  1899.      /pub/tcp-ip-docs/rip.doc.
  1900.  
  1901.      IBM PC 360k floppies with ARC'ed versions of the  RFC's  and  IEN's  are
  1902.      also available from the TAPR office, thanks to Andy Freeborn, N0CCZ.
  1903.  
  1904.      1.9.  Overview of the KA9Q Internet Package
  1905.  
  1906.      The software associated with this document represents the culmination of
  1907.      what might be described as a first phase of implementaton.  The emphasis
  1908.      to date has been on building a robust platform on which  to  build  real
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.                                       - 30 -
  1919.  
  1920.  
  1921.      networks.   To this end, the core protocols have been extensively tested
  1922.      and verified.  In addition, great emphasis has been placed on increasing
  1923.      the  portability  of  the  software,  supporting  more and more hardware
  1924.      interfaces, and making it possible to use as many  networking  technolo-
  1925.      gies (asynch or RS-232 lines, Ethernet, various packet radio interfaces,
  1926.      digipeaters, NET/ROM, etc) as possible.
  1927.  
  1928.      The down side is that the user interface can be  described  at  best  as
  1929.      "terse".   The good news is that many individuals are working on improv-
  1930.      ing the interface, and great strides have been  made  in  the  Macintosh
  1931.      implementation.   In the meantime, we ask only that you realize what our
  1932.      priorities have been, and understand that even the  implementors  aren't
  1933.      always proud of "how it looks".
  1934.  
  1935.      This release provides support for the IP, ICMP, TCP, UDP, FTP, SMTP, and
  1936.      Telnet  protocols from the basic Arpanet set.  In addition, the ARP pro-
  1937.      tocol is available for address resolution on AX.25 and  Ethernet  inter-
  1938.      faces,  and  support  is provided for NET/ROM used as a transport. It is
  1939.      unfortunately necessary, as a result of the ongoing  NET/ROM  vs  TheNet
  1940.      debate,  to mention that the NET/ROM implementation included here is the
  1941.      original work of Dan Frank, W9NK, working  solely  from  documents  pub-
  1942.      lished by Software 2000.
  1943.  
  1944.      This release includes sources that are known to compile and run well  on
  1945.      PC  clones using MS-Dos, several flavors of System V Unix, including HP-
  1946.      UX and Microport on AT clones, the HP Portable Plus, the Atari  ST,  and
  1947.      the NEC PC-9801.
  1948.  
  1949.      Binaries are available on floppy for the PC and clones as part  of  this
  1950.      release.  Floppies  are  available  for the Mactintosh version, which is
  1951.      maintained separately but in parallel with the mainstream release.
  1952.  
  1953.      Other machines for which code is provided that may or may not  (probably
  1954.      not) work include the Amiga and BSD Unix.
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.                                       - 31 -
  1985.  
  1986.  
  1987.      2.  Installation
  1988.  
  1989.  
  1990.      2.1.  What an IP Address Is, and How to Get One
  1991.  
  1992.      IP Addresses are 32 bit numbers that uniquely identify a  given  machine
  1993.      (or  "host")  running  the TCP/IP protocol suite. All of the possible 32
  1994.      bit numbers are coordinated by an entity known as the  Network  Informa-
  1995.      tion  Center,  or  NIC.  Amateur Radio operators are fortunate in that a
  1996.      "Class A Subnet"  consisting  of  24  bits  of  address,  in  the  range
  1997.      44.X.X.X,  has  been  reserved  for our use. By general concensus, Brian
  1998.      Kantor, WB6CYT, of San Diego, CA, now serves as the top  level  adminis-
  1999.      trator of the 44.X.X.X address space, and assigns blocks of addresses to
  2000.      regional coordinators from around the world.
  2001.  
  2002.      You need to have a unique address before you can link in with  the  rest
  2003.      of  the  networked  world.  The best way to get one is to ask around the
  2004.      local packet community and find out who your local  address  coordinator
  2005.      is.  Your  local  coordinator  will  then assign you an address from the
  2006.      block for your area.
  2007.  
  2008.      Brian Kantor can be reached as brian@ucsd.edu on  the  Internet  if  you
  2009.      need help locating your local address coordinator.
  2010.  
  2011.      2.2.  Configuring a TNC for TCP/IP Operation
  2012.  
  2013.      This section describes the  procedure  for  configuring  various  packet
  2014.      radio Terminal Node Controller units (TNC's) for operation with the KA9Q
  2015.      package.  Readers who will be using the package with only SLIP or Ether-
  2016.      net (wired) connections can feel free to skip ahead to section 2.2.
  2017.  
  2018.      There are now several choices for TNCs to be  used   with   the   TCP/IP
  2019.      network  code.  Versions  of  the  Keep  It  Simple Stupid TNC interface
  2020.      software (KISS) are available for the TNC-1, the TNC-2, the VADCG  board
  2021.      and   clones  (Ashby),  the Kantronics  family  of  TNCs,  and  the  AEA
  2022.      TNCs. Following are the different setup/configuration modes for the dif-
  2023.      ferent TNCs.
  2024.  
  2025.      2.2.1.  TAPR TNC-1 and Clones
  2026.  
  2027.      The firmware for the TNC-1 is available in either a downloadable version
  2028.      or   a  stand  alone  version.   I  will  describe  only the stand alone
  2029.      version here.  Locate the ROM labeled E000 and remove  it.   Insert  the
  2030.      KISS  PROM  in  its  place making  sure  that you orient the prom in the
  2031.      same direction (failure to do so will result in smoked  PROM).   Connect
  2032.      your  TNC-1  to   your   computer  using  an RS-232 cable.  A cable that
  2033.      passes the signals from pins 2, 3, and 7 is suffi- cient.
  2034.  
  2035.      Since the TNC-1 has no switches for setting the baud rate  to  the  com-
  2036.      puter   the  firmware has been "hard wired" to 4800 baud.  See the docu-
  2037.      mentation that comes with the TNC-1 version of KISS for instructions  on
  2038.      how to patch the .HEX  file for other baud rates.
  2039.  
  2040.      There is also a newer  version  of  the  TNC-1  KISS  firmware  that  is
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.                                       - 32 -
  2051.  
  2052.  
  2053.      documented in the TNC_TNC1.ARC file in the distribution.
  2054.  
  2055.      TAPR can provide programmed TNC-1 KISS EPROMs.
  2056.  
  2057.      2.2.2.  TAPR TNC-2 and Clones
  2058.  
  2059.      The  standard firmware for the TNC-2 now supports a  'KISS'  command  to
  2060.      turn  on  KISS support.  If you wish to use the KISS command included in
  2061.      1.1.6 firmware, read your TNC documentation for more info.
  2062.  
  2063.      If you want to run KISS only, or have an older TNC-2  without  the  KISS
  2064.      command,  dig out the TNC_TNC2.ARC package and read the docs included on
  2065.      how to program an EPROM with the firmware (or buy a ROM from TAPR),  and
  2066.      then proceed.
  2067.  
  2068.      Open up your TNC and locate the ROM.  It is in the socket labeled "U23."
  2069.      Using  a   small   nail  file  or screwdriver gently pry up the existing
  2070.      EPROM. Carefully press the new EPROM into  place  being  sure  that  the
  2071.      orientation   is  the  same.  If  you  are  installing  the 2764 type of
  2072.      EPROM you will need to make a small modification to the TNC.  There is a
  2073.      location  on  the  board  just  above  the first RAM socket labeled JMP-
  2074.      6.  Turn the board over and cut the trace joining the two pads.   Solder
  2075.      a  two-pin  jumper  header  in  place.    When  using  a  type 2764  the
  2076.      jumper  at  JMP-6 should be removed and  installed  when  a  type  27256
  2077.      EPROM  is  being  used.   That  should complete the hardware part of the
  2078.      installa- tion.  As an alternative you may choose to burn the KISS  code
  2079.      into a 27256 and not bother with jumpers.
  2080.  
  2081.      Attach your TNC to your PC using an RS-232C cable.  You can use the same
  2082.      cable  that  you  were using to connect your PC to your TNC.  If you are
  2083.      doing this for the first time and are not sure  about  your  cabling,  a
  2084.      cable  with  just  pins  2, 3, and 7 passed through is sufficient.  Some
  2085.      PCs like to see the signals Clear To Send (CTS, pin 5), Data  Set  Ready
  2086.      (DSR,  pin 6),  and  Data  Carrier  Detect (DCD,  pin  8) asserted.  You
  2087.      can set this up by jumpering pin 4 to 5, and pin 20 to pins 6 and  8  at
  2088.      the female DB-25 connector that goes to the PC.
  2089.  
  2090.      Now to verify that the TNC still works.  Apply power  to  the  TNC   and
  2091.      turn   it  on. The  STA,  CON,  and  PWR LEDs should come on and the STA
  2092.      and CON lights should go out again about 1 second later.   If  you  have
  2093.      the   type   2764  EPROM with  the  KISS  code  in it one or both of the
  2094.      STA and CON LEDs will begin to flash.  If the CON LED flashes  you  have
  2095.      8Kb  of  RAM  in the TNC.  If the STA LED flashes  you have 16Kb of RAM.
  2096.      If both LEDs flash you have 32 Kb of RAM.  The flashing of the LEDs ver-
  2097.      ifies the proper operation of the TNC.
  2098.  
  2099.      2.2.3.  AEA PK-232
  2100.  
  2101.      If you have one of these boxes, congratulations!  You do not   have   to
  2102.      change  PROMS!   KISS  is already installed as a standard feature if you
  2103.      have a recent release of the firmware, 4-MAR-87 or later  for  the   PK-
  2104.      232,   or   21-JAN-87  or later for the PK-87, you have KISS in your TNC
  2105.      already.  To make it work first ensure that your computer  can  communi-
  2106.      cate  with   the   TNC   in  standard  packet mode.   This  will  ensure
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.                                       - 33 -
  2117.  
  2118.  
  2119.      that the computer, TNC, cabling, and radio are all operating properly.
  2120.  
  2121.      [Please note that one of the commands "PACKET" is not valid on the   PK-
  2122.      87   and  will only elicit a "Huh?" response.  Please note that comments
  2123.      have been added to the commands.  Do not type the information  following
  2124.      the  double  dash  or type the double dash itself.]
  2125.  
  2126.      Here is the sequence of commands that will turn on  the  KISS  mode  for
  2127.      the  AEA products:
  2128.  
  2129.              AWLEN 8         -- ensure it can speak 8 bit data
  2130.              PARITY 0        -- no parity
  2131.              RESTART         -- warm reset; make commands take effect
  2132.              PACKET          -- PK-232 or Heath only
  2133.              TONE 3          -- PK-87 only
  2134.              START 0         -- disable software flow control
  2135.              STOP 0
  2136.              XON 0
  2137.              XOFF 0
  2138.              XFLOW off
  2139.              CONMODE trans   -- pass through all characters
  2140.              HPOLL off       -- disable host polling
  2141.              KISS on         -- enable KISS version of host mode
  2142.              RAWHDLC on      -- turn off AX25L2 (now handled by the PC)
  2143.              PPERSIST on     -- turn off DWAIT and enable p-persistence
  2144.              HOST on         -- start KISS running
  2145.  
  2146.      The PK-87 or the PK-232 will remain in the KISS mode until you  send   a
  2147.      break  (~200ms of spacing) or until you send the command character three
  2148.      times (^C ^C ^C) in quick succession.  Beware!  Some terminal  emulators
  2149.      (like   YAPP)   will  send   a   break  signal  when you exit from them.
  2150.      That will undo your work and cause all manner of confusion.  The  termi-
  2151.      nal  program   PROCOMM  seems  to  work just  fine.  The TNC may also be
  2152.      switched back to ordinary AX.25 mode by issuing  the  following  command
  2153.      from within NET.EXE:
  2154.  
  2155.              param ax0 255
  2156.  
  2157.      AEA is rumored to be reworking their software so that entering just  the
  2158.      "KISS" command will do all of the above. Check your documentation to see
  2159.      how your version works.
  2160.  
  2161.      2.2.4.  Kantronics TNC's
  2162.  
  2163.      Kantronics includes KISS support in their products. It is  the  simplest
  2164.      of the commercial implementations of KISS to configure and use.
  2165.  
  2166.      First setup and operate your KAM, KPC-II, or KPC-4 for  standard  packet
  2167.      operation.   This will ensure that the computer, TNC, cabling, and radio
  2168.      are operating properly. Use your terminal program to send the  following
  2169.      commands:
  2170.  
  2171.              ABAUD 4800      -- baud rate to what you will be using when
  2172.                                 net is running (set by the attach command)
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.                                       - 34 -
  2183.  
  2184.  
  2185.              DWAIT 0         -- disable DWAIT
  2186.              PERSIST 50      -- enable persistence and set it to about 20%
  2187.              SLOTTIME 16     -- set the slot time to 160 ms
  2188.              KISS ON         -- Enable KISS mode at the next reset
  2189.              PERM            -- make above command permanent so that KISS
  2190.                                 will be entered whenever TNC is powered up
  2191.              RESET           -- start KISS
  2192.  
  2193.      If you wish to have the the TNC revert back to ordinary AX.25  mode   of
  2194.      opera- tion  you  should  omit the PERM command from the above sequence.
  2195.      That way the TNC will revert back  to  ordinary  AX.25  mode  when   the
  2196.      power   is  removed  and restored  to  the TNC.  The TNC may be switched
  2197.      back to ordinary AX.25 mode by issuing the command:
  2198.  
  2199.              param ax0 255
  2200.  
  2201.      This command will work even if the PERM command has been  used  to  make
  2202.      KISS the default mode of operation.
  2203.  
  2204.      2.3.  IBM PC and Clones
  2205.  
  2206.      2.3.1.  Installing the Plug'N'Play Disk
  2207.  
  2208.      For users of IBM PC's and Clones, we try to make life as simple as  pos-
  2209.      sible.   There is a 360k floppy disk available from TAPR (see the appen-
  2210.      dices for contact information) that is almost ready to go.   You  "Plug"
  2211.      the  disk in, edit a couple of files with your favorite text editor, and
  2212.      then you're ready to "Play". Instructions  on  editting  the  files  are
  2213.      embedded as comments in the files, with a readme file on the disk to get
  2214.      you started. For completeness, information about the files  is  included
  2215.      here as well.
  2216.  
  2217.      2.3.1.1.  The AUTOEXEC.NET File
  2218.  
  2219.      The AUTOEXEC.NET file (called STARTUP.NET under Unix, and  other  things
  2220.      elsewhere)  works  a  lot  like  the AUTOEXEC.BAT file in Dos, hence the
  2221.      name.  When NET first starts up, it reads AUTOEXEC.BAT and executes  all
  2222.      of  the  commands  as  if they had been typed in to the program from the
  2223.      keyboard. This provides an easy mechanism for  setting  up  the  initial
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.                                       - 35 -
  2234.  
  2235.  
  2236.      system  configuration, including setting the hostname, AX.25 parameters,
  2237.      interfaces used, servers to start, and protocol variables.
  2238.  
  2239.      The suggested procedure is to start with the AUTOEXEC.NET file  included
  2240.      on  the  plug  and  play disk, and go from there.  If you don't have the
  2241.      plug and play disk, review the command summary elsewhere in  this  docu-
  2242.      ment, and wing it...
  2243.  
  2244.      2.3.1.2.  The FTPUSERS File
  2245.  
  2246.      Since MS-DOS was designed as a single-user operating system,   it   pro-
  2247.      vides  no access  control;  all files can be read, written or deleted by
  2248.      the local user.  It is usually undesirable to give such open access to a
  2249.      system  to  remote network  users. The FTP server therefore provides its
  2250.      own access control mechan- ism.
  2251.  
  2252.      The file "/ftpusers" is used to control remote FTP access.  The  default
  2253.      is   NO access; if  this  file  does  not  exist, the FTP server will be
  2254.      unusable. A remote user must first "log in" to  the  system,  giving   a
  2255.      valid   name  and  password  listed  in  /ftpusers, before he or she can
  2256.      transfer files.
  2257.  
  2258.      Each entry in /ftpusers consists of a single line of the form
  2259.  
  2260.              username password path1 permissions1 path2 permissions2 ...
  2261.  
  2262.      There must be exactly one space between each  field. Comment  lines  are
  2263.      begun with "#" in column one.
  2264.  
  2265.      "username" is the user's login name.
  2266.  
  2267.      "password" is the required password. Note  that  this   is   in   plain-
  2268.      text; therefore  it  is  not a good idea to give general read permission
  2269.      to the root directory. A password of "*" (a single asterisk) means  that
  2270.      any  password  is acceptable.
  2271.  
  2272.      "/pathN" is an allowable prefix on accessible files.  Before  any   file
  2273.      or  directory   operation,  the current directory and the user specified
  2274.      file name are joined to form an absolute path name in "canonical"   form
  2275.      (i.e.,   a  full path  name  starting  at  the root, with "./" and "../"
  2276.      references, as well as  redundant  /'s,  recognized  and  removed).  The
  2277.      result  MUST  begin with an allowable  path  prefix; if  not, the opera-
  2278.      tion is denied. NB! Under MS-DOS, this field must use backslashes ("/"),
  2279.      NOT  forward  slashes  ("/").  This field  must always begin with a "/",
  2280.      i.e., at the root directory.
  2281.  
  2282.      "permissionsN" is a decimal number granting permission for read,  create
  2283.      and  write   operations.  If the low order bit (0x1) is set, the user is
  2284.      allowed to read a file subject to the path name prefix  restriction.  If
  2285.      the   next   bit  (0x2)  is  set,  the  user  is  allowed  to  create  a
  2286.      new file if it does not overwrite an existing file. If  the  third   bit
  2287.      (0x4)   is   set,   the   user   is allowed  to  write a file even if it
  2288.      overwrites an existing file, and in addi-  tion  he  may  delete  files.
  2289.      Again,  all  operations  are  allowed  subject  to  the path name prefix
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.                                       - 36 -
  2300.  
  2301.  
  2302.      restrictions. Permissions may be combined by adding bits,  for  example,
  2303.      0x3  (=  0x2  + 0x1) means that the user is given read and  create  per-
  2304.      mission, but not overwrite/delete permission.
  2305.  
  2306.      For example, suppose /ftpusers on machine  "pc.ka9q.ampr"  contains  the
  2307.      line
  2308.  
  2309.              friendly test /testdir 7
  2310.  
  2311.      A session using this account would look like this:
  2312.  
  2313.              net> ftp pc.ka9q.ampr
  2314.              SYN Sent
  2315.              Established
  2316.              250 pc.ka9q.ampr FTP  version  871225.5  ready  at  Wed  Jan  20
  2317.      16:27:18 1988
  2318.              user friendly
  2319.              331 Enter PASS command
  2320.              pass test
  2321.              230 Logged in
  2322.  
  2323.      The user now has read, write, overwrite and delete  privileges  for  any
  2324.      file under /testdir; he may not access any other files.
  2325.  
  2326.      Here are some more sample entries in /ftpusers:
  2327.  
  2328.          karn foobar / 7         # User "karn" password "foobar" may read,
  2329.                                  # write, overwrite and delete any file on
  2330.                                  # system.
  2331.  
  2332.          guest bletch /g/bogus 3 # User "guest" password "bletch" may read
  2333.                                  # any file under /g/bogus and its subdirs,
  2334.                                  # and may create new files that do not
  2335.                                  # overwrite existing files. He may NOT
  2336.                                  # delete any files.
  2337.  
  2338.          anonymous * /public 1   # User "anonymous" (any password) may read
  2339.                                  # files under /public and subdir; he may
  2340.                                  #  not  create,  overwrite  or  delete   any
  2341.                                  # files.
  2342.  
  2343.      The last entry is a standard convention for  keeping  a   repository  of
  2344.      downloadable   files;  in   particular,  the  username "anonymous" is an
  2345.      established ARPAnet convention.  Every system providing an FTP server is
  2346.      encouraged to provide restricted access to an 'anonymous' user.
  2347.  
  2348.      2.3.1.3.  The HOSTS.NET File
  2349.  
  2350.      The file HOSTS.NET provides a mapping  between  internet  addresses  and
  2351.      symbolic  hostnames.  It  is used by NET to look up a hostname to figure
  2352.      out the correct IP address to use. This version of NET does not  include
  2353.      nameserver support (see the discussion earlier in this document), and so
  2354.      uses this static file for name lookups.  Tabs  are  recommended  between
  2355.      the  host  number  and  host name.  Here is an example of some HOSTS.NET
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.                                       - 37 -
  2366.  
  2367.  
  2368.      entries:
  2369.  
  2370.              44.96.0.2       wb2sef xt.wb2sef
  2371.              44.96.0.16      n8fjb
  2372.              44.96.0.17      ka3lyq
  2373.  
  2374.      Note that the domain name .AMPR.ORG has been assigned for amateur radio.
  2375.      By  default,  we  assume that the hostname is the user's callsign in the
  2376.      case where a user has one system online, and so  <callsign>.AMPR.ORG  is
  2377.      the  implied official hostname. If you have more than one machine on the
  2378.      air, distinguish them by prefixing a familiar name followed by a period,
  2379.      as in "winfree.n3eua" or "at.n0ccz".
  2380.  
  2381.      Note that the use of a callsign as a host name has nothing  to  do  with
  2382.      the "mycall" parameter.  It is convenient to use the callsign as a host-
  2383.      name, and required to use the callsign for "mycall" to properly identify
  2384.      a station according to FCC rules.
  2385.  
  2386.      2.3.2.  Installing on a Hard Disk
  2387.  
  2388.      To install the software on a hard disk, just clone the directory  struc-
  2389.      ture  and  file  layout from the floppy disk.  All paths are relative to
  2390.      the root directory of the current drive.
  2391.  
  2392.      2.4.  Unix
  2393.  
  2394.      To run NET under Unix, you'll need to compile the program from  sources.
  2395.      To do so, unpack the source archive into a directory, edit the beginning
  2396.      of makefile.unx to pick your Unix variant, edit config.h to  enable  the
  2397.      appropriate interface hardware (slip and kiss are probably all that will
  2398.      work), the run 'make -f makefile.unx'.  There's nothing wrong with copy-
  2399.      ing  the  makefile.unx  file to makefile and doing the editting there...
  2400.      personal preference.
  2401.  
  2402.      The basic requirements are that the serial ports to be used by net  must
  2403.      have  their  permissions  set so that they are read-write for the userid
  2404.      that will run net. For example, you can define a user  named  'net'  and
  2405.      make that user own tty000 and tty001. The protection for the ttys should
  2406.      be crw------- (600). Logins must be turned off  for  those  ports,  i.e.
  2407.      there  must not be any other process, such as a getty or init, trying to
  2408.      access them. The attach line is virtually the same as for the PC, except
  2409.      that  the I/O address argument is ignored and the I/O vector argument is
  2410.      now the tty name. For example:
  2411.  
  2412.              attach asy 0 /dev/tty000 ax25 ax0 2048 256 4800
  2413.  
  2414.              attach asy 0 /dev/tty001 ax25 ax1 2048 256 4800
  2415.  
  2416.      The Unix version of Net uses  two  environment  variables,  NETHOME  and
  2417.      NETSPOOL. A possible configuration might be
  2418.  
  2419.              NETHOME=/usr/net         NETSPOOL=/usr/spool
  2420.  
  2421.      The directories needed are /usr/net, /usr/net/finger,  /usr/spool/mail/,
  2422.  
  2423.  
  2424.  
  2425.  
  2426.  
  2427.  
  2428.  
  2429.  
  2430.  
  2431.                                       - 38 -
  2432.  
  2433.  
  2434.      and  /usr/spool/mqueue.  See  also  the  documentation  on  the W2XO BBS
  2435.      (sources and documentation are included in the NET source distribution),
  2436.      as  there  are some important interactions if you intend to run the PBBS
  2437.      code with NET under Unix.
  2438.  
  2439.      The Unix version of NET currently supports only serial ports,  with  the
  2440.      KISS and SLIP protocols.
  2441.  
  2442.      2.5.  Macintosh
  2443.  
  2444.      This release does not include Macintosh code.  A separate group is work-
  2445.      ing  on  the  Macintosh,  using  the  same  system  independent protocol
  2446.      modules, but with a user interface that is much more closely related  to
  2447.      the expected Macintosh environment.
  2448.  
  2449.      Installation documentation for the Mac is included with the Mac  version
  2450.      of the software, available from <insert contact info here>.
  2451.  
  2452.      2.6.  Atari ST
  2453.  
  2454.      Installation for the Atari version of NET is not  yet  available.   Your
  2455.      best bet is to stare at the sources, in config.h and files.h, as well as
  2456.      st.c and st.h. We hope to include documentation in the next revision  of
  2457.      this manual.
  2458.  
  2459.      2.7.  NEC PC-9801
  2460.  
  2461.      Installation on the NEC PC-98 family is the same as for the IBM  PC  and
  2462.      clones,  except  that  you  need  to  have  the  version of NET.EXE that
  2463.      includes handling for the serial port(s) in the NEC machine.
  2464.  
  2465.      2.8.  Hewlett-Packard Portable Plus
  2466.  
  2467.      Installation on the Portable Plus is the same as  for  the  IBM  PC  and
  2468.      clones,  except  that  you  need  to have the version of NET.EXE that is
  2469.      designed for the Portable Plus.
  2470.  
  2471.  
  2472.  
  2473.  
  2474.  
  2475.  
  2476.  
  2477.  
  2478.  
  2479.  
  2480.  
  2481.  
  2482.  
  2483.  
  2484.  
  2485.  
  2486.  
  2487.  
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.                                       - 39 -
  2498.  
  2499.  
  2500.      3.  Taking NET for a Test Drive
  2501.  
  2502.      For the quick introduction to NET provided in this  section,  we  assume
  2503.      that you are using an IBM PC or clone with the Plug'n'Play disk. We also
  2504.      assume that you've already configured the disk per in  the  installation
  2505.      instructions.   Finally,  we  assume  a TNC has been set up as interface
  2506.      'ax0'.
  2507.  
  2508.      3.1.  Trying out the AX.25 Support
  2509.  
  2510.      Start by typing 'NET' to get the program up and running.  You should  be
  2511.      presented  with  a banner including revision information and a copyright
  2512.      statement, followed by a prompt of 'net>'. If you don't get this,  some-
  2513.      thing is horribly wrong. Find a friend and ask for help.
  2514.  
  2515.      Once you have the program going at all, the first thing you'll  probably
  2516.      want  to  do  is  to  figure  out if the TNC is hooked up correctly, and
  2517.      whether you're getting out at all.  To get connected, you  do  basically
  2518.      the  same thing you'd do with a raw TNC.  Type 'connect ax0 <callsign>',
  2519.      where <callsign> is someone's callsign who is known to be  on  the  air.
  2520.      You  can  also  specify a digipeater string. For example, you could type
  2521.      one of:
  2522.  
  2523.           connect ax0 n3eua              (connect using the ax0 TNC to N3EUA)
  2524.           connext ax0 n3eua n1fed n0ccz  (conn to N3EUA via N1FED and N0CCZ)
  2525.  
  2526.      If all is well, you should get "Conn Pending" and then "Connected"  mes-
  2527.      sages.  At this point, you're connected just like using a plain old TNC.
  2528.      Kind of boring, huh?  It'll get more exciting soon!
  2529.  
  2530.      When you're ready to disconnect, use the <F10> key to  escape  from  the
  2531.      session back to the 'net>' prompt, and then type 'disconnect'.  You will
  2532.      discover that all commands can be abbreviated, and you can type a
  2533.  
  2534.      If things don't work, watch the lights on  the  TNC  to  see  if  you're
  2535.      transmitting  at  all, then go read up on the "trace" command so you can
  2536.      see what the program thinks it's doing.  Even easier, if there's someone
  2537.      else using TCP in your area, ask for help!
  2538.  
  2539.      3.2.  The Telnet Command
  2540.  
  2541.      If there's someone else on the air in your area  already  using  TCP/IP,
  2542.      then  the  next  most  easy  thing to do is to try a keyboard connection
  2543.      using the Telnet protocol. The end result will be the same as  doing  an
  2544.      AX.25  connect in most cases, but you'll be taking advantage of a couple
  2545.      of neat attributes of having more protocol horsepower to help you out.
  2546.  
  2547.      First, you need to either know the numeric IP address of  your  friend's
  2548.      system, or you need to have updated HOSTS.NET to include the system name
  2549.      and the numeric address.  Then all you have to do is type:
  2550.  
  2551.           telnet n3eua            (talk to N3EUA, address in HOSTS.NET)  tel-
  2552.           net [44.32.0.4]      (use the numeric address directly)
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.                                       - 40 -
  2564.  
  2565.  
  2566.      Now you can type back and forth just as if you  were  connected  with  a
  2567.      normal  TNC.  When you're done, use the <F10> key to escape back to com-
  2568.      mand mode, and then type 'close' to close the connection gracefully,  or
  2569.      'reset' if you're really in a hurry.
  2570.  
  2571.      3.3.  The FTP Command
  2572.  
  2573.      So far, all we've done is to use more software and work harder to do the
  2574.      same  things we can do with a plain old TNC.  The FTP command isn't like
  2575.      that!  If you want to get a file from your  friends'  machine,  you  can
  2576.      type the command:
  2577.  
  2578.           ftp n3eua
  2579.      to start a file transfer session to the N3EUA machine.  When the connec-
  2580.      tion is opened, you'll get a banner from the remote machine, followed by
  2581.      a prompt for your user name.  If you've negotiated with your  friend  to
  2582.      have  a  special  username  and  password set up for you in his FTPUSERS
  2583.      file, use that. If not, many machines allow arbitrary users to get  lim-
  2584.      ited  access to the files available with a special username 'anonymous'.
  2585.      If you want to use the 'anonymous' login, when  you're  prompted  for  a
  2586.      password  enter  your  callsign  or something else recognizable, as many
  2587.      folks keep a log of FTP's so they know what files people care about, and
  2588.      being able to associate your activities with you sometimes helps.
  2589.  
  2590.      3.4.  The Mail System
  2591.  
  2592.      The mail system is a subject unto itself. It is also one  of  the  truly
  2593.      nifty  things about running TCP/IP.  Look elsewhere in the documentation
  2594.      for a complete rundown on how to install and operate the BM mailer,  and
  2595.      the portions of NET related to it.
  2596.  
  2597.      3.5.  Tracing and Status Commands
  2598.  
  2599.      The tracing and status commands provide  a  great  deal  of  information
  2600.      about  what  is  going on in the system. All we'll attempt to do here is
  2601.      raise your interest level.
  2602.  
  2603.      If you want to find out what  sessions  are  active  to  and  from  your
  2604.      machine,  you can type 'sessions' and you'll get a list.  If you want to
  2605.      get information about all of the TCP connections open to and  from  your
  2606.      machine,  including  mail transfers and other things that don't directly
  2607.      interact with your keyboard and screen, you can type  "tcp  status"  and
  2608.      you'll get a list of connections.
  2609.  
  2610.      If you're not sure what's happening on an interface, or  you'd  like  to
  2611.      "read  the mail" (watch what other folks are doing ont he channel), then
  2612.      use the "trace" command.  The form is descibed in the command  reference
  2613.      elsewhere in this document.  For example:
  2614.  
  2615.           trace ax0 111         (activity on ax0, including ASCII dump) trace
  2616.           ax0  211         (activity on ax0, including hex dump) trace ax0 11
  2617.           (activity on ax0, printing only the headers)
  2618.  
  2619.      Note that you also have control over whether tracing can bother you in a
  2620.  
  2621.  
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627.  
  2628.  
  2629.                                       - 41 -
  2630.  
  2631.  
  2632.      session, see the trace command summary for more details.
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  
  2645.  
  2646.  
  2647.  
  2648.  
  2649.  
  2650.  
  2651.  
  2652.  
  2653.  
  2654.  
  2655.  
  2656.  
  2657.  
  2658.  
  2659.  
  2660.  
  2661.  
  2662.  
  2663.  
  2664.  
  2665.  
  2666.  
  2667.  
  2668.  
  2669.  
  2670.  
  2671.  
  2672.  
  2673.  
  2674.  
  2675.  
  2676.  
  2677.  
  2678.  
  2679.  
  2680.  
  2681.  
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.                                       - 42 -
  2696.  
  2697.  
  2698.      4.  The Mail System
  2699.  
  2700.      As is typical with networking  software,  handling  electronic  mail  is
  2701.      often  as  big a job as coping with all other applications combined.  In
  2702.      order to make full use of the mail system in the KA9Q package, you  will
  2703.      need to spend a little time getting things configured for your system.
  2704.  
  2705.      4.1.  Installing and Using BM
  2706.  
  2707.      The BM.EXE mail user interface program  was  created  by  Bdale  Garbee,
  2708.      N3EUA,  and  despite  popular  belief,  'BM'  really stands for "Bdale's
  2709.      Mailer".  Gerard van der Grinten  PA0GRI  extended  the  mailer  with  a
  2710.      number  of new features that resulted in version 2.  More recently, Dave
  2711.      Trulli NN2Z has extended the mailer creating revision 3.   All  comments
  2712.      or suggestions about BM should be directed to Dave.
  2713.  
  2714.      BM provides a full set of mail services to the user which allow  sending
  2715.      and  receiving electronic mail, as well as a variety of local mail mani-
  2716.      pulation commands.
  2717.  
  2718.      4.1.1.  Installation
  2719.  
  2720.      To install BM requires the modification  of  the  supplied configuration
  2721.      files  and  the  creation  of  the  proper directory structure. The fol-
  2722.      lowing sections describe  the file and directory structure  used  by  BM
  2723.      and SMTP.
  2724.  
  2725.      4.1.1.1.  Directory Structure
  2726.  
  2727.      /spool/mqueue   This directory  holds  the  outbound  mail
  2728.                      jobs  for  SMTP.  Each  job  consists of 2
  2729.                      files a xxxx.txt and xxxx.wrk  file  where
  2730.                      xxxx  is  a  unique numerical prefix.  The
  2731.                      format of the files  are  described  in  a
  2732.                      later section.
  2733.  
  2734.      /spool/rqueue   This directory is used by  SMTP  for  jobs
  2735.                      that   have  been  received  and  will  be
  2736.                      processed by a user defined  mail  routing
  2737.                      program.    This  directory  is  not  used
  2738.                      directly by BM.
  2739.  
  2740.      /spool/mail     This  directory   holds   the   individual
  2741.                      mailboxes  for  each  user  name  on  your
  2742.                      system. The extension .txt is add  to  the
  2743.                      user  name  to form the mailbox name. Mail
  2744.                      received by the SMTP server is appended to
  2745.                      the mailbox file.
  2746.  
  2747.      4.1.1.2.  Configuration File
  2748.  
  2749.      The /bm.rc file provides  BM  with  the  configuration  needed  for  the
  2750.      operation of the mailer.
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.                                       - 43 -
  2762.  
  2763.  
  2764.      The format for the /bm.rc file is:
  2765.  
  2766.              variable <space>  value <newline>
  2767.  
  2768.      The following variables are valid in the bm.rc file:
  2769.  
  2770.  
  2771.      4.1.1.2.1.  smtp <path>
  2772.  
  2773.      Defines the path to the directory containing  the  mailbox files.    The
  2774.      default  directory  is  /spool/mail  on  the current drive.
  2775.  
  2776.      4.1.1.2.2.  host <your hostname>
  2777.  
  2778.      Is used to set the local hostname for use  in  the  RFC822 mail headers.
  2779.      This  is a required field.  This should match the hostname definition in
  2780.      autoexec.net.
  2781.  
  2782.      4.1.1.2.3.  user <username>
  2783.  
  2784.      Defines the user name of the person who is  sending  mail.  This is also
  2785.      used  as  the  default mailbox for reading mail.  On the AMPRNET this is
  2786.      usually set to your call.  There is a DOS limit of 8 characters for  the
  2787.      user name.
  2788.  
  2789.      4.1.1.2.4.  edit <path of your editor>
  2790.  
  2791.      Defines the name of your favorite editor which can be used to  construct
  2792.      and  edit the text of outgoing messages.  The use of edit is optional.
  2793.  
  2794.      4.1.1.2.5.  fullname <your full name>
  2795.  
  2796.      Is used to provide your full name to the mailer for use in the   comment
  2797.      portion  of "From:" header line.  The use of fullname is optional.
  2798.  
  2799.      4.1.1.2.6.  reply <return address>
  2800.  
  2801.      Defines the address where you wish  to  receive   replies   to  messages
  2802.      sent.   This  option  is  useful if you are operating your pc on a local
  2803.      area network and would like  your  mail replies  sent  to  a  more "well
  2804.      known  host".  The address specified by reply  is  used  to  generate  a
  2805.      "Reply-To:" header  in outbound mail. The "Reply-To:"  header  overrides
  2806.      the  "From:"  header  which  is  the address normally  used  to reply to
  2807.      mail. This field is optional.
  2808.  
  2809.      4.1.1.2.7.  maxlet <number of messages>
  2810.  
  2811.      defines  the  maximum  number  of  messages  that  can  be processed  by
  2812.      BM  in one mailbox file. The default value of maxlet is 100.
  2813.  
  2814.      4.1.1.2.8.  mbox <filename>
  2815.  
  2816.      Specifies the default file  to  be   used   for   the   "save"  command.
  2817.      This  file  is  in  the same format as a mailbox and may later be viewed
  2818.  
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.                                       - 44 -
  2828.  
  2829.  
  2830.      using the -f option  of  BM.  If  this  option  is  not  used  then  the
  2831.      default is set to mbox.
  2832.  
  2833.      4.1.1.2.9.  record <filename>
  2834.  
  2835.      If defined a copy of each message sent will  be  saved  in <filename>.
  2836.  
  2837.      4.1.1.2.10.  folder <directory name>
  2838.  
  2839.      If defined folder contains  the  path  used  by  the  save command.
  2840.  
  2841.      4.1.1.2.11.  screen [bios|direct]
  2842.  
  2843.      In the Turboc compiled version  of  BM,  screen  sets  the display  out-
  2844.      put  mode to use either direct writes to screen memory or the ROM  BIOS.
  2845.      The  default  is  direct  which provides  the   fastest   output   mode.
  2846.      If  you are using a windowing system such as Desqview you should set the
  2847.      mode to bios.
  2848.  
  2849.      4.1.1.2.12.  Example BM.RC File
  2850.  
  2851.           host nn2z.ampr user dave fullname Dave Trulli # send my replies  to
  2852.           the  Sun  reply  nn2z@ka9q.bellcore.com screen  direct edit /bin/vi
  2853.           mbox c:/folder/mbox record c:/folder/outmail folder c:/folder  max-
  2854.           let 200
  2855.  
  2856.      4.1.1.3.  The ....lias File
  2857.  
  2858.      The alias file provides  an  easy way to  maintain  mailing  lists.   An
  2859.      alias  can  be  any  string of characters not containing the "@" symbol.
  2860.      The  format for the alias file is:
  2861.  
  2862.                     alias   recip1 recip2 recip3
  2863.                     <tab>   recip4
  2864.  
  2865.      Note that a long list of aliases can be  continued   on   an  additional
  2866.      line  by  placing  a  tab  or  space  on  the continuation line.
  2867.  
  2868.      Some examples aliases are:
  2869.  
  2870.                     dave    nn2z@nn2z.ampr
  2871.  
  2872.                     phil    karn@ka9q.bellcore.com
  2873.  
  2874.                     # mail to local nnj users
  2875.                     nnj     wb2cop@wb2cop.ampr karn@ka9q.bellcore.com
  2876.                             wb0mpq@home.wb0mpq.ampr w2kb@w2kb.ampr
  2877.  
  2878.      In  the  above  example,  when  specifying  nnj    as    the  recipient,
  2879.      BM  will  expand  the  alias  into the list of recipients from the alias
  2880.      file.  At this time an alias may not contain any other aliases.
  2881.  
  2882.  
  2883.  
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.                                       - 45 -
  2894.  
  2895.  
  2896.      4.1.1.4.  /spool/mqueue/sequence.seq The sequence file maintains a  mes-
  2897.      sage  counter  which  is used by BM and SMTP to generate message ids and
  2898.      unique filenames. This file is created if not already present by BM.
  2899.  
  2900.      4.1.2.  Environment
  2901.  
  2902.      The timezone used in mail headers is obtained from the  DOS  environment
  2903.      variable TZ. An example TZ setting is:
  2904.  
  2905.              set TZ=EDT4
  2906.  
  2907.      It  is  set  in  your  AUTOEXEC.BAT  file.  The   first    3  characters
  2908.      are   the  timezone and the fourth character is the number of hours from
  2909.      GMT time. If TZ is not  set,  GMT is assumed.
  2910.  
  2911.      4.2.  Commands
  2912.  
  2913.      All BM commands are single letters  followed   by   optional  arguments.
  2914.      The  command  list  has been designed to make those familiar with Berke-
  2915.      ley mailers comfortable with BM.
  2916.  
  2917.      4.2.1.  Main Menu Commands
  2918.  
  2919.      4.2.1.1.  m [userlist]
  2920.  
  2921.      The mail command is used to send a message to one or   more  recipients.
  2922.      All  local  recipient  names  (  those  which don't contain an '@' ) are
  2923.      checked for possible aliases.  If  no  arguments    are   supplied   you
  2924.      will   be   prompted   for   a recipient list.  While entering a message
  2925.      into  the  text buffer several commands are available such as:  invoking
  2926.      an  editor,  and reading in text from other messages or  files.  See the
  2927.      section below for a description of these commands.   To  end  a  message
  2928.      enter a line containing a single period.
  2929.  
  2930.      It is important to remember that the input line buffer has a  128  char-
  2931.      acter   limit.   You   should  format  your  text by entering a carriage
  2932.      return at the end of each line. Typing excessively    long   lines   may
  2933.      cause   data   loss  due  to truncation when passing the message through
  2934.      other  hosts.  Keeping  lines  less  than  80  characters  is  always  a
  2935.      good idea.
  2936.  
  2937.      4.2.1.2.  d [msglist]
  2938.  
  2939.      Mark messages for deletion.  Messages marked for  deletion are   removed
  2940.      when   exiting  BM  via the 'q' command or when changing to an alternate
  2941.      mailbox with the 'n' command.
  2942.  
  2943.      4.2.1.3.  h
  2944.  
  2945.      Display message headers.  The  message  headers   contain   the  message
  2946.      number,  the  status indicating whether it has been read or deleted, the
  2947.      sender, size, date, and subject.
  2948.  
  2949.  
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959.                                       - 46 -
  2960.  
  2961.  
  2962.      4.2.1.4.  u [msglist]
  2963.  
  2964.      Undelete a message that is marked for deletion. The status of   a   mes-
  2965.      sage   can  be  determined by looking at the status field of the message
  2966.      using the 'h' command.
  2967.  
  2968.      4.2.1.5.  n [mailbox]
  2969.  
  2970.      Display or change mailbox.  The  'n'  command  with  no  arguments  will
  2971.      display   a   list  of mailboxes containing mail. If an argument is sup-
  2972.      plied, then the current mailbox  is  closed and a new mailbox is opened.
  2973.  
  2974.      4.2.1.6.  ! cmd
  2975.  
  2976.      Run a DOS command from inside BM. An  error   message   will  result  if
  2977.      there is not enough memory available to load the command.
  2978.  
  2979.      4.2.1.7.  ?
  2980.  
  2981.      Print a help menu for BM commands.
  2982.  
  2983.      4.2.1.8.  s [msglist] [file]
  2984.  
  2985.      The 's' command is used to save messages in a  file.   If   no  filename
  2986.      is   given  the default from the mbox variable in /bm.rc is used.  If no
  2987.      message number is supplied then the current  message   is   saved.   The
  2988.      message  is  stored  in  the same format as a mailbox file with all mail
  2989.      headers  left intact.
  2990.  
  2991.      4.2.1.9.  p [msglist]
  2992.  
  2993.      The 'p' command is used to send  messages  to  the  printer.  This  com-
  2994.      mand   uses  the  DOS device PRN for output.  This command is equivalent
  2995.      to:
  2996.           s [ msglist ] PRN
  2997.  
  2998.      4.2.1.10.  w [msglist] file
  2999.  
  3000.      The 'w' command is used to save messages in a  file.  Only  the  message
  3001.      body   is  saved. All mail headers are removed.  If no message number is
  3002.      supplied then the current message  is saved.
  3003.  
  3004.      4.2.1.11.  f [msg]
  3005.  
  3006.      The 'f' command is used to forward a mail message to another  recipient.
  3007.      If  no message number is supplied the current message is used.  The user
  3008.      is prompted for the  recipients and  a  subject. The  RFC822  header  is
  3009.      added  to the message text while retaining the complete original message
  3010.      in  the body.  Also see the ~m command.
  3011.  
  3012.      4.2.1.12.  b [msg]
  3013.  
  3014.      Bounce a message. Bounce  is  similar  to  forwarding  but  instead   of
  3015.      your    user    information,    the   original  sender  information   is
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.  
  3025.                                       - 47 -
  3026.  
  3027.  
  3028.      maintained.   If  no  message  number  is supplied the  current  message
  3029.      is used.
  3030.  
  3031.      4.2.1.13.  r [msg]
  3032.  
  3033.      Reply to a message. Reply reads the header  information   in  order   to
  3034.      construct  a  reply  to the sender. The destination information is taken
  3035.      from  the  "From:"  or  the  "Reply-To:" header,  if  included.   If  no
  3036.      message number is supplied the current message is used.
  3037.  
  3038.      4.2.1.14.  msg#
  3039.  
  3040.      Entering  a message number from the  header   listing   will  cause  the
  3041.      message text to be displayed.
  3042.  
  3043.      4.2.1.15.  l
  3044.  
  3045.      List outbound messages.  The job number, the  sender,  and the  destina-
  3046.      tion  for  each message is displayed. A status of "L" will appear if the
  3047.      SMTP sender has the file locked.
  3048.  
  3049.      4.2.1.16.  k [msglist]
  3050.  
  3051.      Remove an outbound message from the mqueue.  A message can  be   removed
  3052.      from   the  send  queue  by specifying the job number obtained by the  l
  3053.      command.   If  the  message  is locked  you will be warned that you  may
  3054.      be  removing  a  file  that  is  currently being sent by SMTP. You  will
  3055.      asked  if this job should still be killed.
  3056.  
  3057.      4.2.1.17.  $
  3058.  
  3059.      Update the mailbox.  This   command   updates   the   mailbox,  deleting
  3060.      messages   marked for deletion and reading in any new mail that may have
  3061.      arrived since entering BM.
  3062.  
  3063.      4.2.1.18.  x
  3064.  
  3065.      Exit to DOS without changing the data in the mailbox.
  3066.  
  3067.      4.2.1.19.  q
  3068.  
  3069.      Quit to DOS updating the mailbox.
  3070.  
  3071.      4.2.2.  Text Input Commands
  3072.  
  3073.      The  following  commands  are  available  while   entering message  text
  3074.      into the message buffer.
  3075.  
  3076.           ~r <filename>  read <filename> into the message buffer.
  3077.  
  3078.           ~m <msg #>     read <msg #> into the message buffer.
  3079.  
  3080.           ~p             display the text in the message buffer.
  3081.  
  3082.  
  3083.  
  3084.  
  3085.  
  3086.  
  3087.  
  3088.  
  3089.  
  3090.  
  3091.                                       - 48 -
  3092.  
  3093.  
  3094.           ~e             invoke the editor defined in /bm.rc with  a
  3095.                          temporary  file  containing the text in the
  3096.                          message buffer.
  3097.  
  3098.           ~q             Abort the current message. No data is sent.
  3099.  
  3100.           ~~             Insert a single tilda  character  into  the
  3101.                          message.
  3102.  
  3103.           ~?             Display help menu of tilda escape commands.
  3104.  
  3105.      4.2.3.  Command Line Options BM may be invoked as follows:
  3106.  
  3107.      To send mail:
  3108.           bm [ -s subject ] recip1 .. .. recipN
  3109.  
  3110.      To read mail:
  3111.           bm [ -u mailbox | -f file ]
  3112.  
  3113.                -s subject     This option sets the subject to the text on
  3114.                               the command line.
  3115.  
  3116.                -u mailbox     Specify  which  mailbox  to   read.   This
  3117.                               overides the default from the bm.rc.
  3118.  
  3119.                -f file        Read  message  from  "file"  instead  of  a
  3120.                               mailbox.
  3121.  
  3122.      4.3.  Technical Information
  3123.  
  3124.      4.3.1.  Outbound Mail Queue File Formats
  3125.  
  3126.      Outgoing mail messages consist of two files each in  the   /spool/mqueue
  3127.      direc-  tory.    The   names   of   the  two  files  will be of the form
  3128.      <integer>.WRK and <integer>.TXT, where integer is the sequence number of
  3129.      the message relative to this  machine.   The  file  sequence.seq  in the
  3130.      mqueue directory contains the current sequence number for  reference  by
  3131.      the  mail user  interface.   The  .TXT file contains the data portion of
  3132.      the SMTP transaction, in full RFC822 format.  The .WRK file consists  of
  3133.      3 or more lines, as follows:
  3134.  
  3135.           the hostname of the destination system
  3136.  
  3137.           the full sender address, in user@host format.
  3138.  
  3139.           some number of full destination addresses, in user@host format.
  3140.  
  3141.      4.3.2.  Standards Documents
  3142.  
  3143.      The SMTP specification is RFC821. The Format for text messages  (includ-
  3144.      ing  the headers) is in RFC822. RFC819 discusses hostname naming conven-
  3145.      tions, particularly domain naming.
  3146.  
  3147.  
  3148.  
  3149.  
  3150.  
  3151.  
  3152.  
  3153.  
  3154.  
  3155.  
  3156.  
  3157.                                       - 49 -
  3158.  
  3159.  
  3160.      4.4.  Bug Reports
  3161.  
  3162.      Please send any comments, suggestions or bug reports about BM to:
  3163.  
  3164.           Dave  Trulli  Usenet:  nn2z@ka9q.bellcore.com   packet:   nn2z@nn2z
  3165.           AMPRNET: nn2z@nn2z.ampr [44.64.0.10]
  3166.  
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172.  
  3173.  
  3174.  
  3175.  
  3176.  
  3177.  
  3178.  
  3179.  
  3180.  
  3181.  
  3182.  
  3183.  
  3184.  
  3185.  
  3186.  
  3187.  
  3188.  
  3189.  
  3190.  
  3191.  
  3192.  
  3193.  
  3194.  
  3195.  
  3196.  
  3197.  
  3198.  
  3199.  
  3200.  
  3201.  
  3202.  
  3203.  
  3204.  
  3205.  
  3206.  
  3207.  
  3208.  
  3209.  
  3210.  
  3211.  
  3212.  
  3213.  
  3214.  
  3215.  
  3216.  
  3217.  
  3218.  
  3219.  
  3220.  
  3221.  
  3222.  
  3223.                                       - 50 -
  3224.  
  3225.  
  3226.      5.  NET/ROM Support
  3227.  
  3228.      5.1.  Introduction The NET/ROM support for the KA9Q package serves three
  3229.      purposes:
  3230.  
  3231.              1) Existing NET/ROM networks may be used to send IP traffic.
  3232.  
  3233.              2) NET may be used as a NET/ROM packet switch.
  3234.  
  3235.              3) NET may be used to communicate with NET/ROM  nodes,  and  its
  3236.                  mailbox  facility  can accept connects over the NET/ROM net-
  3237.      work.
  3238.  
  3239.      5.2.  Setting up the NET/ROM Interface
  3240.  
  3241.         No physical interface is completely dedicated to net/rom, which is as
  3242.      it  should  be.  You attach all your AX.25 interfaces, of whatever sort.
  3243.      Then you attach the net/rom pseudo-interface  ("attach  netrom").   Then
  3244.      you  identify to the net/rom software those interfaces you want to allow
  3245.      it to use, with the "netrom interface" command.  The format of this com-
  3246.      mand is:
  3247.  
  3248.              netrom interface ax0 #ipnode 192
  3249.  
  3250.      The first argument is the name of the previously attached interface  you
  3251.      want  to use.  The second argument is the alias of your node, to be used
  3252.      in your routing broadcasts.  The alias is never used for  anything  else
  3253.      (as  you  will  see!).   The  last number is the net/rom quality figure.
  3254.      This is used in computing the route qualities; it represents the contri-
  3255.      bution  of  this  interface to the overall computation.  For a 1200 baud
  3256.      half-duplex connection, 192 is the right number.
  3257.  
  3258.         You need a netrom interface command for every interface you're  going
  3259.      to use with net/rom.
  3260.  
  3261.      5.3.  Tracing on the NET/ROM Interface
  3262.  
  3263.         If you want to trace your NET/ROM datagrams,  don't  try  turning  on
  3264.      trace  mode for the "netrom" interface.  Nothing will break, but nothing
  3265.      will happen.  You should trace the individual AX.25 interfaces instead.
  3266.  
  3267.      5.4.  Routing Broadcasts
  3268.  
  3269.         Once you have set up your interfaces, you need to  set  some  timers.
  3270.      There are two:  the nodes broadcast interval timer, and the obsolescence
  3271.      timer.  These are set in seconds, like the smtp timer.  You should  usu-
  3272.      ally  set  them to an hour.  You can set them to something different, if
  3273.      you want.  If your local net/rom nodes broadcast  every  hour,  but  you
  3274.      want to do so every ten minutes, you can say:
  3275.  
  3276.              netrom nodetimer 600         netrom obsotimer 3600
  3277.  
  3278.      Every time the obsotimer kicks, the obsolescence  counts  for  all  non-
  3279.      permanent  entries  are decremented by one.  When the count for an entry
  3280.  
  3281.  
  3282.  
  3283.  
  3284.  
  3285.  
  3286.  
  3287.  
  3288.  
  3289.                                       - 51 -
  3290.  
  3291.  
  3292.      falls below five, it is no longer broadcast.  When it falls to 0, it  is
  3293.      removed.  The count is initialized at 6.  These will eventually be sett-
  3294.      able parameters; you can adjust them now by  changing  the  initializers
  3295.      for the variables in the source file.
  3296.  
  3297.         When you first come on the air, you can send out nodes broadcasts  to
  3298.      tell the local nodes that you are available.  Use the command:
  3299.  
  3300.              netrom bcnodes ax0
  3301.  
  3302.      where ax0 is the interface on which you want to send the broadcast.   Do
  3303.      this for every interface on which you want to do this.
  3304.  
  3305.         By default, the NET/ROM code does not broadcast the contents of  your
  3306.      routing  table.   This is as it should be, since usually we just want to
  3307.      be the endpoints of communications rather than relaying NET/ROM traffic.
  3308.      If you want to be a switch station, include the command:
  3309.  
  3310.              netrom verbose yes
  3311.  
  3312.      in your autoexec.
  3313.  
  3314.         Sometimes you can hear broadcasts from nodes that can't hear you.  If
  3315.      your  routing  table  gets  filled with these unusable routes, your node
  3316.      will grind to a halt.  The solution to this is node broadcast filtering,
  3317.      via  the  netrom nodefilter command.  There is a filter list, which con-
  3318.      tains a list of callsigns and interfaces.  Then there is a filter  mode,
  3319.      which indicates what to do with the list.
  3320.  
  3321.         If the filter mode is  "none",  no  filtering  is  done.   If  it  is
  3322.      "accept",  then only broadcasts from the indicated stations on the indi-
  3323.      cated interfaces are accepted.  If it is "reject", then  all  broadcasts
  3324.      except  those  from  the  listed  stations  on the listed interfaces are
  3325.      accepted.
  3326.  
  3327.         Because the net/rom code  cannot  at  this  time  recognize  unusable
  3328.      routes  and  try alternates, I strongly recommend use of the filter com-
  3329.      mand to restrict broadcast acceptance to those nodes which you know  you
  3330.      can reach.
  3331.  
  3332.      5.5.  The NET/ROM Routing Table
  3333.  
  3334.         The next net/rom commands are those used for maintaining the  routing
  3335.      table.   They  fall  under  the "netrom route" subcommand.  "netrom add"
  3336.      adds a permanent entry to the routing table.  Its format is:
  3337.  
  3338.              netrom route add #foo w9foo ax0 192 w9rly
  3339.  
  3340.      This command adds an entry for w9foo, whose alias is #foo, route quality
  3341.      192,  via  w9rly  on  interface  ax0.  Let's talk about what this means.
  3342.      w9foo is the *destination* node, the one to whom you  want  the  packets
  3343.      routed  by  the  net/rom network.  w9rly is your *neighbor*, the net/rom
  3344.      node to which you pass the packet to  be  forwarded.   Since  w9rly  may
  3345.      appear on more than one interface (the callsign may be used by more than
  3346.  
  3347.  
  3348.  
  3349.  
  3350.  
  3351.  
  3352.  
  3353.  
  3354.  
  3355.                                       - 52 -
  3356.  
  3357.  
  3358.      one net/rom node on different bands), we specify that we are to use  ax0
  3359.      to send the packet.
  3360.  
  3361.         With net/rom, like IP, we don't know exactly what route a packet will
  3362.      take  to its destination.  We only know the name of a neighbor which has
  3363.      indicated a willingness to forward that packet (of course, the  neighbor
  3364.      may  be the destination itself, but that's unlikely in our application).
  3365.      Net/rom sends the packet to the neighbor, with a network header specify-
  3366.      ing  our  callsign  and  that  of the ultimate destination (in this case
  3367.      w9foo).
  3368.  
  3369.         We can use the netrom route add command  to  establish  a  digipeater
  3370.      path to the neighbor.  For example:
  3371.  
  3372.              netrom route add #foo w9foo ax0 192 w9rly wd9igi
  3373.  
  3374.      This will cause us to use wd9igi as a  digipeater  in  establishing  our
  3375.      connection to the net/rom node w9rly.
  3376.  
  3377.         To drop the route to w9foo, you would type
  3378.  
  3379.              netrom route drop w9foo w9rly ax0
  3380.  
  3381.         To see the contents of your routing table, you may type
  3382.  
  3383.              netrom route
  3384.  
  3385.      and to see the routing entries for an individual station you can type
  3386.  
  3387.              netrom route info <callsign>
  3388.  
  3389.      You may not use an alias as an argument to the netrom  route  info  com-
  3390.      mand.
  3391.  
  3392.         I can not stress enough that "route add" and "netrom route  add"  are
  3393.      two  different  commands, with different purposes.  In general, you only
  3394.      need a "netrom route add" if you need to add a route to a  net/rom  node
  3395.      via  a  digipeater  path.   If you find yourself using this command, ask
  3396.      yourself, "Why am I doing this?"  Many people  do  not  understand  that
  3397.      net/rom does automatic routing (well, sort of :-)).
  3398.  
  3399.      5.6.  The Importance of the Routing Table
  3400.  
  3401.         The NET/ROM routing table is analogous to the IP routing  table:   if
  3402.      there  is nothing in it, your NET/ROM traffic will not go out.  You must
  3403.      either manually enter a list of routes (perhaps via  your  autoexec.net)
  3404.      or  wait  to  receive routing broadcasts from your neighbors before your
  3405.      NET/ROM traffic will leave your station.
  3406.  
  3407.         If you go to send packets via NET/ROM and nothing  happens,  even  if
  3408.      you  have  trace mode on, make sure that the destination node is in your
  3409.      NET/ROM routing table.  If sending IP  traffic,  double  check  the  ARP
  3410.      table for an appropriate NET/ROM ARP entry for the destination node (see
  3411.      below for more information on the use of the ARP table).  The ARP  table
  3412.  
  3413.  
  3414.  
  3415.  
  3416.  
  3417.  
  3418.  
  3419.  
  3420.  
  3421.                                       - 53 -
  3422.  
  3423.  
  3424.      is not used for NET/ROM transport routing.
  3425.  
  3426.      5.7.  Interfacing with NET/ROMs Using Your Serial Port
  3427.  
  3428.         What if you have a net/rom node or nodes, and you'd  like  to  attach
  3429.      them  to  your  computer  via  their serial interfaces, and use net as a
  3430.      packet switch?  It's very easy:  you have to  attach  those  interfaces,
  3431.      using  the  "attach  asy"  command, but specifying type "nrs" instead of
  3432.      "slip" or "kiss".  "nrs" is the net/rom serial framing  protocol,  which
  3433.      is  like  KISS,  but  uses different framing characters and has an 8-bit
  3434.      checksum.
  3435.  
  3436.         When you attach an nrs interface, it  can  be  used  for  passing  IP
  3437.      datagrams  or  AX.25  frames over serial lines or modems.  To use it for
  3438.      net/rom, you have to identify it to the netrom code just like any  other
  3439.      interface, with the "netrom interface" command.
  3440.  
  3441.      5.8.  The Time to Live Initializer
  3442.  
  3443.         The "netrom ttl" command allows setting of the time-to-live  initial-
  3444.      izer  for  NET/ROM  datagrams.   I recommend a value of 16 for most net-
  3445.      works.  Use more if you expect to go more than 16 hops.  The default  is
  3446.      64.
  3447.  
  3448.         The purpose of the ttl initializer is to prevent a packet  from  get-
  3449.      ting  caught  forever  in  routing  loops.  Every router who handles the
  3450.      packet decrements the ttl field of the network datagram  before  sending
  3451.      it on, and when it reaches 0 it is discarded.
  3452.  
  3453.      5.9.  Using NET/ROM Support for IP
  3454.  
  3455.         Now you know all the commands, but how do we actually use net/rom for
  3456.      IP communications?  This takes two steps:
  3457.  
  3458.         Step one:  update the routing table.  In all likelihood, you will use
  3459.      net/rom to gateway two IP subnets.  So, you'll probably want to identify
  3460.      a station on each end as a gateway.  Let's say we're  on  the  Milwaukee
  3461.      subnet,  and  we  want  to talk to someone in Madison.  If we're not the
  3462.      gateway, we just have a routing table entry like this:
  3463.  
  3464.              route add [44.92.0.0]/24 ax0 wg9ate-pc.ampr
  3465.  
  3466.      This specifies that wg9ate should get all packets for the 44.92.0.x sub-
  3467.      net via interface ax0.
  3468.  
  3469.         Wg9ate has this routing table entry:
  3470.  
  3471.              route add [44.92.0.0]/24 netrom w9mad-pc.ampr
  3472.  
  3473.      (presuming that w9mad is the Madison gateway).  Now, when the  IP  layer
  3474.      at  wg9ate gets datagrams for Madison, it knows that they have to go via
  3475.      net/rom to w9mad.  Notice that we don't specify a "real" interface, like
  3476.      ax1 or nr0, in the route entry.  The net/rom network layer will pick the
  3477.      right interface based on its net/rom routing tables.
  3478.  
  3479.  
  3480.  
  3481.  
  3482.  
  3483.  
  3484.  
  3485.  
  3486.  
  3487.                                       - 54 -
  3488.  
  3489.  
  3490.         We're not done yet, though.  w9mad-pc.ampr is not an ax.25  callsign.
  3491.      The net/rom send routine called by the IP layer needs to map from the IP
  3492.      address to an ax.25 address.  It does this  via  a  manually  added  arp
  3493.      entry:
  3494.  
  3495.              arp add w9mad-pc.ampr netrom w9mad
  3496.  
  3497.      [We kind of fudged by using the arp table for this purpose, since  there
  3498.      is  no  way to do automatic address resolution for net/rom, and arp mes-
  3499.      sages are never sent or received for net/rom nodes.   However,  the  arp
  3500.      table  does  contain  precisely  what  we  have  here:  mappings from IP
  3501.      addresses to callsigns, and it saved a lot of code to do it this way.]
  3502.  
  3503.      Notice also that no digipeaters are ever specified in the arp entry  for
  3504.      a net/rom node.  Also, the callsign to which we are mapping is the final
  3505.      destination of the  packet,  not  the  non-destination  neighbor.   That
  3506.      neighbor will be picked based on the net/rom routing tables.
  3507.  
  3508.         So, as a summary, let's look at what happens to a packet that reaches
  3509.      the IP layer on wg9ate, destined for Madison.  The IP routing code looks
  3510.      the destination IP address up in the table, and discovers that it should
  3511.      go  via  net/rom  to  w9mad-pc.ampr.   So,  it  passes the packet to the
  3512.      net/rom send routine.  That routine uses  the  arp  table  to  translate
  3513.      w9mad-pc's  IP  address  to  the  callsign  "w9mad".  Then it passes the
  3514.      packet to the net/rom routing code.  That code checks to see if the des-
  3515.      tination  callsign  (w9mad)  is  the same as that of any of its assigned
  3516.      net/rom interfaces.  Since it isn't, it  puts  a  network  layer  header
  3517.      (a.k.a.  net/rom level 3 header) on it, and looks for w9mad in its rout-
  3518.      ing tables.  Presumably,  it  finds  an  appropriate  neighbor  for  the
  3519.      packet, and sends in out via ax.25.  The net/rom network does the job of
  3520.      actually getting the packet to its destination.
  3521.  
  3522.         At w9mad, the packet's protocol ID causes it to be sent to  the  same
  3523.      net/rom  routing code that handled the outgoing packet from wg9ate (run-
  3524.      ning on a different computer, of course).  Now the destination  callsign
  3525.      matches, so the net/rom network layer header is stripped off, and packet
  3526.      is passed up to the IP layer.  (Net/rom network  headers  don't  have  a
  3527.      protocol  ID  byte,  so  we  just  hope for the best.  If a net/rom node
  3528.      addresses a net/rom transport layer packet to us, it  is  likely  to  be
  3529.      dropped by IP for any of a number of reasons.)
  3530.  
  3531.      5.10.  The NET/ROM Transport Layer
  3532.  
  3533.         NET/ROM transport is the protocol used by NET/ROM node to communicate
  3534.      end-to-end.  When a user attaches to a NET/ROM via AX.25, and asks for a
  3535.      connect to a node in the NODES list, his local NET/ROM tries to  open  a
  3536.      transport  connection  to the destination node over the NET/ROM network.
  3537.      NET/ROM transport packets are carried in NET/ROM network datagrams, just
  3538.      like IP datagrams.
  3539.  
  3540.         You shouldn't use NET/ROM transport when connecting to  other  TCP/IP
  3541.      stations.   TCP  is  a  much better protocol than NET/ROM transport, and
  3542.      makes better use of available bandwidth.  Also, BM  and  SMTP  are  more
  3543.      convenient  to  use  than a TCP/IP station's mailbox facility.  However,
  3544.  
  3545.  
  3546.  
  3547.  
  3548.  
  3549.  
  3550.  
  3551.  
  3552.  
  3553.                                       - 55 -
  3554.  
  3555.  
  3556.      for communicating with AX.25 users via the NET/ROM  network,  the  tran-
  3557.      sport  facilities  in  NET  will  work better (and more easily) than the
  3558.      traditional method of connecting to your local node via AX.25.
  3559.  
  3560.      5.11.  Connecting via NET/ROM Transport
  3561.  
  3562.         To connect to the node whose alias  is  FOO  and  whose  callsign  is
  3563.      W9FOO, you can issue either of the following two commands:
  3564.  
  3565.              netrom connect foo
  3566.  
  3567.              netrom connect w9foo
  3568.  
  3569.      If foo:w9foo is  in  your  NET/ROM  routing  table,  your  station  will
  3570.      transmit  a  connect  request  to the appropriate neighbor used to reach
  3571.      w9foo.
  3572.  
  3573.         NET/ROM transport sessions are very much like those for  AX.25.   You
  3574.      can  use  the  disconnect, reset, kick, upload, and record commands, and
  3575.      the session command to switch sessions.
  3576.  
  3577.      5.12.  Displaying the Status of NET/ROM Connections
  3578.  
  3579.         The command
  3580.  
  3581.              netrom status
  3582.  
  3583.      is used to display the status of all  NET/ROM  connections,  which  will
  3584.      include  those used in keyboard sessions as well as ones attached to the
  3585.      mailbox.  For more detailed information on a session, you  can  use  the
  3586.      address of the NET/ROM control block:
  3587.  
  3588.              netrom status <&nrcb>
  3589.  
  3590.      where <&nrcb> is the hex address given in the short form of the  command
  3591.      or in the "session" display.
  3592.  
  3593.      5.13.  NET/ROM Transport Parameters
  3594.  
  3595.         The NET/ROM transport parameters may be set with the various  NET/ROM
  3596.      subcommands.  Their meanings are listed below:
  3597.  
  3598.              acktime:        This is the ack delay timer,  similary  to  ax25
  3599.      t2.                                  The default is 3000 ms.
  3600.  
  3601.              choketime:      The time to wait before breaking  a  send  choke
  3602.      condition.                                    Choke   is  the  term  for
  3603.      NET/ROM flow control.
  3604.  
  3605.              irtt:           The initial round  trip  time  guess,  used  for
  3606.      timer setting.
  3607.  
  3608.              qlimit:         The maximum length of the receive queue for chat
  3609.      sessions.                                    This  is  similar  to  ax25
  3610.  
  3611.  
  3612.  
  3613.  
  3614.  
  3615.  
  3616.  
  3617.  
  3618.  
  3619.                                       - 56 -
  3620.  
  3621.  
  3622.      window.
  3623.  
  3624.              retries:        Maximum retries on connect, disconnect, and data
  3625.      frames.
  3626.  
  3627.              window:         Maximum sliding window size, negotiated down  at
  3628.      connect                                 time.
  3629.  
  3630.  
  3631.      5.14.  The Mailbox
  3632.  
  3633.         The AX.25 mailbox also accepts NET/ROM connections.   The  "mbox  on"
  3634.      and  "mbox  off"  commands  control whether the mailbox is turned on for
  3635.      NET/ROM as well as AX.25, and the "mbox" command displays current  mail-
  3636.      box connects of both types.
  3637.  
  3638.         Many people have observed that the AX.25 mailbox requires the user to
  3639.      enter  a  carriage  return  to  bring up the banner and prompt.  This is
  3640.      because of certain defects of that protocol when it is used as the  link
  3641.      layer  for several different higher level protocols, and is unavoidable.
  3642.      (So stop asking, OK? :-))  The NET/ROM mailbox does not require the car-
  3643.      riage  return,  and will be activated as soon as the incoming connection
  3644.      is completed.
  3645.  
  3646.      5.15.  Where to go for More Information
  3647.  
  3648.         The paper  "Transmission  of  IP  Datagrams  over  NET/ROM  Networks"
  3649.      appeared  in  the  Seventh  ARRL Networking Conference papers, available
  3650.      from the ARRL.  In it, I describe the more technical details of how  the
  3651.      NET/ROM network support works.
  3652.  
  3653.         If you want to learn about NET/ROM, talk your local NET/ROM or TheNET
  3654.      operator  out of his or her manual.  If you want to learn more, read the
  3655.      source code.  That's about it for sources, since the  NET/ROM  protocols
  3656.      originated in a commercial product.
  3657.  
  3658.      5.16.  About the Code
  3659.  
  3660.         There has been a great deal of controversy about TheNET, a  no-charge
  3661.      NET/ROM  clone  for TNCs.  This is not the place to discuss the truth of
  3662.      the charges leveled by Software  2000  against  its  authors,  but  that
  3663.      situation requires me to make the following statement:
  3664.  
  3665.         The NET/ROM transport support in NET.EXE was not taken  in  any  way,
  3666.      shape  or  form  from  NET/ROM  (whose source I have never seen) or from
  3667.      TheNET.  The protocol code is  based  on  protocol  6  from  Tanenbaum's
  3668.      excellent  book,  Computer  Networks, as a moderately careful reading of
  3669.      both should show.  The source code is freely distributed, so the curious
  3670.      reader  should have the opportunity to check this assertion if he or she
  3671.      so desires.
  3672.  
  3673.         The smoothed round trip time calculation, which is not done in "real"
  3674.      NET/ROMs  (and  should be, by the way -- they'd work a whole lot better)
  3675.      is adapted from that used by KA9Q in the TCP protocol in NET.  The dicey
  3676.  
  3677.  
  3678.  
  3679.  
  3680.  
  3681.  
  3682.  
  3683.  
  3684.  
  3685.                                       - 57 -
  3686.  
  3687.  
  3688.      business  of  adapting  it  to a sliding windows protocol with selective
  3689.      retransmission was done by me, all alone, after my cries for help on the
  3690.      tcp-group mailing list went unanswered :-).
  3691.  
  3692.         I have taken the precaution of copyrighting the NET/ROM code in  NET.
  3693.      It may be freely distributed for non-commercial purposes, in whole or in
  3694.      part, and may be used in other software packages such as BBS systems  if
  3695.      so  desired,  so  long  as  the copyright notice is not removed from the
  3696.      source files, and the program in which it is used displays "NET/ROM code
  3697.      copyright 1989 by Dan Frank, W9NK" when it starts up.
  3698.  
  3699.         Any person who wishes to distribute the code, or  anything  based  on
  3700.      the  code,  for  commercial  purposes  will find me very reasonable, but
  3701.      rather insistent about being compensated for the hours I've spent  work-
  3702.      ing on it.
  3703.  
  3704.  
  3705.  
  3706.  
  3707.  
  3708.  
  3709.  
  3710.  
  3711.  
  3712.  
  3713.  
  3714.  
  3715.  
  3716.  
  3717.  
  3718.  
  3719.  
  3720.  
  3721.  
  3722.  
  3723.  
  3724.  
  3725.  
  3726.  
  3727.  
  3728.  
  3729.  
  3730.  
  3731.  
  3732.  
  3733.  
  3734.  
  3735.  
  3736.  
  3737.  
  3738.  
  3739.  
  3740.  
  3741.  
  3742.  
  3743.  
  3744.  
  3745.  
  3746.  
  3747.  
  3748.  
  3749.  
  3750.  
  3751.                                       - 58 -
  3752.  
  3753.  
  3754.      6.  Advanced Topics
  3755.  
  3756.      6.1.  The Finger Server
  3757.  
  3758.      < there will be finger docs here someday >
  3759.  
  3760.      6.2.  The GRAPES Multi-Port Digipeating Code
  3761.  
  3762.      The  multiport digipeating code from GRAPES  will  allow  you  to  route
  3763.      frames  in  and out of LANs semi-automagically  based  on a table lookup
  3764.      maintained  by  the switch.
  3765.  
  3766.      To enable multi-port digipeating, there are two tables that   you   must
  3767.      build  and  place  in  the root directory. They  are named  DIGILIST and
  3768.      EXLIST. DIGILIST contains the digis that  are directly   reachable  from
  3769.      your  switch.  The  file  is  a  simple  ASCII text  file containing the
  3770.      callsign of the digi and the  interface name   of  the  port  needed  to
  3771.      reach it. The port name is  the  same name you used in the attach state-
  3772.      ment for that port. Additionally there  is a special callsign "lan" that
  3773.      tells mulport which  port feeds your LAN or default port.
  3774.  
  3775.      The file would look something like this:
  3776.  
  3777.      kd4nc-1 ax1      # kd4nc-1 is a neighbor switch on the high speed link
  3778.                       # attached to ax1 wb4gqx-1  ax3      #  wb4gqx-1  is  a
  3779.      neighbor  digi  on 145.01 (ax3) k4hal-1 ax2      # k4hal-1 is a neighbor
  3780.      digi on 440 (ax2) lan  ax0         # lan is a special name for  the  low
  3781.      speed  lan
  3782.                       # attached to the switch and is the default port
  3783.                       # used when mycall is the last call in the  digi
  3784.                       # string.
  3785.  
  3786.      The file EXLIST holds DESTINATION callsigns that do not obey  the rules.
  3787.      For  example,  a  user  station on the high speed link. It  is formatted
  3788.      just like DIGILIST. To understand why this file  may   be  necessary  we
  3789.      review the rules mulport obeys.  First, mulport examines the digi string
  3790.      of incoming frames. If it finds  it's  call in the string and it is  not
  3791.      already   marked   as  repeated,  it  looks at the next call in the digi
  3792.      string. If  a match  is  found between the  call  following  MYCALL   in
  3793.      the   digi string and a call in DIGILIST, then the frame is repeated out
  3794.      the port associated with that call in DIGILIST. If no  match  is   found
  3795.      then the frame is repeated out the port it came in on. If  MYCALL is the
  3796.      LAST call in the digi string then it repeats the  frame  out  the   port
  3797.      associated  with  "lan" in the DIGILIST. So you see  that if  MYCALL  is
  3798.      the last or the only call  in  the  digi   string   the  frame  will  be
  3799.      repeated  out  the lan port. This can cause a problem if the station you
  3800.      wish to connect is only one digi hop away  and is  not  on  the lan fre-
  3801.      quency. The  EXLIST  handles  this  case. Mulport  will look at the DES-
  3802.      TINATION call if MYCALL is the  last or only call in the digi string. If
  3803.      a  match  is  found with a  call in EXLIST then the port associated with
  3804.      that DESTINATION call  is used  to repeat the frame. EXLIST  is only for
  3805.      stations  who  would normally be expected to be on the lan side  but are
  3806.      operating off some other port  instead.  An  example  might  be  a  PBBS
  3807.      operating on the trunk to serve more than one lan.
  3808.  
  3809.  
  3810.  
  3811.  
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.                                       - 59 -
  3818.  
  3819.  
  3820.      6.3.  Multiple Serial Ports on One Interrupt
  3821.  
  3822.      Thanks to effort from Dan Frank, W9NK, this version of net supports  the
  3823.      idea  of  multiple  serial ports all sharing a common hardware interrupt
  3824.      line. The original motivation for this was to support the IBM PS/2  fam-
  3825.      ily,  but it turns out to be very helpful with a variety of PC/AT inter-
  3826.      face cards as well.
  3827.  
  3828.      There are no new commands, and  existing  autoexecs  don't  need  to  be
  3829.      changed.  All  you have to do to share interrupts is simply use the same
  3830.      interrupt in more than one attach line. This applies *only* to asy  dev-
  3831.      ices. An interrupt may not be shared between, e.g., an ethernet card and
  3832.      a serial port.
  3833.  
  3834.      The code has been tested on an IBM PS/2 Model 70  with  the  dual  async
  3835.      adaptor.  Any card that logical-ORs the interrupt lines from the various
  3836.      UARTS should work.
  3837.  
  3838.      Interrupt sharing at the bus level does not work on the AT bus, but does
  3839.      work  on  the  Micro  Channel.  The PS/2 series uses interrupt 4 for the
  3840.      motherboard async port, then interrupt 3  for  all  bus-attached  serial
  3841.      ports.
  3842.  
  3843.      The code is  believed  to  work  with  both  level-sensitive  and  edge-
  3844.      triggered interrupts, but hasn't been fully tested.
  3845.  
  3846.      As an example, the Quadram Quadport AT with the add-on daughtercard  can
  3847.      handle up to five serial ports sharing the same interrupt, and up to two
  3848.      cards may be supported in a PC, making a total of more serial ports than
  3849.      a poor little PC should be asked to handle...
  3850.  
  3851.  
  3852.  
  3853.  
  3854.  
  3855.  
  3856.  
  3857.  
  3858.  
  3859.  
  3860.  
  3861.  
  3862.  
  3863.  
  3864.  
  3865.  
  3866.  
  3867.  
  3868.  
  3869.  
  3870.  
  3871.  
  3872.  
  3873.  
  3874.  
  3875.  
  3876.  
  3877.  
  3878.  
  3879.  
  3880.  
  3881.  
  3882.  
  3883.                                       - 60 -
  3884.  
  3885.  
  3886.      7.  NET Command Reference
  3887.  
  3888.      7.1.  Startup
  3889.  
  3890.      When NET.EXE is executed without arguments, it  attempts  to  open   the
  3891.      file  "AUTOEXEC.NET"  in  the root directory of the current drive. If it
  3892.      exists, it is read and executed as though its contents were typed on the
  3893.      console  as   commands.  This feature is useful for setting the local IP
  3894.      address and host name, initializing the IP routing table,  and  starting
  3895.      the  various  Internet  services.   If   NET.EXE   is  invoked  with  an
  3896.      argument, it is taken to be the name of an alternate startup file; it is
  3897.      read instead of AUTOEXEC.NET.
  3898.  
  3899.      7.2.  Console Mode
  3900.  
  3901.      The console may be in one of two  modes:  command  mode   and   converse
  3902.      mode.  In  command  mode,  the prompt "net>" is displayed and any of the
  3903.      commands described in the next section may be entered. In converse mode,
  3904.      keyboard input is  processed  according  to the "current session", which
  3905.      may be either a Telnet, FTP, or AX.25 connection. In a telnet  or  AX.25
  3906.      session,  keyboard input is sent  to the  remote  system  and any output
  3907.      from the remote system is displayed on the console. In an  FTP  session,
  3908.      keyboard  input is first examined to see if it  is a  known  local  com-
  3909.      mand; if so it is executed locally. If not, it is  "passed  through"  to
  3910.      the remote FTP server. (See  the  section  titled  "FTP  Subcommands").
  3911.  
  3912.      The keyboard also has "cooked" and "raw" states. In cooked  state, input
  3913.      is  line-at-a-time;  the user may use the line editing characters ^U, ^R
  3914.      and backspace to erase the line, redisplay the  line   and   erase   the
  3915.      last  character, respectively. Hitting either return or line feed passes
  3916.      the complete line up to the application. In raw mode, each character  is
  3917.      immediately  passed  to  the application as it is typed. The keyboard is
  3918.      always in cooked state in command mode. It is also  cooked  in  converse
  3919.      mode  on  an  AX25  or  FTP  session.  In a Telnet session it depends on
  3920.      whether the remote end has issued (and the local end has  accepted)  the
  3921.      Telnet "WILL ECHO" option. (See the "echo" command).
  3922.  
  3923.      On the IBM-PC, the user may escape back to  command  mode   by   hitting
  3924.      the   F10  key.  On the HP Portable and Portable Plus, which have only 8
  3925.      function keys, F8 is used instead.  On  other  systems,  the  user  must
  3926.      enter  the  "escape"  character,  which is by default control-] (hex 1d,
  3927.      ASCII GS). (Note that this is distinct from  the  ASCII   character   of
  3928.      the  same  name).  The escape character can be changed (see the "escape"
  3929.      command).
  3930.  
  3931.      7.3.  Commands
  3932.  
  3933.      This section describes each of the commands recognized while in  command
  3934.      mode.   Note   that  certain  FTP subcommands, e.g., put, get, dir, etc,
  3935.      are recognized only in converse mode with the appropriate  FTP  session;
  3936.      they   are   not  recognized  while in command mode. The notation "<hos-
  3937.      tid>" denotes a host or gateway, which may be specified in  one  of  two
  3938.      ways:  as  a  symbolic name  listed  in the  file  "/hosts.net", or as a
  3939.      numeric IP address in dotted  decimal  notation  enclosed  by  brackets,
  3940.  
  3941.  
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.                                       - 61 -
  3950.  
  3951.  
  3952.      e.g.,  [44.0.0.1].  When  domain  server  support  is  added, ARPA-style
  3953.      domain  names  (e.g., ka9q.ampr) will  also  be  accepted  if  a  domain
  3954.      server is available on the network to resolve them into IP addresses.
  3955.  
  3956.      7.3.1.  <cr>
  3957.  
  3958.      Entering a carriage return (empty line) while in command mode  puts  you
  3959.      in  converse   mode  with  the  current  session. If there is no current
  3960.      session, net remains in command mode.
  3961.  
  3962.      7.3.2.  !
  3963.  
  3964.      An alias for the "shell" command.
  3965.  
  3966.      7.3.3.  #
  3967.  
  3968.      Commands starting with the hash mark (#) are ignored. This   is   mainly
  3969.      useful for comments in the AUTOEXEC.NET file.
  3970.  
  3971.      7.3.4.  arp
  3972.  
  3973.      With no arguments, displays the Address Resolution Protocol  table  that
  3974.      maps  IP  addresses  to  their  subnet  (link)  addresses on subnetworks
  3975.      capable of broadcasting. For each  IP  address  entry  the  subnet  type
  3976.      (e.g.,  Ethernet,  AX.25),  subnet  address  and time to  expiration  is
  3977.      shown. If the link address  is  currently  unknown,  the  number  of  IP
  3978.      datagrams awaiting resolution is also shown.
  3979.  
  3980.      7.3.4.1.  arp add <hostid> ether|ax25|netrom <ether addr|callsign>
  3981.  
  3982.      The add subcommand allows manual addition of address resolution  entries
  3983.      into  the table.  This is useful for "hard-wiring" digipeater paths, and
  3984.      other paths that are not directly resolvable.
  3985.  
  3986.      7.3.4.2.  arp drop <hostid> ether|ax25|netrom
  3987.  
  3988.      The drop subcommand allows removal of entries from the table.
  3989.  
  3990.      7.3.4.3.  arp publish <hostid> ether|ax25|netrom <ether addr|callsign>
  3991.  
  3992.      The publish subcommand allows you to respond to  arp  queries  for  some
  3993.      other  host.   This  is commonly referred to as "proxy arp", and is con-
  3994.      sidered a fairly dangerous tool.  The basic idea is that if you have two
  3995.      machines,  one  of which is on the air with a TNC, and the second one of
  3996.      which is connected to the first with a slip link,  you  might  want  the
  3997.      first  machine to publish it's own AX.25 address as the right answer for
  3998.      arp queries addressing the second machine.  This way, the  rest  of  the
  3999.      world  doesn't know the second machine isn't really on the air.  Use arp
  4000.      publish with caution.
  4001.  
  4002.      7.3.5.  attach
  4003.  
  4004.      attach <hwtype> <I/O  addr>  <vector>  <mode>  <label>  <bufsize>  <mtu>
  4005.      [<speed>]"
  4006.  
  4007.  
  4008.  
  4009.  
  4010.  
  4011.  
  4012.  
  4013.  
  4014.  
  4015.                                       - 62 -
  4016.  
  4017.  
  4018.      Configure and attach a hardware interface to the system.
  4019.  
  4020.      <hw type> represents the kind of I/O device  that  is  being   attached.
  4021.      The following types are some that are supported:
  4022.  
  4023.      packet  FTP, Inc., compatible Packet Driver Interface 3c500   3Com 3C500
  4024.      or  3C501  Ethernet interface asy     Standard PC asynchronous interface
  4025.      using the National 8250 hapn    Hamilton Amateur Packet Network  adapter
  4026.      board (Intel 8273) eagle   Eagle Computer card (Zilog 8530) pc100   PAC-
  4027.      COMM PC-100 (Zilog 8530)
  4028.  
  4029.      These last two interfaces  are  still  under  development;  driver  code
  4030.      included in this package may or may not work.
  4031.  
  4032.      <I/O address> is the base address of the control registers for the  dev-
  4033.      ice.
  4034.  
  4035.      <vector> is the interrupt vector number.   Both  the  address  and   the
  4036.      vector  must  be in hexadecimal. (You may put "0x" in front of these two
  4037.      values if you wish, but note that they will be interpreted in  hex  even
  4038.      if you don't use it).
  4039.  
  4040.      <mode> controls how  IP  datagrams  are  to  be  encapsulated   in   the
  4041.      device's link level protocol; i.e., it selects among several link proto-
  4042.      cols that may be available.  The choices here depend on  the  interface;
  4043.      at  present,  the  3c500 interface only supports mode "arpa", which uses
  4044.      standard ARPA-style encapsula- tion.  (In the  future,  "802"  may  mean
  4045.      "use  802.3-style  encapsulation").   Two modes for the "asy" device are
  4046.      currently supported:
  4047.  
  4048.      slip    Encapsulates IP datagrams directly in SLIP frames without a link
  4049.              header. This is for operation on  point-to-point  lines  and  is
  4050.              compatible with 4.2BSD UNIX SLIP).
  4051.  
  4052.      ax25    Similar to slip, except that an AX.25 header and a KISS TNC
  4053.              control header are added to the front  of  the  datagram  before
  4054.              SLIP    encoding.     Either    UI    (connectionless)    or   I
  4055.              (connection-oriented)  AX.25  frames  can  be  used;   see   the
  4056.              "mode" command for details.
  4057.  
  4058.      The Address Resolution Protocol (ARP) maps IP to Ethernet  addresses  on
  4059.      Ethernet  controllers and to AX.25 addresses on "asy" lines operating in
  4060.      "ax25" mode.
  4061.  
  4062.      <label> gives the name by which the  interface  will  be  known  to  the
  4063.      various commands, such as "connect", "route" and "trace".
  4064.  
  4065.      For asynchronous ports, <bufsize> specifies the size of the ring  buffer
  4066.      in  bytes   to  be statically allocated to the receiver; incoming bursts
  4067.      larger than this may (but not necessarily) cause data to be  lost.   For
  4068.      Ethernet,  <bufsize>  specifies   how  many PACKETS may be queued on the
  4069.      receive queue at one time; if this limit is exceeded,  further  received
  4070.      packets  will  be  discarded.   This  is useful  to  prevent  the system
  4071.      from running out of memory should another node suddenly develop  a  case
  4072.  
  4073.  
  4074.  
  4075.  
  4076.  
  4077.  
  4078.  
  4079.  
  4080.  
  4081.                                       - 63 -
  4082.  
  4083.  
  4084.      of diarrhea.
  4085.  
  4086.      <mtu> is the Maximum  Transmission  Unit  size,  in  bytes.    Datagrams
  4087.      larger  than   this   limit   will  be  fragmented  at the IP layer into
  4088.      smaller pieces. For AX.25 UI frames, this limits the size of the  infor-
  4089.      mation field.  For  AX.25  I frames,  however, the ax25 paclen parameter
  4090.      is also relevant.  If the datagram or  fragment  is  still  larger  than
  4091.      paclen,  it  is  also fragmented  at  the  AX.25 level  (as  opposed  to
  4092.      the  IP  level)  before transmission.  (See the  "ax25  paclen"  command
  4093.      for further information).
  4094.  
  4095.      <speed> is needed only for  an  "asy"  line;  the  controller  will   be
  4096.      initial- ized to the given speed.
  4097.  
  4098.      Examples:
  4099.  
  4100.       # Attach a 3Com Ethernet controller using the standard 3Com address and
  4101.       # vector (i.e., as it comes out of the box) to use ARPA-standard
  4102.       # encapsulation.  The receive queue is limited to 5 packets, and
  4103.       # outgoing packets larger than 1500 bytes will be fragmented
  4104.  
  4105.      attach 3c500 0x300 3 arpa ec0 5 1500
  4106.  
  4107.       # Attach the PC asynch card normally known as "com1" (the first
  4108.       # controller) to operate in point-to-point slip mode at 9600 baud,
  4109.       # calling it "sl0".  A 1024 byte receiver ring buffer is allocated.
  4110.       # Outgoing packets larger than 256 bytes are fragmented.
  4111.  
  4112.      attach asy 0x3f8 4 slip sl0 1024 256 9600
  4113.  
  4114.       # Attach the secondary PC asynch card ("com2") to operate in AX.25
  4115.       # mode with an MTU of 576 bytes at 9600 baud with a KISS TNC,
  4116.       # calling it "ax0".  By default, IP datagrams are  sent  in  UI  frames
  4117.      attach asy 0x2f8 3 ax25 ax0 1024 576 9600
  4118.  
  4119.      (Note that you cannot use the second asynch controller  ("com2")  and  a
  4120.      3Com  Ethernet   card  with standard addressing at the same time because
  4121.      they both use interrupt vector 3).
  4122.  
  4123.      7.3.5.1.  HP Portable Specifics For the unwary, the  following  are  the
  4124.      correct I/O address values for the HP Portable and Portable Plus... note
  4125.      that the <vector> is unimportant, but must  be  included  for  the  line
  4126.      parsing to work correctly.
  4127.  
  4128.      HP  Portable  Plus  Serial   Port    0x44   HP   Portable   Plus   Modem
  4129.      Port     0xa4 HP Portable                     0xa4
  4130.  
  4131.  
  4132.      7.3.5.2.  SLIP Modem Dialing
  4133.  
  4134.      An extension to the attach command allows the syntax:
  4135.  
  4136.         attach <hw type> <I/O address> <vector> <mode> <label> <bufsiz> <mtu>
  4137.                [<speed>] [[optional '-' for  debug]  <send>  <expect>  <send>
  4138.  
  4139.  
  4140.  
  4141.  
  4142.  
  4143.  
  4144.  
  4145.  
  4146.  
  4147.                                       - 64 -
  4148.  
  4149.  
  4150.      [...]]
  4151.  
  4152.      for slip connections only. The send/expect sequences allow you to dial a
  4153.      modem  on  the  slip  port, and negotiate a remote login to setup a slip
  4154.      link.
  4155.  
  4156.                      - - desend carriagedreturn
  4157.                      - N s-ndsendwNULL
  4158.                   E  -  send control-D
  4159.                      -   send  space   (not really  needed as the cmdparse routine allows quoting)
  4160.                   \  -  send backslash
  4161.  
  4162.      Note that an expect does not have to follow the last send.  Those  fami-
  4163.      liar  with UUCP will recognize the expect/send paradigm as being similar
  4164.      to that used in the L.sys or Systems file.
  4165.  
  4166.      7.3.6.  ax25
  4167.  
  4168.      7.3.6.1.  ax25 digipeat [on|off]
  4169.  
  4170.      Controls whether AX.25 packets addressed to  this  station  as  a  digi-
  4171.      peater will be repeated.
  4172.  
  4173.      7.3.6.2.  ax25 heard [on|off]
  4174.  
  4175.      Works like the 'mheard' function in many  TNC's.  The  command  with  no
  4176.      parameter  dumps the list of callsigns heard, with an option you control
  4177.      whether the list is updated or not.
  4178.  
  4179.      7.3.6.3.  ax25 maxframe [<val]>]
  4180.  
  4181.      Establishes the maximum number of frames  that   will   be  allowed   to
  4182.      remain  unacknowledged at one time on new AX.25 connections. This number
  4183.      cannot be greater than 7.
  4184.  
  4185.      7.3.6.4.  ax25 mycall [<call>]
  4186.  
  4187.      Display or set the local  AX.25  address.    The   standard  format   is
  4188.      used,   e.g.,  KA9Q-0 or WB6RQN-5. This command must be given before any
  4189.      attach command using AX.25 mode are given.
  4190.  
  4191.      7.3.6.5.  ax25 bbscall [<call>]
  4192.  
  4193.      Same as mycall, but sets the callsign of the W2XO BBS.  This  subcommand
  4194.      is only accessible when you compile net with XOBBS and SID2 defined. The
  4195.      default is to use a single callsign/ssid for both NET and the PBBS.
  4196.  
  4197.      7.3.6.6.  ax25 paclen [<val>]
  4198.  
  4199.      Limits the size of  I-fields  on  new  AX.25  connections.   Note   that
  4200.      if IP datagrams or fragments larger than this are transmitted, they will
  4201.      be transparently fragmented at the AX.25 level, sent as  a   series   of
  4202.      I  frames,   and  reassembled  back into a complete IP datagram or frag-
  4203.      ment at the other end of the link. This parameter should  be  less  than
  4204.  
  4205.  
  4206.  
  4207.  
  4208.  
  4209.  
  4210.  
  4211.  
  4212.  
  4213.                                       - 65 -
  4214.  
  4215.  
  4216.      the MTU of the associated interface.
  4217.  
  4218.      7.3.6.7.  ax25 pthresh [<val>]
  4219.  
  4220.      Sets threshold for transmit without <cr>.
  4221.  
  4222.      7.3.6.8.  ax25 reset <axcb>
  4223.  
  4224.      Deletes the AX.25 connection control block at the  specified address.
  4225.  
  4226.      7.3.6.9.  ax25 retry [<val>]
  4227.  
  4228.      Limits the number of successive unsuccessful retransmission attempts  on
  4229.      new   AX.25  connections.  If  this  limit  is exceeded, link re- estab-
  4230.      lishment is attempted. If this fails "retry" times, then   the   connec-
  4231.      tion is abandoned and all queued data is deleted.
  4232.  
  4233.      7.3.6.10.  ax25 status [<axcb>]
  4234.  
  4235.      Without an argument, displays a one-line summary of  each AX.25  control
  4236.      block.    If   the   address  of  a  particular  control block is speci-
  4237.      fied, the contents of that control block  are  dumped  in  more  detail.
  4238.      Note that the send queue units are frames, while the receive queue units
  4239.      are bytes.
  4240.  
  4241.      7.3.6.11.  ax25 t1|t2|t3 [<val>]
  4242.  
  4243.      Display  or  set  the  AX.25 timers  to  be used for new connections. T1
  4244.      is  the  retransmission timer, T2 is the acknowledgement delay timer and
  4245.      T3 is the idle "keep alive" timer.  Values are in seconds.
  4246.  
  4247.      7.3.6.12.  ax25 window [<val>]
  4248.  
  4249.      Sets the number of bytes that can  be  pending  on   an   AX.25  receive
  4250.      queue   beyond   which  I frames will be answered with RNR (Receiver Not
  4251.      Ready) responses.  This presently applies only to suspended  interactive
  4252.      AX.25 sessions, since incoming IP datagrams are always processed immedi-
  4253.      ately and not allowed to remain on the receive queue.
  4254.  
  4255.      7.3.7.  close [<session #>]
  4256.  
  4257.      On an AX.25 session, this command initiates a  disconnect.  On a FTP  or
  4258.      Telnet  session,  this  command sends a FIN (i.e., initiates a close) on
  4259.      the session's TCP connection.  This is  an  alternative  to  asking  the
  4260.      remote server  to initiate a close ("QUIT" to FTP, or the logout command
  4261.      appropriate for the remote system in the case of Telnet).   When  either
  4262.      FTP or Telnet  sees the  incoming  half  of  a  TCP connection close, it
  4263.      automatically responds by closing the outgoing half of  the  connection.
  4264.      Close  is  more  graceful  than  the "reset"  command,  in  that  it  is
  4265.      less  likely to leave the remote TCP in a "half-open" state.
  4266.  
  4267.      7.3.8.  connect <interface> <callsign> [<digipeater> ... ]
  4268.  
  4269.      Initiates a "vanilla" AX.25 session   to   the   specified   call   sign
  4270.  
  4271.  
  4272.  
  4273.  
  4274.  
  4275.  
  4276.  
  4277.  
  4278.  
  4279.                                       - 66 -
  4280.  
  4281.  
  4282.      using  the  specified  interface.  Up  to  7 optional digipeaters may be
  4283.      given; note that the word  "via"  is  NOT  needed.  Data  sent  on  this
  4284.      session  goes out in conventional AX.25 packets with no upper layer pro-
  4285.      tocol.  The de-facto presentation standard format is   used,   in   that
  4286.      each  packet holds one line of text, terminated by a carriage return.  A
  4287.      single AX.25 connection may be used for both  terminal-to-terminal   and
  4288.      IP   traffic,  with  the two types of data being automatically separated
  4289.      by their AX.25 Level 3 Protocol IDs.
  4290.  
  4291.      7.3.9.  dir [<dirname>]
  4292.  
  4293.      List the contents of the specified directory on  the   console.   If  no
  4294.      argument is given, the current directory is listed.
  4295.  
  4296.      7.3.10.  disconnect [<session #>]
  4297.  
  4298.      An alias for the "close" command (for the benefit  of AX.25 users).
  4299.  
  4300.      7.3.11.  echo [accept|refuse]
  4301.  
  4302.      Displays or changes the flag controlling client  Telnet's response to  a
  4303.      remote WILL ECHO offer.
  4304.  
  4305.      The Telnet presentation protocol specifies that  in  the  absence  of  a
  4306.      negotiated  agreement   to   the   contrary,  neither  end  echoes  data
  4307.      received from the other.  In this mode, a Telnet client  session  echoes
  4308.      keyboard  input  locally  and  noth- ing  is  actually sent until a car-
  4309.      riage return is typed. Local line editing is also  performed:  backspace
  4310.      deletes  the last character  typed,  while  control-U deletes the entire
  4311.      line.
  4312.  
  4313.      When communicating from keyboard to keyboard  the  standard  local  echo
  4314.      mode  is used,  so the setting of this parameter has no effect. However,
  4315.      many timeshar- ing systems (e.g., UNIX) prefer to do their  own  echoing
  4316.      of  typed  input.   (This  makes  screen editors work right, among other
  4317.      things). Such systems send a Tel- net WILL ECHO offer  immediately  upon
  4318.      receiving  an  incoming  Telnet  connection request. If "echo accept" is
  4319.      in effect, a client Telnet session will automati- cally return a DO ECHO
  4320.      response. In this mode, local echoing  and  editing  is turned  off  and
  4321.      each  key  stroke  is sent immediately (subject to  the  Nagle  tinygram
  4322.      algorithm in TCP).  While this mode is just fine across an  Ethernet, it
  4323.      is  clearly  inefficient  and  painful across  slow  paths  like  packet
  4324.      radio  channels.  Specifying  "echo refuse" causes an incoming WILL ECHO
  4325.      offer  to  be answered with a  DONT  ECHO;  the  client  Telnet  session
  4326.      remains  in  the  local  echo mode.  Sessions already in the remote echo
  4327.      mode are unaffected. (Note:  Berke- ley  Unix has a bug in that it  will
  4328.      still  echo input even after the client has refused the WILL ECHO offer.
  4329.      To get  around  this  problem,  enter  the  "stty -echo" command to  the
  4330.      shell once you have logged in.)
  4331.  
  4332.      7.3.12.  eol [unix|standard]
  4333.  
  4334.      Displays or changes Telnet's end-of-line behavior when in  remote   echo
  4335.      mode.   In   standard   mode,  each  key  is  sent  as-is. In unix mode,
  4336.  
  4337.  
  4338.  
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.                                       - 67 -
  4346.  
  4347.  
  4348.      carriage returns are translated to line  feeds.   This  command  is  not
  4349.      necessary  with   all   UNIX   sys- tems;  use  it only  when  you  find
  4350.      that a particular  system  responds  to  line  feeds  but  not  carriage
  4351.      returns.   Only  Sun UNIX release 3.2  seems  to  exhibit this behavior;
  4352.      later releases are fixed.
  4353.  
  4354.      7.3.13.  escape <char>
  4355.  
  4356.      Without arguments, displays the current command-mode escape character in
  4357.      hex.   If   given   an   argument,  the  first character becomes the new
  4358.      escape character.  (This command is not provided on the IBM-PC;  on  the
  4359.      PC,  the  escape  char  is always F10.)
  4360.  
  4361.      7.3.14.  etherstat
  4362.  
  4363.      Display 3-Com Ethernet controller statistics (if configured).
  4364.  
  4365.      7.3.15.  exit
  4366.  
  4367.      Exit the "net" program and return to MS-DOS (or CP/M).
  4368.  
  4369.      7.3.16.  finger
  4370.  
  4371.      For information on the Finger subsystem,  see  the  information  in  the
  4372.      advanced topics section of this manual.
  4373.  
  4374.      7.3.17.  ftp <hostid>
  4375.  
  4376.      Open an FTP control channel to the specified  remote  host   and   enter
  4377.      converse mode  on  the  new  session.
  4378.  
  4379.      When in converse mode with an FTP server, everything typed on the   con-
  4380.      sole   is  first  examined  to  see if it is a locally-known command. If
  4381.      not, the line is passed intact to the remote server on the control chan-
  4382.      nel.   If  it  is one of the following commands, however, it is executed
  4383.      locally. (Note that this generally involves other commands being sent to
  4384.      the  remote  server on the  control  channel.) When  actively  transfer-
  4385.      ring  a  file,  the only acceptable command is "abort"; all  other  com-
  4386.      mands  will  result  in  an  error  message.  Responses  from the remote
  4387.      server are displayed directly on the screen.
  4388.  
  4389.      7.3.17.1.  abort
  4390.  
  4391.      Aborts a get, put or dir operation in progress. When receiving a   file,
  4392.      abort  simply  resets the data connection; the next incoming data packet
  4393.      will generate a TCP RST (reset) in response which will clear the  remote
  4394.      server.   When   send-  ing a file, abort sends a premature end-of-file.
  4395.      Note that in both cases abort will leave a partial copy of the  file  on
  4396.      the  destination  machine,   which   must  be  removed manually if it is
  4397.      unwanted. Abort is valid only when a transfer is in progress.
  4398.  
  4399.      7.3.17.2.  dir [<file>|<directory> [<localfile>]]
  4400.  
  4401.      Without arguments, "dir" requests that a full directory listing  of  the
  4402.  
  4403.  
  4404.  
  4405.  
  4406.  
  4407.  
  4408.  
  4409.  
  4410.  
  4411.                                       - 68 -
  4412.  
  4413.  
  4414.      remote server's current directory be sent to the terminal.  If one argu-
  4415.      ment is given, this is passed along in the LIST command; this can  be  a
  4416.      specific file or  sub- directory  that  is meaningful to the remote file
  4417.      system. If two arguments are given, the second is  taken  as  the  local
  4418.      file  into  which  the  directory  listing should  be  put  (instead  of
  4419.      being sent to the console).  The PORT command is used  before  the  LIST
  4420.      command is sent.
  4421.  
  4422.      7.3.17.3.  get <remote_file> [<local_file>]
  4423.  
  4424.      Asks the remote server to send the file specified in the first argument.
  4425.      The  second   argument,  if  given,  will be the name of the file on the
  4426.      local machine; otherwise it will have the same name  as  on  the  remote
  4427.      machine.  The  PORT  and RETR commands are sent on the control channel.
  4428.  
  4429.      7.3.17.4.  ls [<file>|<directory> [<localfile>]]
  4430.  
  4431.      ls is identical to the "dir" command except that the "NLST"  command  is
  4432.      sent  to the  server  instead  of  the  "LIST"  command. This results in
  4433.      an abbreviated directory listing, i.e., one showing only the file  names
  4434.      themselves  without any other information.
  4435.  
  4436.      7.3.17.5.  mkdir <remote_directory>
  4437.  
  4438.      Creates a directory on the remote machine.
  4439.  
  4440.      7.3.17.6.  put <local_file> [<remote_file>]
  4441.  
  4442.      Asks the remote server to accept data, creating the file named  in   the
  4443.      first argument.  The  second argument, if given, will be the name of the
  4444.      file on the remote machine; otherwise it will have the same name  as  on
  4445.      the  local  machine.  The PORT and STOR commands are sent on the control
  4446.      channel.
  4447.  
  4448.      7.3.17.7.  rmdir <remote_directory>
  4449.  
  4450.      Deletes a directory on the remote machine.
  4451.  
  4452.      7.3.17.8.  type [a|i|l<bytesize>]
  4453.  
  4454.      Tells both the local client and remote server the type of file  that  is
  4455.      to  be transferred.  The default is 'a', which means ASCII (i.e., a text
  4456.      file).  Type length  lines   of   text   in  ASCII  separated  by  cr/lf
  4457.      sequences;  in  IMAGE mode, files are sent exactly as they appear in the
  4458.      file system.  ASCII  mode  should be  used  whenever  transferring  text
  4459.      between dissimilar systems (e.g., UNIX and MS-DOS) because of their dif-
  4460.      ferent end-of-line and/or end-of-file conventions.  When exchanging text
  4461.      files between machines of the same type, either mode will work but IMAGE
  4462.      mode may be somewhat faster.  Naturally,  when  exchanging   raw  binary
  4463.      files  (executables,  compressed archives, etc) IMAGE mode must be used.
  4464.      Type 'l' (logical byte size) is used when exchanging binary  files  with
  4465.      remote  servers   having   oddball   word sizes (e.g., DECSYSTEM-10s and
  4466.      20s). Locally it works exactly like IMAGE, except that it  notifies  the
  4467.      remote  system  how  large the  byte size is. <bytesize> is typically 8.
  4468.  
  4469.  
  4470.  
  4471.  
  4472.  
  4473.  
  4474.  
  4475.  
  4476.  
  4477.                                       - 69 -
  4478.  
  4479.  
  4480.      The type command sets the local transfer mode  and  generates  the  TYPE
  4481.      command on the control channel.
  4482.  
  4483.      7.3.18.  help
  4484.  
  4485.      Display a brief summary of top-level commands.
  4486.  
  4487.      7.3.19.  hostname [<name>]
  4488.  
  4489.      Displays or sets the local host's name (an ASCII string such  as  "ka9q-
  4490.      pc",  NOT  an  IP address).  Currently this is used only in the greeting
  4491.      messages from the SMTP (mail) and FTP (file transfer) servers.
  4492.  
  4493.      7.3.20.  log [stop|<file>]
  4494.  
  4495.      Without  arguments,  indicates  whether  server   sessions   are   being
  4496.      logged.   If "stop" is given as the argument, logging is terminated (the
  4497.      servers themselves are unaffected). If a file name is given as an  argu-
  4498.      ment,  server  session  log entries will be appended to it.
  4499.  
  4500.      7.3.21.  ip
  4501.  
  4502.      7.3.21.1.  ip address [<hostid>]
  4503.  
  4504.      Displays or sets the local IP address.
  4505.  
  4506.      7.3.21.2.  ip status
  4507.  
  4508.      Displays Internet  Protocol  (IP)  statistics,  such  as  total   packet
  4509.      counts   and error  counters of various types.  Also displays statistics
  4510.      about the Internet Control Message Protocol (ICMP), including the number
  4511.      of ICMP messages of each type sent or received.
  4512.  
  4513.      7.3.21.3.  ip ttl [<val>]
  4514.  
  4515.      Displays or sets the default time-to-live value placed  in  each  outgo-
  4516.      ing   IP  datagram.  This  limits the number of switch hops the datagram
  4517.      will be allowed to take. The idea is  to  bound  the  lifetime  of   the
  4518.      packet   should  it  become caught  in a routing loop, so make the value
  4519.      somewhat larger than the diameter of the network.
  4520.  
  4521.      7.3.22.  memstat
  4522.  
  4523.      Displays the internal free memory list in the storage allocator.
  4524.  
  4525.      7.3.23.  mode <interface> [vc|datagram]
  4526.  
  4527.      Controls the default transmission mode on the specified   AX.25   inter-
  4528.      face.   In  "datagram"   mode,  IP  packets are encapsulated in AX.25 UI
  4529.      frames and transmit- ted without any other link level  mechanisms,  such
  4530.      as  connections  or  ack- nowledgements.
  4531.  
  4532.      In "vc" (virtual circuit) mode, IP packets are encapsulated in  AX.25  I
  4533.      frames  and   are  acknowledged at the link level according to the AX.25
  4534.  
  4535.  
  4536.  
  4537.  
  4538.  
  4539.  
  4540.  
  4541.  
  4542.  
  4543.                                       - 70 -
  4544.  
  4545.  
  4546.      protocol.  Link level connections are opened  if  necessary.   With  the
  4547.      proper   setting   of   the  AX.25  T2  (acknowledgement  delay)  timer,
  4548.      AX.25 acknowledgements can be pig- gybacked on I frames  carrying  other
  4549.      IP datagrams (e.g., TCP level acknowledge- ments),  thereby  eliminating
  4550.      the  extra overhead ordinarily incurred by link level acknowledgments.
  4551.  
  4552.      In both modes, ARP is used to map IP to AX.25 addresses.   The  defaults
  4553.      can   be  overridden   with   the   type-of-service (TOS) bits in the IP
  4554.      header. Turning on the "reliability" bit causes I  frames  to  be  used,
  4555.      while  turning   on  the  "low delay"  bit  uses UI frames.  (The effect
  4556.      of turning on both bits is undefined and subject to change).
  4557.  
  4558.      In both modes, IP-level fragmentation is done if the datagram is  larger
  4559.      than the  interface  MTU.  In virtual circuit mode, however, the result-
  4560.      ing datagram (or fragments) is further fragmented at the AX.25 layer  if
  4561.      it   (or   they)  are still  larger  than  the  AX.25  "paclen"  parame-
  4562.      ter.  In AX.25 fragmentation, datagrams are broken into several I frames
  4563.      and  reassembled  at  the  receiving end before being passed to IP. This
  4564.      is preferable to IP fragmentation whenever possible because of decreased
  4565.      overhead (the IP header isn't repeated  in  each fragment) and increased
  4566.      robustness (a lost fragment is immediately retransmit- ted by  the  link
  4567.      layer).
  4568.  
  4569.      7.3.24.  mulport [on|off]
  4570.  
  4571.      The  multiport  switch software  allows routing of frames between inter-
  4572.      faces based on a table lookup. This provides the traditional "multi-port
  4573.      digipeater" functionality.
  4574.  
  4575.      There are two tables that  you  must build and place in the root  direc-
  4576.      tory.  They  are named  DIGILIST and EXLIST. DIGILIST contains the digis
  4577.      that  are directly  reachable from your switch. The  file  is  a  simple
  4578.      ASCII  text  file containing the callsign of the digi and the  interface
  4579.      name  of the port needed to reach it. The port name is  the   same  name
  4580.      you used in the attach statement for that port. Additionally there  is a
  4581.      special callsign "lan" that tells mulport which  port feeds your LAN  or
  4582.      default port.
  4583.  
  4584.      The file would look something like this:
  4585.  
  4586.      kd4nc-1 ax1      # kd4nc-1 is a neighbor switch on the high speed
  4587.                       # link attached to ax1 wb4gqx-1 ax3     # wb4gqx-1 is a
  4588.      neighbor  digi  on 145.01 (ax3) k4hal-1 ax2      # k4hal-1 is a neighbor
  4589.      digi on 440 (ax2) lan  ax0         # lan is a special name for  the  low
  4590.      speed  lan
  4591.                       # attached to the switch and is the default port
  4592.                       # used when mycall is the last call in the  digi
  4593.                       # string.
  4594.  
  4595.      The file EXLIST holds DESTINATION callsigns that do not obey  the rules.
  4596.      EXLIST  is only for stations who would normally be expected to be on the
  4597.      lan side  but are operating off some other port instead.  A  couple   of
  4598.      reasons   that  this may be the case are that the station may be  a PBBS
  4599.      operating on the trunk to serve more than one lan.
  4600.  
  4601.  
  4602.  
  4603.  
  4604.  
  4605.  
  4606.  
  4607.  
  4608.  
  4609.                                       - 71 -
  4610.  
  4611.  
  4612.      7.3.25.  param <interface> [param]
  4613.  
  4614.      Param invokes a device-specific  control  routine.   On   a   KISS   TNC
  4615.      interface,  this   sends   control  packets  to the TNC.  Data bytes are
  4616.      treated as decimal.  For example, "param ax0 1 255" will set  the  keyup
  4617.      timer  (type field  =  1)  on the  KISS  TNC  configured  as ax0 to 2.55
  4618.      seconds (255 x .01 sec).  On a SLIP interface, the param command  allows
  4619.      the  baud  rate to be  read  (without arguments) or set. The implementa-
  4620.      tion of this command for the various interface drivers is incomplete and
  4621.      subject to change.
  4622.  
  4623.      7.3.26.  pwd [<dirname>]
  4624.  
  4625.      An alias for the cd command.
  4626.  
  4627.      7.3.27.  record [<filename>|off]
  4628.  
  4629.      Opens <filename> and appends to it all data  received  on  the   current
  4630.      session.  Data sent on the current session is also written into the file
  4631.      except for Tel- net sessions in remote echo mode.  The  command  "record
  4632.      off"   stops   recording  and  closes the file. This command is not sup-
  4633.      ported for FTP sessions.
  4634.  
  4635.      7.3.28.  reset [<session>]
  4636.  
  4637.      If an argument is given, force a local reset  (deletion)  of  the  AX.25
  4638.      (AXCB) or TCP  Control  Block  (TCB) belonging to the specified session.
  4639.      The argument is first checked for validity.  If no  argument  is  given,
  4640.      the current session,  if any,  is  used.   This  command  should be used
  4641.      with caution since it does not inform the remote end that the connection
  4642.      no  longer  exists.   (In TCP  a  reset (RST)  message will be automati-
  4643.      cally generated should the remote TCP send  any-  thing  after  a  local
  4644.      reset  has  been  done.   In  AX.25  the DM message  performs  a similar
  4645.      role.   Both  are used to get rid of a  lingering  half-open  connection
  4646.      after a remote system has crashed.)
  4647.  
  4648.      7.3.29.  route
  4649.  
  4650.      route add <dest  hostid>[/bits]|default  <interface>  [<gateway  hostid>
  4651.              [<metric>]]
  4652.  
  4653.      route drop <dest hostid>
  4654.  
  4655.      With no arguments, "route" displays the IP routing  table.  "route  add"
  4656.      adds   an entry  to  the  routing  table,  while "route drop" deletes an
  4657.      existing entry.  "route add" requires at least two more  arguments,  the
  4658.      host id  of  the  target destination and the local name of the interface
  4659.      to which its packets should be sent.  If the destination is  not  local,
  4660.      the gateway's host id should  also  be specified.  (If  the interface is
  4661.      a point-to-point link, then <gateway hostid> may be omitted even if  the
  4662.      target  is  non-local  because this field is only used to  determine the
  4663.      gateway's link level address, if any.  If the  destination  is  directly
  4664.      reachable,  <gateway  hostid>  is also unnecessary since the destination
  4665.      address is used to determine the interface link address).
  4666.  
  4667.  
  4668.  
  4669.  
  4670.  
  4671.  
  4672.  
  4673.  
  4674.  
  4675.                                       - 72 -
  4676.  
  4677.  
  4678.      The optional "/bits" suffix to the destination  host  id  specifies  how
  4679.      many  leading  bits  in  the host id are to be considered significant in
  4680.      the routing comparisons.  If not specified, 32 bits (i.e., full signifi-
  4681.      cance)  is  assumed.  With  this  option,  a  single routing table entry
  4682.      may refer to many hosts all sharing a common bit string prefix in  their
  4683.      IP  addresses.  For  example,  ARPA Class  A, B and C networks would use
  4684.      suffixes of /8, /16 and /24 respectively; the command
  4685.  
  4686.              route add [44]/8 sl0 [44.64.0.2]
  4687.  
  4688.      causes any IP addresses beginning with "44" in the first 8 bits  to   be
  4689.      routed to [44.64.0.2]; the remaining 24 bits are "don't-cares".
  4690.  
  4691.      When an IP address to be routed matches more than one   entry   in   the
  4692.      routing  table,   the   entry  with  largest "bits" parameter (i.e., the
  4693.      "best" match) is used. This allows individual hosts or blocks  of  hosts
  4694.      to be  exceptions  to  a more general rule for a larger block of hosts.
  4695.  
  4696.      The  special  destination  "default"  is  used  to  route  datagrams  to
  4697.      addresses   not in  the  routing table; it is equivalent to specifying a
  4698.      /bits suffix of /0 to any destination hostid.  Care must be  taken  with
  4699.      default   entries   since   two nodes  with  default entries pointing at
  4700.      each other will route packets to unk- nown addresses back and forth in a
  4701.      loop  until  their  time-to-live (TTL)  fields expire.   (Routing  loops
  4702.      for specific addresses can also be created, but this is less  likely  to
  4703.      occur accidentally).
  4704.  
  4705.      "route drop" deletes an entry from the table.  If   a   packet   arrives
  4706.      for   the  deleted  address and a default route is in effect, it will be
  4707.      used.
  4708.  
  4709.      Here are some examples of using the route command:
  4710.  
  4711.              # Route datagrams to IP address 44.0.0.3 to SLIP line #0.
  4712.              # No gateway is needed because SLIP is point-to point.
  4713.              route add [44.0.0.3] sl0
  4714.  
  4715.              # Route all default traffic to the gateway on the local Ethernet
  4716.              # with IP address [44.0.0.1]
  4717.              route add default ec0 [44.0.0.1]
  4718.  
  4719.              # The local Ethernet has an ARPA Class-C address assignment;
  4720.              # route all IP addresses beginning with 192.4.8 to it
  4721.              route add [192.4.8]/24 ec0
  4722.  
  4723.              # Station with IP address [44.0.0.10] on local AX.25 channel
  4724.              route add [44.0.0.10] ax0
  4725.  
  4726.      7.3.30.  session [<session #>]
  4727.  
  4728.      Without arguments, displays the list of  current   sessions,   including
  4729.      session number,  remote  TCP or AX.25 address and the address of the TCP
  4730.      or AX.25 control block. An asterisk (*) is shown next to  the  "current"
  4731.      session;   entering  <cr>   at  this point will put you in converse mode
  4732.  
  4733.  
  4734.  
  4735.  
  4736.  
  4737.  
  4738.  
  4739.  
  4740.  
  4741.                                       - 73 -
  4742.  
  4743.  
  4744.      with that session.  Entering a session number as an argument to the ses-
  4745.      sion  command  will  put  you  in converse  mode  with  that session. If
  4746.      the telnet server is enabled, the user  is  notified  of   an   incoming
  4747.      request  and  a  session  number  is  automatically assigned.   The user
  4748.      may then select the session normally to converse with the remote user as
  4749.      though the session had been locally initiated.
  4750.  
  4751.      7.3.31.  shell
  4752.  
  4753.      Suspends "net" and executes a sub  shell  ("command   processor"   under
  4754.      MS-DOS).  When  the  sub  shell  exits, net resumes (under MS-DOS, enter
  4755.      the "exit" command). Note that background activity (FTP  servers,   etc)
  4756.      is  also  suspended while the subshell executes.
  4757.  
  4758.      7.3.32.  smtp
  4759.  
  4760.      7.3.32.1.  smtp gateway [<hostid>]
  4761.  
  4762.      Displays or sets the host to be used as a "smart" mail relay.  Any  mail
  4763.      sent  to  a   hostid  not  in the host table will instead be sent to the
  4764.      gateway for forwarding.
  4765.  
  4766.      7.3.32.2.  smtp kick
  4767.  
  4768.      Run through the outgoing mail queue and attempt to deliver any   pending
  4769.      mail.   This  command is periodically invoked by a timer whenever net is
  4770.      running; this command allows the user to "kick" the  mail  system  manu-
  4771.      ally.
  4772.  
  4773.      7.3.32.3.  smtp maxclients [<val>]
  4774.  
  4775.      Displays or sets the maximum number  of   simultaneous   outgoing   SMTP
  4776.      sessions  that  will be allowed. The default is 10; reduce it if network
  4777.      congestion is a problem.
  4778.  
  4779.      7.3.32.4.  smtp timer [<val>]
  4780.  
  4781.      Displays or sets the interval, in seconds, between scans of the outbound
  4782.      mail queue. For example, "smtp timer 600" will cause the system to check
  4783.      for outgoing mail every 10 minutes and attempt to  deliver  anything  it
  4784.      finds,  subject  of course to the "maxclients" limit. Setting a value of
  4785.      zero disables queue scanning altogether, note that this is the  default!
  4786.      This  value is recommended for stand  alone  IP gateways that never han-
  4787.      dle mail, since it saves wear and tear on the floppy disk drive.
  4788.  
  4789.      7.3.32.5.  smtp trace [<val>]
  4790.  
  4791.      Displays or sets the trace flag in the SMTP  client,  allowing  you   to
  4792.      watch  SMTP's   conversations   as it delivers mail.  Zero (the default)
  4793.      disables tracing.
  4794.  
  4795.      7.3.33.  start
  4796.  
  4797.      Starts  the  specified  Internet  server,  allowing  remote   connection
  4798.  
  4799.  
  4800.  
  4801.  
  4802.  
  4803.  
  4804.  
  4805.  
  4806.  
  4807.                                       - 74 -
  4808.  
  4809.  
  4810.      requests.
  4811.  
  4812.      7.3.34.  stop
  4813.  
  4814.      Stops the specified Internet server,  rejecting   any   further   remote
  4815.      connect requests. Existing connections are allow to complete normally.
  4816.  
  4817.      7.3.35.  tcp
  4818.  
  4819.      7.3.35.1.  tcp irtt [<val>]
  4820.  
  4821.      Display or set the intial round trip time estimate, in  seconds,  to  be
  4822.      used  for  new  TCP  connections until they can measure and adapt to the
  4823.      actual value.  The default is 5 seconds.  Increasing this when operating
  4824.      over  slow channels  will avoid the flurry of retransmissions that would
  4825.      otherwise occur as the smoothed estimate settles  down  at  the  correct
  4826.      value.  Note  that  this command  should  be given  before  servers  are
  4827.      started in order for it to have effect on incoming connections.
  4828.  
  4829.      7.3.35.2.  tcp kick <tcp_addr>
  4830.  
  4831.      If there is data on the send queue of the specified tcb,  this   command
  4832.      forces an immediate retransmission.
  4833.  
  4834.      7.3.35.3.  tcp mss [<size>]
  4835.  
  4836.      Display or set the TCP Maximum Segment Size in bytes that will  be  sent
  4837.      on   all outgoing  TCP  connect  request (SYN segments).  This tells the
  4838.      remote end the size of the largest segment (packet) it may send.  Chang-
  4839.      ing   MSS   affects   only  future connections; existing connections are
  4840.      unaffected.
  4841.  
  4842.      7.3.35.4.  tcp reset <tcb_addr>
  4843.  
  4844.      Deletes the TCP control block at the specified address.
  4845.  
  4846.      7.3.35.5.  tcp rtt <tcp_addr> <rtval>
  4847.  
  4848.      Replaces the automatically computed round trip time in the specified tcb
  4849.      with  the   rttval  in milliseconds.  This command is useful to speed up
  4850.      recovery from a series of lost packets since it provides a manual bypass
  4851.      around  the  normal backoff retransmission timing mechanisms.
  4852.  
  4853.      7.3.35.6.  tcp status [<tcb_addr>]
  4854.  
  4855.      Without arguments, displays several TCP-level statistics, plus  a   sum-
  4856.      mary   of  all   existing  TCP  connections, including TCB address, send
  4857.      and receive queue sizes, local and remote sockets, and connection state.
  4858.      If  <tcb_addr>  is specified, a  more detailed dump of the specified TCB
  4859.      is generated, including send and  receive  sequence  numbers  and  timer
  4860.      information.
  4861.  
  4862.  
  4863.  
  4864.  
  4865.  
  4866.  
  4867.  
  4868.  
  4869.  
  4870.  
  4871.  
  4872.  
  4873.                                       - 75 -
  4874.  
  4875.  
  4876.      7.3.35.7.  tcp window [<val>]
  4877.  
  4878.      Displays or sets the default receive window size in bytes  to  be   used
  4879.      by   TCP  when  creating new connections. Existing connections are unaf-
  4880.      fected.
  4881.  
  4882.      7.3.36.  telnet <hostid>
  4883.  
  4884.      Creates a Telnet session to the specified host and enters converse mode.
  4885.  
  4886.      7.3.37.  trace [<interface> [<flags>]|allmode|cmdmode]
  4887.  
  4888.      Controls packet tracing by the interface drivers. Specific  bits  enable
  4889.      tracing  of   the  various interfaces and the amount of information pro-
  4890.      duced.  Tracing is controlled on a per-interface  basis;  without  argu-
  4891.      ments, trace gives a list  of all  defined  interfaces and their tracing
  4892.      status.  Output can be limited to a single interface by  specifying  it,
  4893.      and  the  control   flags  can  be  change  by specifying  them as well.
  4894.      The flags are given as a hexadecimal number which is interpreted as fol-
  4895.      lows:
  4896.  
  4897.         TIO
  4898.         |||--- Enable tracing of output packets if 1, disable if 0
  4899.         ||---- Enable tracing of input packets if 1, disable if 0
  4900.         |----- Controls type of tracing:
  4901.            0 - Protocol headers are decoded, but data is not displayed
  4902.            1 - Protocol headers are decoded, and data (but not the
  4903.                headers themselves) are displayed as ASCII characters,
  4904.                64 characters/line. Unprintable characters are displayed
  4905.                as periods.
  4906.            2 - Protocol headers are decoded, and the entire packet
  4907.                (headers AND data) is also displayed in hexadecimal
  4908.                and ASCII, 16 characters per line.
  4909.  
  4910.      There is an additional option for tracing, that  allows  you  to  select
  4911.      whether  traced packets are always displayed, or only displayed when you
  4912.      are in command mode.  Having tracing only happen in command  mode  some-
  4913.      times  provides  the  right  mix  between "knowing what's going on", and
  4914.      "keeping the garbage off the screen"  while  you're  typing.  To  select
  4915.      tracing  all  the time (the default mode), use 'trace allmode'.  To res-
  4916.      trict tracing to command mode, use 'trace cmdmode'.
  4917.  
  4918.      7.3.38.  udp status
  4919.  
  4920.      Displays the status of all UDP receive queues.
  4921.  
  4922.      7.3.39.  upload [<filename>]
  4923.  
  4924.      Opens <filename> and sends it on the current session as though it   were
  4925.      typed on the terminal. Valid only on AX.25 and Telnet sessions.
  4926.  
  4927.      7.3.40.  ?
  4928.  
  4929.      Same as the "help" command.
  4930.  
  4931.  
  4932.  
  4933.  
  4934.  
  4935.  
  4936.  
  4937.  
  4938.  
  4939.                                       - 76 -
  4940.  
  4941.  
  4942.      8.  Appendices
  4943.  
  4944.      8.1.  Obtaining Current Bits
  4945.  
  4946.      The KA9Q Internet software package is still evolving and growing.  As  a
  4947.      result,  we  occasionally  issue  updates  to the software that fix bugs
  4948.      and/or update functionality. Announcements are always made to the USENET
  4949.      news  group  rec.ham-radio.packet.   They  usually  also show up on Com-
  4950.      puserve within a day or two. There is never any charge for the software.
  4951.      A  small  charge  may exist for copying floppies if you want the bits on
  4952.      disk, and of course you'll have to pay the long distance if you grab the
  4953.      bits over the phone!
  4954.  
  4955.      If several people are running the software in your  area,  get  together
  4956.      and  decide  on one person to get the new bits, then copy it around.  We
  4957.      won't mind.
  4958.  
  4959.      8.1.1.  Via FTP on the Internet
  4960.  
  4961.      The most recent official release is usually available from  the  machine
  4962.      WSMR-SIMTEL20.ARMY.MIL  on  the Internet. Use anonymous FTP, and look in
  4963.      the directory PD3:<MISC.KA9Q-TCPIP>.
  4964.  
  4965.      Beta-releases are often available on the machine LOUIE.UDEL.EDU, in  the
  4966.      directory  tree  rooted  at  pub/ka9q.  Anonymous FTP's are allowed, but
  4967.      unless you're working  on  the  software,  the  bits  on  louie  can  be
  4968.      "dangerous",  as  they  often include incompletely implemented features,
  4969.      and can have serious bugs.  Caveat Emptor.
  4970.  
  4971.      Various bits are also available  from  TOMCAT.GSFC.NASA.GOV,  a  machine
  4972.      operated by Tom Clark W3IWI.
  4973.  
  4974.      8.1.2.  On PC Floppies
  4975.  
  4976.      The Tucson Amateur Packet Radio association (TAPR) now  provides  floppy
  4977.      copies  of  the  software on 360k PC floppies, and can provide KISS ROMs
  4978.      for various TNC's, at a nominal charge  for  duplication  and  shipping.
  4979.      Contact TAPR for more information.
  4980.  
  4981.           TAPR PO Box 12925 Tucson, AZ  85732 (602) 323-1710
  4982.  
  4983.      8.1.2.1.  WB3FFV's Phone BBS in the USA
  4984.  
  4985.      Howard Leadmon, WB3FFV, has placed a BBS system on-line that  is  mainly
  4986.      oriented  towards  the  Amateur  Community (but there is other stuff on-
  4987.      line). Below is the information that is needed in order  to  access  the
  4988.      BBS via Telephone -or- TCP/IP.
  4989.  
  4990.       System Name: WB3FFV
  4991.       Login: bbs
  4992.       Number: (301)-335-0858 -- 1200 & 2400 (Non-MNP)
  4993.       Number: (301)-335-1955 -- 2400 (MNP), 9600 & 19200 (PEP)
  4994.       Data Settings: 8 Bits, NO Parity, 1 Stop Bit
  4995.       Times: 24hrs/365days  (except for routine maintenance)
  4996.  
  4997.  
  4998.  
  4999.  
  5000.  
  5001.  
  5002.  
  5003.  
  5004.  
  5005.                                       - 77 -
  5006.  
  5007.  
  5008.       Software: XBBS  (UNIX/Xenix Multiuser BBS)
  5009.       IP Address: 44.60.0.1 {wb3ffv.ampr.org}  [for FTP access on 145.550 mhz
  5010.      ONLY]
  5011.       Misc. Info: Machine  is  an  80386  computer  running  UNIX  V.3.2  and
  5012.      features 300+
  5013.                   meg of on-line storage. Most transfer protocols are  avail-
  5014.      able!!
  5015.  
  5016.      Howard attempts to keep the latest and greatest  HAM  software  on-line,
  5017.      and encourages all to upload anything new that they come up with.
  5018.  
  5019.      8.1.2.2.  PA0GRI's Phone BBS in Holland
  5020.  
  5021.      For those outside the USA, particularly in Europe, Gerard  provides  BBS
  5022.      service  and  anonymous UUCP access to the machine 'gvdgpc'. He supports
  5023.      Xmodem and Kermit on the BBS, at 1200/2400 baud, auto baud  rate  detect
  5024.      by  hitting a carriage return, using 8 bits, NO Parity, 1 Stop Bit.  The
  5025.      telephone number is 0031-70-119549.
  5026.  
  5027.      For uucp, use login 'nuucp', with no password (you won't be prompted for
  5028.      one).   Request the file ~/FILES to get started.  Gerard does a good job
  5029.      of staying up to date via a link to the wb3ffv machine.
  5030.  
  5031.      8.1.3.  Gary Sanders' Phone BBS in the USA
  5032.  
  5033.      Gary Sanders, N8EMR, runs a system called HBBS (Ham Bulletin board  sys-
  5034.      tem).   The  telephone number is  614-457-4227 (457-HBBS). The system is
  5035.      online 24hrs a day and will accept 1200/2400 and 19.2k baud PEP, 8  bits
  5036.      no parity, 1 stop bit.
  5037.  
  5038.      Gary's system will be used to support topics of interest  to  Ham  Radio
  5039.      Operators,  Short  Wave  Listeners,  scanner  listeners, and TVRO users.
  5040.      Currently there are message and file upload/dowload sections for general
  5041.      ham radio, packet radio, the KA9Q tcp software, SWL, and scanners.
  5042.  
  5043.      There is also readonly access to Unix USENET and  to  the  FIDO  network
  5044.      radio related newsgroups.
  5045.  
  5046.      Access to the BBS files are available via FTP  from  n8emr  [44.70.0.1].
  5047.      The  system  is available via 144.97 in Central Ohio, or via the 220 and
  5048.      446 packet network within Ohio.
  5049.  
  5050.      8.1.4.  Michael Broqvist in Sweden
  5051.  
  5052.      Michael operates a BBS for the Gothenburg Amateur Club called the HamNet
  5053.      Conference  System.   It  operates  at  +46/31-30  35 25, 300-2400 baud.
  5054.      Michael  can  be  reached  as  sysop  of  Fidonet  node  2:202/301,   as
  5055.      mibro@hamnet.se on the Internet, or via uucp as enea!hamnet.se!mibro.
  5056.  
  5057.      He also updates the packet mailbox SK6SA in Gothenburg Sweden  which  is
  5058.      reachable as 44.140.18.2.
  5059.  
  5060.  
  5061.  
  5062.  
  5063.  
  5064.  
  5065.  
  5066.  
  5067.  
  5068.  
  5069.  
  5070.  
  5071.                                       - 78 -
  5072.  
  5073.  
  5074.      8.2.  The KISS Specification
  5075.  
  5076.      8.3.  The KISS Host to TNC Protocol
  5077.  
  5078.      8.3.1.  The Protocol Specification
  5079.  
  5080.      8.3.1.1.  Introduction
  5081.  
  5082.      The purpose of the "Raw" (aka "KISS") TNC is to facilitate  the  use  of
  5083.      amateur  packet  radio  controllers  (TNCs)  with  host  computers, par-
  5084.      ticularly in the development of experimental  protocols  and  multi-user
  5085.      servers (e.g.,  "bulletin boards").
  5086.  
  5087.      Current TNC software was  written  with  human  users  in  mind;  unfor-
  5088.      tunately,  commands   and  responses  well suited for human use are ill-
  5089.      adapted for host computer use, and vice versa. This is  especially  true
  5090.      for  multi-user  servers  such  as  bulletin boards which must multiplex
  5091.      data from several network connections across the single  host/TNC  link.
  5092.      In  addition,  experimentation  with   new   link  level   protocols  is
  5093.      greatly hampered because there may very well be no way at  all  to  gen-
  5094.      erate or receive frames in the desired format without  reprogramming the
  5095.      TNC.
  5096.  
  5097.      The Raw TNC solves these problems by eliminating  as  much  as  possible
  5098.      from   the  TNC software, giving the attached host complete control over
  5099.      and access to the contents of the HDLC frames transmitted  and  received
  5100.      over  the air.  The  AX.25 protocol is removed entirely from the TNC, as
  5101.      are all command interpreters and the  like.   The  TNC  simply  converts
  5102.      between  synchronous  HDLC,  spoken  on  the half  duplex radio channel,
  5103.      and a special asynchronous, full  duplex  frame  format  spoken  on  the
  5104.      host/TNC  link.  Every  frame  received  on   the  HDLC  link  is passed
  5105.      intact to the host once it has been translated to the asynchronous  for-
  5106.      mat;  likewise, asynchronous frames from the host are transmitted on the
  5107.      radio channel once they have been converted to HDLC format.
  5108.  
  5109.      Of course, this means that the bulk of AX.25 (or another protocol)  must
  5110.      now  be  implemented   on  the host system. This is acceptable, however,
  5111.      considering the greatly increased flexibility and reduced  overall  com-
  5112.      plexity  that  comes  from allowing  the  protocol to reside on the same
  5113.      machine with the applications to which it is closely coupled.
  5114.  
  5115.      8.3.1.2.  Asynchtronous Frame Format
  5116.  
  5117.      The "asynchronous packet protocol" spoken between the host  and  TNC  is
  5118.      very  simple,   since its only function is delimiting frames. Each frame
  5119.      is both preceded and followed by a special FEND (frame  end)  character,
  5120.      analogous  to  an HDLC flag.  No CRC or checksum is provided.
  5121.  
  5122.      The reason for both preceding and ending frames with FENDs is to improve
  5123.      performance   when  there  is  noise on the asynch line. The FEND at the
  5124.      beginning of a frame serves to "flush out" any accumulated garbage  into
  5125.      a  separate  frame (which will be discarded by the upper layer protocol)
  5126.      instead of prepending it to an otherwise good frame.  As  with  back-to-
  5127.      back   FLAGs   in   HDLC,   two   FEND characters in a row should not be
  5128.  
  5129.  
  5130.  
  5131.  
  5132.  
  5133.  
  5134.  
  5135.  
  5136.  
  5137.                                       - 79 -
  5138.  
  5139.  
  5140.      interpreted as delimiting an empty frame.
  5141.  
  5142.      8.3.1.2.1.  Transparency
  5143.  
  5144.      Frames are sent in 8-bit binary; if an FEND ever appears in  the   data,
  5145.      it   is  translated   into   the   two   byte sequence FESC TFEND (frame
  5146.      escape, transposed frame end).  Likewise, if  the  FESC  character  ever
  5147.      appears  in  the  user  data,  it  is  replaced  with  the two character
  5148.      sequence FESC TFESC (frame escape, transposed frame escape).
  5149.  
  5150.      As characters arrive at the receiver, they are appended to a buffer con-
  5151.      taining  the  current  frame.  Receiving  a  FEND  marks  the end of the
  5152.      current frame.  Receipt of a  FESC  puts  the  receiver  into   "escaped
  5153.      mode",   which   causes   the receiver to translate a following TFESC or
  5154.      TFEND back to FESC or  FEND,  respectively,  before  adding  it  to  the
  5155.      receive  buffer  and  leaving  escaped  mode.  (Receipt  of  any charac-
  5156.      ter other than TFESC or TFEND while in escaped  mode  is  an  error;  no
  5157.      action  is  taken  and  frame  assembly  continues.   A  TFEND  or  TESC
  5158.      received while not in escaped mode is treated as an ordinary data  char-
  5159.      acter.)
  5160.  
  5161.      This procedure may seem somewhat complicated, but it is easy  to  imple-
  5162.      ment  and recovers  quickly from errors. In particular, the FEND charac-
  5163.      ter is never sent over the channel except  as  an  actual   end-of-frame
  5164.      indication.   This   ensures that  any  intact frame (properly delimited
  5165.      by FEND characters) will always be received properly regardless  of  the
  5166.      starting state of the receiver or corruption of the preceding frame.
  5167.  
  5168.      The special characters are:
  5169.  
  5170.              FEND    (frame end)                     300 (octal)
  5171.              FESC    (frame escape)                  333 (octal)
  5172.              TFEND   (transposed frame end)          334 (octal)
  5173.              TFESC   (transposed frame escape)       335 (octal)
  5174.  
  5175.      (ARPA Internet hackers will recognize this  protocol  as  identical   to
  5176.      SLIP,   a popular method for sending IP datagrams across ordinary dialup
  5177.      modems).
  5178.  
  5179.      8.3.1.3.  Control of the Raw TNC
  5180.  
  5181.      Each asynchronous data frame sent to the TNC is  converted   back   into
  5182.      "pure"  form   and  queued  for  transmission  as a separate HDLC frame.
  5183.      Although removing the human interface and the AX.25  protocol  from  the
  5184.      TNC   makes  most  existing TNC  commands unnecessary (i.e., they become
  5185.      host  functions),  the  TNC  is  still  responsible   for   keying   the
  5186.      transmitter's   PTT   line   and   deferring  to  other activity  on the
  5187.      radio channel. It is therefore necessary to allow the host to control  a
  5188.      few  TNC  parameters,  namely   the  transmitter  keyup  delay  and  the
  5189.      transmitter persistence variables.
  5190.  
  5191.      It is therefore necessary  to  distinguish  between  command  and   data
  5192.      frames   on the  host/TNC  link. This is done by defining the first byte
  5193.      of each asynchronous frame between host and TNC as a  "type"  indicator.
  5194.  
  5195.  
  5196.  
  5197.  
  5198.  
  5199.  
  5200.  
  5201.  
  5202.  
  5203.                                       - 80 -
  5204.  
  5205.  
  5206.      The  following  types are defined in frames to the TNC:
  5207.  
  5208.      Type    Function        Comments
  5209.  
  5210.      0       Data frame      Rest of frame is data destined for HDLC channel
  5211.  
  5212.      1       TXDELAY         Second byte is TX keyup delay in 10 ms units
  5213.  
  5214.      2       P               Second byte is persistence parameter, p:
  5215.                              0: p = (0+1)/256, 255: p = (255+1)/256 = 1.0]
  5216.  
  5217.      3       SLOTTIME        Second byte is slot interval in 10 ms units
  5218.  
  5219.      4       TXtail          Second byte is time to hold up the TX after
  5220.                              the FCS has been sent (time allowed to send the
  5221.                              HDLC flag character; should be at  least  2  for
  5222.                              1200 bps operation).  In 10 ms units.
  5223.  
  5224.      The following types are defined in frames to the host:
  5225.  
  5226.      Type    Function        Comments
  5227.  
  5228.      0       Data frame      Rest of frame is data from the HDLC channel
  5229.  
  5230.      (No other types are defined; in particular, there is  no  provision  for
  5231.      ack- nowledging data or command frames sent to the TNC.)
  5232.  
  5233.      8.3.1.4.  Persistence
  5234.  
  5235.      The P and SLOTTIME parameters are used to implement  true   p-persistent
  5236.      CSMA.  This works as follows:
  5237.  
  5238.      Whenever the host has queued data for transmission, the TNC begins  mon-
  5239.      itoring the  carrier detect signal from the modem. It waits indefinitely
  5240.      for this sig- nal to go inactive. Once the channel is clear,   the   TNC
  5241.      generates   a  random number  between  0 and 255. If this number is less
  5242.      than or equal to P, the TNC asserts the transmitter PTT line, waits  .01
  5243.      *  TXDELAY  seconds,   and  transmits all  frames  in its queue. The TNC
  5244.      then releases PTT and goes back to the idle state.  If the random number
  5245.      is  greater  than  P, the  TNC  delays  signal  has gone  active  in the
  5246.      meantime, the TNC again waits for it  to  clear  before  con-  tinuing).
  5247.      Note   that   P=255   means   always   transmit  as  soon  as  possible,
  5248.      regardless of the random number.
  5249.  
  5250.      The result is that the  TNC  waits  for   an   exponentially-distributed
  5251.      random  interval  after  sensing  that the channel has gone clear before
  5252.      attempting to transmit. The idea here is that with proper tuning of  the
  5253.      parameters  P  and SLOTTIME,  several  stations with traffic to send are
  5254.      much less likely to col- lide with each other when  they  simultaneously
  5255.      see the channel go clear.
  5256.  
  5257.      8.3.2.  The TNC-2 Implementation
  5258.  
  5259.      See the files included in the TNC-2 KISS Distribution.
  5260.  
  5261.  
  5262.  
  5263.  
  5264.  
  5265.  
  5266.  
  5267.  
  5268.  
  5269.                                       - 81 -
  5270.  
  5271.  
  5272.      8.3.3.  The TNC-1 Implementation
  5273.  
  5274.      See the files included in the TNC-1 KISS Distribution.
  5275.  
  5276.      8.3.4.  The VADCG/ASHBY Implementation
  5277.  
  5278.      See the files included in the VADCG/ASHBY KISS Distribution.
  5279.  
  5280.      8.3.5.  The AEA Implemenation
  5281.  
  5282.      All PK-232 units with WEFAX, and PC-87 units of a similar  vintage,  are
  5283.      capable of KISS operation.  See the installation instructions earlier in
  5284.      this document for more information.
  5285.  
  5286.      8.3.6.  The Kantronics Implemenation
  5287.  
  5288.      See your Kantronics TNC Documentation.
  5289.  
  5290.  
  5291.      8.5.  Information for Software Developers
  5292.  
  5293.  
  5294.                                       - 94 -
  5295.  
  5296.      8.6.  Technical Information for Client/Server Developers
  5297.  
  5298.      First things first.  The program has been tested out with  the  Turbo  C
  5299.      2.0  compiler under MS-Dos, the HP-UX 5.21 and 6.2 compilers, the Micro-
  5300.      port 286 compiler, and the Mark  Williams  compiler  on  the  Atari  ST.
  5301.      There  is  a  known  problem compiling under Aztec C 4.10d on the PC, if
  5302.      someone can figure out what is going  wrong  it  would  be  appreciated.
  5303.      With that out of the way...
  5304.  
  5305.      This section describes the "guts" of the Internet package for the  bene-
  5306.      fit   of  programmers   who   wish  to  write their own applications, or
  5307.      adapt the code to different hardware environments. Potential application
  5308.      developers should consider strongly writing new applications for the NOS
  5309.      version of the package, which is currently in development. Contact  Phil
  5310.      Karn  KA9Q or Bdale Garbee N3EUA for more information.  There will *not*
  5311.      be another release of the software based on the internal structure  used
  5312.      through this release.
  5313.  
  5314.      The code as distributed includes both the  functions  of  an  IP  packet
  5315.      switch  and an  end-host  system,  including several servers. The imple-
  5316.      mentation is highly modular, however. For example, if one wants to build
  5317.      a  dedicated packet switch without  any  local applications, the various
  5318.      applications and the TCP and UDP modules may easily be omitted  to  save
  5319.      space.
  5320.  
  5321.      The package allows multiple simultaneous applications,  each  supporting
  5322.      multi-  ple   simultaneous   users,  each using TCP and/or UDP. The only
  5323.      limit is memory space, which is getting quite tight on the  820;  the  C
  5324.      compiler  for  the  IBM   PC seems  to  generate  much more compact code
  5325.      (typically 1/2 as large as for the Z-80) so the PC seems more  promising
  5326.      as a large-scale server.
  5327.  
  5328.      8.6.1.  Data Structures
  5329.  
  5330.      To increase portability, the pseudo-types "int16" and "int32"  are  used
  5331.      to  mean  an   unsigned   16-bit  integer  and  a signed 32-bit integer,
  5332.      respectively.  Ordi- narily these types are defined in machdep.h  to  be
  5333.      "unsigned int" and "long".
  5334.  
  5335.      The various modules pass data  in  chained  structures   called   mbufs,
  5336.      with  the following format:
  5337.  
  5338.      struct mbuf {
  5339.          struct mbuf *next;      /* Link mbufs belonging to single packets */
  5340.          struct mbuf *anext;     /* Link packets on queues */
  5341.          char *data;             /* Ptr to start of actual data in buffer */
  5342.          int16 cnt;              /* Length of data in buffer */ };
  5343.  
  5344.      Although somewhat cumbersome to work with, mbufs make  it  possible   to
  5345.      avoid  memory-to-memory copies that limit performance. For example, when
  5346.      user data is transmitted it must first traverse several protocol  layers
  5347.      before  reaching  the  transmitter hardware. With mbufs, each layer adds
  5348.      its protocol header by allo- cating an mbuf and linking it to  the  head
  5349.      of the mbuf "chain" given it by  the higher layer, thus avoiding several
  5350.  
  5351.  
  5352.  
  5353.  
  5354.  
  5355.  
  5356.  
  5357.  
  5358.  
  5359.                                       - 95 -
  5360.  
  5361.  
  5362.      copy operations.
  5363.  
  5364.      A number of primitives operating on mbufs are available in mbuf.c.   The
  5365.      user  may   create,   fill,   empty  and  free  mbufs  himself  with the
  5366.      alloc_mbuf and free_mbuf primitives, or at the cost of a single  memory-
  5367.      to-memory  copy  he  he may use the more convenient qdata() and dqdata()
  5368.      primitives.
  5369.  
  5370.      8.6.2.  Timer Services
  5371.  
  5372.      TCP and IP require timers. A timer package  is  included,  so  the  user
  5373.      must  arrange  to call the single entry point "tick" on a regular basis.
  5374.      The constant MSPTICK in  timer.h  should  be  defined  as  the  interval
  5375.      between   ticks   in  milliseconds.  One  second resolution is adequate.
  5376.      Since it can  trigger  a  considerable  amount  of  activity,  including
  5377.      upcalls  to user level, "tick" should not be called  from  an  interrupt
  5378.      handler. A clock interrupt should set  a  flag  which  will  then  cause
  5379.      "tick" to be called at user level.
  5380.  
  5381.      8.6.3.  Internet Type-of-Service
  5382.  
  5383.      One of the features of the Internet  is  the  ability  to  specify  pre-
  5384.      cedence  (i.e.,  priority)  on  a per-datagram basis. There are 8 levels
  5385.      of precedence, with the bottom 6 defined by the DoD as  Routine,  Prior-
  5386.      ity,  Immediate,  Flash, Flash  Override  and  CRITICAL.  (Two  more are
  5387.      available for internal network functions). For amateur use  we  can  use
  5388.      the  lower  four  as  Routine,  Welfare, Priority  and  Emergency. Three
  5389.      more bits specify class of  service,  indicating  that  especially  high
  5390.      reliability,  high  throughput or low delay is  needed  for this connec-
  5391.      tion. Constants for this field are defined in internet.h.
  5392.  
  5393.      8.6.4.  The Internet Protocol Implementation.
  5394.  
  5395.      While the user does not ordinarily see  this  level  directly,   it   is
  5396.      described here  for sake of completeness. Readers interested only in the
  5397.      interfaces seen by the applications programmer should skip  to  the  TCP
  5398.      and UDP sections.
  5399.  
  5400.      The IP implementation  consists  of  three  major  functions:  ip_route,
  5401.      ip_send and ip_recv.
  5402.  
  5403.      8.6.5.  IP Gateway (Packet Router) Support
  5404.  
  5405.      The first, ip_route, is the IP packet switch. It takes a  single   argu-
  5406.      ment,  a pointer to the mbuf containing the IP datagram:
  5407.  
  5408.              void
  5409.              ip_route(bp,rxbroadcast)
  5410.              struct mbuf *bp;        /* Datagram pointer */
  5411.              int rxbroadcast;        /* Don't forward */
  5412.  
  5413.      All IP datagrams, coming or going, pass through this   function.   After
  5414.      option  processing,   if   any,   the  datagram's destination address is
  5415.      extracted. If it corresponds to the local host, it is "kicked  upstairs"
  5416.  
  5417.  
  5418.  
  5419.  
  5420.  
  5421.  
  5422.  
  5423.  
  5424.  
  5425.                                       - 96 -
  5426.  
  5427.  
  5428.      to  the upper half of IP and  thence to the appropriate protocol module.
  5429.      Otherwise, an internal routing table consulted to  determine  where  the
  5430.      datagram   should   be   forwarded.    The routing  table  uses  hashing
  5431.      keyed on IP destination addresses, called "tar-  gets".  If  the  target
  5432.      address is not  found,  a  special  "default"  entry,  if available,  is
  5433.      used. If a default entry is not available either, an ICMP "Des- tination
  5434.      Unreachable" message containing the offending IP header  is  returned to
  5435.      the sender.
  5436.  
  5437.      The "rxbroadcast" flag is used to prevent forwarding of broadcast  pack-
  5438.      ets,   a  practice  which  might otherwise result in spectacular routing
  5439.      loops. Any subnet interface driver receiving a packet addressed  to  the
  5440.      broadcast address  within that  subnet  MUST  set  this flag.  All other
  5441.      packets (including locally ori- ginated packets) should  have  "rxbroad-
  5442.      cast" set to zero.
  5443.  
  5444.      ip_route ignores the IP destination address in broadcast packets,  pass-
  5445.      ing them up  to the appropriate higher level protocol which is also made
  5446.      aware of their broadcast nature. (TCP and ICMP ignore them; only UDP can
  5447.      accept them).
  5448.  
  5449.      Entries are added to the IP routing table with the rt_add function:
  5450.  
  5451.      int      rt_add(target,gateway,metric,interface)      int32      target;
  5452.      /* IP address of target */ int32 gateway;                  /* IP addr of
  5453.      gateway to reach  this  target  */  int  metric;                      /*
  5454.      "cost"  metric,  for  routing  decisions */ struct interface *interface;
  5455.      /* device interface structure */
  5456.  
  5457.      "target" is the IP address of  the  destination;  it  becomes  the  hash
  5458.      index   key for subsequent packet destination address lookups. If target
  5459.      == 0, the default entry is modified. "metric" is simply  stored  in  the
  5460.      table;  it  is  available  for  routing   cost   calculations   when  an
  5461.      automatic  routing protocol is written.  "interface" is the address of a
  5462.      control  structure  for  the  particular  device to which  the  datagram
  5463.      should  be sent; it is defined in the section "IP Inter- faces".
  5464.  
  5465.      rt_add returns 0 on success, -1 on failure (e.g., out of memory).
  5466.  
  5467.      To remove an entry from the routing table,  only  the   target   address
  5468.      need  be specified to the rt_drop call:
  5469.  
  5470.              int
  5471.              rt_drop(target)
  5472.              int32 target;
  5473.  
  5474.      rt_drop returns 0 on success, -1 if the target could not be found.
  5475.  
  5476.      8.6.6.  IP Interfaces
  5477.  
  5478.      Every lower level interface used to transmit IP datagrams must  have  an
  5479.      "inter- face" structure, defined as follows:
  5480.  
  5481.      /* Interface control structure */
  5482.  
  5483.  
  5484.  
  5485.  
  5486.  
  5487.  
  5488.  
  5489.  
  5490.  
  5491.                                       - 97 -
  5492.  
  5493.  
  5494.       struct interface {
  5495.              struct interface *next; /* Linked list pointer */
  5496.              char *name;             /* Ascii string with interface name */
  5497.              int16 mtu;              /* Maximum transmission unit size */
  5498.              int (*send)();          /* Routine to call to send datagram */
  5499.              int (*output)();        /* Routine to call to send raw packet */
  5500.              int (*recv)();          /* Routine to kick to process input */
  5501.              int (*stop)();          /* Routine to call before detaching */
  5502.              int16 dev;              /* Subdevice number to pass to send */
  5503.              int16 flags;            /* State of interface */
  5504.       #define IF_ACTIVE       0x01
  5505.       #define IF_BROADCAST    0x04    /* Interface is capable of broadcasting
  5506.      */ };
  5507.  
  5508.      Part of the interface structure is for the private use  of  the   device
  5509.      driver.  "dev"  is  used to distinguish between one of several identical
  5510.      devices (e.g., serial links or radio channels) that might share the same
  5511.      send routine.
  5512.  
  5513.      A pointer to this structure kept in the  routing   table.   Two   fields
  5514.      in   the  interface   structure   are   examined  by ip_route: "mtu" and
  5515.      "send". The  maximum  transmission  unit  size  represents  the  largest
  5516.      datagram that  this  device  can handle; ip_route will do IP-level frag-
  5517.      mentation as required to meet this  limit  before  calling  "send",  the
  5518.      function to  queue  datagrams  on  this  interface.  "send" is called as
  5519.      follows:
  5520.  
  5521.       (*send)(bp,interface,gateway,precedence,delay,throughput,reliability)
  5522.       struct mbuf *bp;                /* Pointer to datagram */
  5523.       struct interface *interface;    /* Interface structure */
  5524.       int32 gateway;                  /* IP address of gateway */
  5525.       char precedence;                /* TOS bits from IP header */
  5526.       char delay;
  5527.       char throughput;
  5528.       char reliability;
  5529.  
  5530.      The "interface" and "gateway"  arguments  are  kept   in   the   routing
  5531.      table   and  passed  on  each  call  to  the send routine. The interface
  5532.      pointer is passed again because several interfaces might share the  same
  5533.      output driver  (e.g.,  several identical  physical channels).  "gateway"
  5534.      is the IP address of the neighboring IP gateway on the other end of  the
  5535.      link;  if  a  link-level  address is  required, the  send  routine  must
  5536.      map  this address either dynamically (e.g., with the Address  Resolution
  5537.      Protocol,  ARP)  or with a static lookup table.  If the  link is  point-
  5538.      to-point, link-level addresses are unnecessary, and the send routine can
  5539.      therefore ignore the gateway address.
  5540.  
  5541.      The Internet Type-of-Service (TOS) bits  are  passed  to  the  interface
  5542.      driver   as  separate  arguments.  If  tradeoffs exist within the subnet
  5543.      between these various classes of service, the driver may use these argu-
  5544.      ments  to  control  them   (e.g., optional use of link level acknowledg-
  5545.      ments, priority queuing, etc.)
  5546.  
  5547.      It is expected that the send routine will put a link level header on the
  5548.  
  5549.  
  5550.  
  5551.  
  5552.  
  5553.  
  5554.  
  5555.  
  5556.  
  5557.                                       - 98 -
  5558.  
  5559.  
  5560.      front of  the  packet, add it an internal output queue, start output (if
  5561.      not already active) and return. It must  NOT  busy-wait  for  completion
  5562.      (unless it is a  very fast device, e.g., Ethernet) since that blocks the
  5563.      entire system.
  5564.  
  5565.      Any interface that uses ARP must also provide an "output"  routine.   It
  5566.      is   a  lower  level  entry  point that allows the caller to specify the
  5567.      fields in the link header. ARP uses it to  broadcast  a  request  for  a
  5568.      given  IP  address. It may be  the  same  routine used internally by the
  5569.      driver to send IP datagrams once the link level fields have been  deter-
  5570.      mined. It is called as follows:
  5571.  
  5572.       (*output)(interface,dest,src,type,bp)
  5573.       struct interface *interface;    /* Pointer to interface structure */
  5574.       char dest[];                    /* Link level destination address */
  5575.       char src[];                     /* Link level source address */
  5576.       int16 type;                     /* Protocol type field for  link  level
  5577.      */
  5578.       struct mbuf *bp;                /* Data field (IP datagram) */
  5579.  
  5580.      8.6.7.  IP Host Support
  5581.  
  5582.      All of the modules described thus far are  required  in   all   systems.
  5583.      However,  the  routines  that  follow  are  necessary  only  if the sys-
  5584.      tem is to support higher-level applications. In a standalone IP  gateway
  5585.      (packet  switch)  without servers  or clients, the following modules (IP
  5586.      user level, TCP and UDP) may be omitted to allow  additional  space  for
  5587.      buffering;  define  the  flag  GWONLY  when compiling iproute.c to avoid
  5588.      referencing the user level half of IP.
  5589.  
  5590.      The following function  is  called  by  iproute()  whenever  a  datagram
  5591.      arrives that is addressed to the local system.
  5592.  
  5593.       void
  5594.       ip_recv(bp,rxbroadcast)
  5595.       struct mbuf *bp;                /* Datagram */
  5596.       char rxbroadcast;               /* Incoming broadcast */
  5597.  
  5598.      ip_recv reassembles IP datagram fragments, if necessary, and calls   the
  5599.      input  function   of   the   next   layer   protocol  (e.g.,  tcp_input,
  5600.      udp_input) with the appropriate arguments, as follows:
  5601.  
  5602.       (*protrecv)(bp,protocol,source,dest,tos,length,rxbroadcast);
  5603.       struct mbuf *bp;        /* Pointer to packet minus IP header */
  5604.       char protocol;          /* IP protocol ID */
  5605.       int32 source;           /* IP address of sender */
  5606.       int32 dest;             /* IP address of destination (i.e,. us) */
  5607.       char tos;               /* IP type-of-service field in datagram */
  5608.       int16 length;           /* Length of datagram minus IP header */
  5609.       char rxbroadcast;       /* Incoming broadcast */
  5610.  
  5611.      The list of protocols is contained in a  switch()   statement   in   the
  5612.      ip_recv  function.  If  the  protocol  is  unsupported, an ICMP Protocol
  5613.      Unreachable message is returned to the sender unless the packet came  in
  5614.  
  5615.  
  5616.  
  5617.  
  5618.  
  5619.  
  5620.  
  5621.  
  5622.  
  5623.                                       - 99 -
  5624.  
  5625.  
  5626.      as  a  broadcast.   Higher  level  protocols such as TCP and UDP use the
  5627.      ip_send routine to generate  IP  datagrams.  The  arguments  to  ip_send
  5628.      correspond  directly  to fields in the IP header, which is generated and
  5629.      put in front of the user's  data  before  being handed to ip_route:
  5630.  
  5631.       ip_send(source,dest,protocol,tos,ttl,bp,length,id,df)
  5632.       int32 source;           /* source address */
  5633.       int32 dest;             /* Destination address */
  5634.       char protocol;          /* Protocol */
  5635.       char tos;               /* Type of service */
  5636.       char ttl;               /* Time-to-live */
  5637.       struct mbuf *bp;        /* Data portion of datagram */
  5638.       int16 length;           /* Optional length of data portion */
  5639.       int16 id;               /* Optional identification */
  5640.       char df;                /* Don't-fragment flag */
  5641.  
  5642.      This interface is modeled very closely after the example given  on  page
  5643.      32  of RFC-791.  Zeros  may be passed for id or ttl, and system defaults
  5644.      will be pro- vided. If zero is passed for length, it will be  calculated
  5645.      automatically.
  5646.  
  5647.      8.6.8.  The Transmission Control Protocol (TCP)
  5648.  
  5649.      A TCP connection is  uniquely  identified  by   the   concatenation   of
  5650.      local   and remote  "sockets".  In  turn,  a  socket  consists of a host
  5651.      address (a 32-bit integer) and a TCP port (a 16-bit integer), defined by
  5652.      the C structure
  5653.  
  5654.       struct socket {
  5655.              long address;   /* 32-bit IP address */
  5656.              short port;     /*16-bit TCP port */
  5657.       };
  5658.  
  5659.      It is therefore possible to have several simultaneous but distinct  con-
  5660.      nections  to   the  same  port on a given machine, as long as the remote
  5661.      sockets are dis- tinct. Port numbers are assigned either through  mutual
  5662.      agreement,  or more com- monly  when  a  "standard" service is involved,
  5663.      as a "well known port"  number.   For  example,   to   obtain   standard
  5664.      remote  login  service  using  the  TELNET presentation-layer  protocol,
  5665.      by  convention you initiate a connection to TCP port 23;  to  send  mail
  5666.      using  the Simple Mail Transfer Protocol (SMTP) you  con- nect  to  port
  5667.      25. ARPA maintains port number lists and  periodically  publishes  them;
  5668.      the latest revision is RFC-960,  "Assigned  Numbers".   They  will  also
  5669.      assign  port  numbers  to  a new application on request if it appears to
  5670.      be of general interest.
  5671.  
  5672.      TCP connections are best modeled as a pair  of  one-way  paths  (one  in
  5673.      each  direction)  rather  than  single  full-duplex paths. A TCP "close"
  5674.      really means "I have no more data to send". Station A may close its path
  5675.      to  station  B   leaving the  reverse  path  from  B  to A unaffected; B
  5676.      may continue to send data to A indefinitely until it too closes its half
  5677.      of the  connection.   Even  after  a user initiates a close, TCP contin-
  5678.      ues to retransmit any unacknowledged data if necessary to ensure that it
  5679.      reaches  the  other  end. This is known as  "graceful close" and greatly
  5680.  
  5681.  
  5682.  
  5683.  
  5684.  
  5685.  
  5686.  
  5687.  
  5688.  
  5689.                                      - 100 -
  5690.  
  5691.  
  5692.      simplifies certain applications such as FTP.
  5693.  
  5694.      This package is written as a "module" intended to be compiled and linked
  5695.      with  the  application(s)  so that they can be run as one program on the
  5696.      same machine.  This greatly simplifies  the  user/TCP  interface,  which
  5697.      becomes  just   a   set   of  internal   subroutine   calls  on a single
  5698.      machine. The internal TCP state (e.g.,  the  address   of   the   remote
  5699.      station)   is   easily  accessed.  Reliability  is improved,  since  any
  5700.      hardware  failure  that  kills TCP will  likely  take  its  applications
  5701.      with  it  anyway.  Only  IP  datagrams  flow  out of the machine  across
  5702.      hardware  interfaces  (such  as asynch RS-232 ports or whatever else  is
  5703.      avail-  able)  so  hardware flow control or  complicated  host/front-end
  5704.      protocols  are unnecessary.
  5705.  
  5706.      The TCP supports five basic  operations  on  a   connection:   open_tcp,
  5707.      send_tcp,  receive_tcp,  close_tcp  and  del_tcp. A sixth, state_tcp, is
  5708.      provided mainly for debugging. Since this TCP module cannot  assume  the
  5709.      presence  of a  sleep/wakeup facility from the underlying operating sys-
  5710.      tem, functions that would ordinarily block (e.g., recv_tcp when no  data
  5711.      is  available)  instead  set  net_error to  the constant  EWOULDBLK  and
  5712.      immediately return -1.  Asynchronous notification of events such as data
  5713.      arrival   can   be   obtained   through  the  upcall  facility described
  5714.      earlier.
  5715.  
  5716.      Each TCP function is summarized in the following section  in  the   form
  5717.      of  C declarations and descriptions of each argument.
  5718.  
  5719.      int net_error;
  5720.  
  5721.      This global variable stores the specific cause of an error from  one  of
  5722.      the  TCP  or  UDP functions. All functions returning integers (i.e., all
  5723.      except open_tcp) return -1 in the  event  of  an  error,  and  net_error
  5724.      should  be  examined  to determine  the  cause. The  possible errors are
  5725.      defined as constants in the header file netuser.h.
  5726.  
  5727.       /* Open a TCP connection */
  5728.       struct tcb *
  5729.       open_tcp(lsocket,fsocket,mode,window,r_upcall,t_upcall,s_upcall,tos,user)
  5730.       struct socket *lsocket; /* Local socket */
  5731.       struct socket *fsocket; /* Remote socket */
  5732.       int mode;               /* Active/passive/server */
  5733.       int16 window;           /* Receive window (and send buffer) sizes */
  5734.       void (*r_upcall)();     /* Function to call when data arrives */
  5735.       void (*t_upcall)();     /* Function to call when ok to send  more  data
  5736.      */
  5737.       void (*s_upcall)();     /*  Function  to  call  when  connection  state
  5738.      changes */
  5739.       char tos;               /* Internet Type-of-Service */
  5740.       int *user;              /* Pointer for convenience of user */
  5741.  
  5742.      "lsocket" and "fsocket" are pointers to the local and  foreign  sockets,
  5743.      respec- tively.
  5744.  
  5745.      "mode" may take on three  values,  all   defined   in   net.user.h.   If
  5746.  
  5747.  
  5748.  
  5749.  
  5750.  
  5751.  
  5752.  
  5753.  
  5754.  
  5755.                                      - 101 -
  5756.  
  5757.  
  5758.      mode   is  TCP_PASSIVE,  no packets are sent, but a TCP control block is
  5759.      created that will accept a subsequent active open from another TCP. If a
  5760.      specific  foreign  socket is  passed  to  a  passive  open, then connect
  5761.      requests from any other foreign socket will be rejected. If the  foreign
  5762.      socket  fields  are  set  to  zero,  or  if fsocket  is  NULLSOCK,  then
  5763.      connect requests from any foreign socket will be accepted.  If  mode  is
  5764.      TCP_ACTIVE,  TCP  will  initiate a connection to  a  remote socket  that
  5765.      must already have been created in the LISTEN state by its  client.   The
  5766.      foreign  socket  must  be  completely specified in an active open.  When
  5767.      mode is TCP_SERVER, open_tcp behaves as  though  TCP_PASSIVE  was  given
  5768.      except  that  an internal "clone" flag is set. When a connection request
  5769.      comes in, a fresh copy of  the  TCP  control  block  is created and  the
  5770.      original  is  left intact. This allows multiple sessions to exist simul-
  5771.      taneously;  if  TCP_PASSIVE  were  used instead only the  first  connect
  5772.      request would be accepted.
  5773.  
  5774.      "r_upcall", "t_upcall" and  "s_upcall"  provide   optional   upcall   or
  5775.      pseudo-  interrupt   mechanisms  useful  when running in a non operating
  5776.      system environ- ment.  Each of the  three  arguments,  if  non-NULL,  is
  5777.      taken  as  the address of  a user-supplied function to call when receive
  5778.      data arrives, transmit queue space becomes available, or the  connection
  5779.      state  changes.  The   three   functions   are called with the following
  5780.      arguments:
  5781.  
  5782.       (*r_upcall)(tcb,count); /* count == number of bytes in receive queue */
  5783.       (*t_upcall)(tcb,avail); /* avail == space available in send queue */
  5784.       (*s_upcall)(tcb,oldstate,newstate);
  5785.  
  5786.      Note: whenever a single event invokes more than one upcall the order  in
  5787.      which  the upcalls are made is not strictly defined. In general, though,
  5788.      the Principle of Least Astonishment is followed.   E.g.,  when  entering
  5789.      the   ESTABLISHED  state, the state change upcall is invoked first, fol-
  5790.      lowed by the transmit upcall.   When   an   incoming   segment  contains
  5791.      both   data   and  FIN, the receive upcall is invoked first, followed by
  5792.      the state change to CLOSE_WAIT state.  In this case, the user may inter-
  5793.      pret this state change as a "end of file" indicator.
  5794.  
  5795.      "tos" is the Internet type-of-service field. This  parameter  is  passed
  5796.      along  to  IP   and is included in every datagram. The actual precedence
  5797.      value used is the higher of the two specified in the corresponding  pair
  5798.      of open_tcp calls.
  5799.  
  5800.      open_tcp returns a pointer to an internal Transmission   Control   Block
  5801.      (tcb).  This "magic cookie" must be passed back as the first argument to
  5802.      all other TCP calls. In event of error, the NULL pointer (0) is returned
  5803.      and  net_error  is set to the reason for the error.
  5804.  
  5805.      The only limit on the number of  TCBs  that  may  exist  at   any   time
  5806.      (i.e.,   the number  of  simultaneous  connections)  is  the  amount  of
  5807.      free memory on the machine. Each TCB on  a  16-bit  processor  currently
  5808.      takes  up   111   bytes;   addi-  tional   memory  is consumed and freed
  5809.      dynamically as needed to buffer send and receive data.  Deleting  a  TCB
  5810.      (see the del_tcp() call) reclaims its space.
  5811.  
  5812.  
  5813.  
  5814.  
  5815.  
  5816.  
  5817.  
  5818.  
  5819.  
  5820.  
  5821.                                      - 102 -
  5822.  
  5823.  
  5824.       /* Send data on a TCP connection */
  5825.       int
  5826.       send_tcp(tcb,bp)
  5827.       struct tcb *tcb;        /* TCB pointer */
  5828.       struct mbuf *bp;        /* Pointer to user's data mbufs */
  5829.  
  5830.      "tcb" is the pointer returned by the  open_tcp()   call.   "bp"   points
  5831.      to   the  user's   mbuf   with   data  to be sent. After being passed to
  5832.      send_tcp, the user must no longer access the data buffer. TCP uses posi-
  5833.      tive acknowledgments  with retransmission  to  ensure in-order delivery,
  5834.      but this is largely invisible to the user. Once the remote TCP has  ack-
  5835.      nowledged the data, the  buffer  will  be freed automatically.
  5836.  
  5837.      TCP does not enforce a limit in  the  number  of  bytes  that   may   be
  5838.      queued  for transmission,  but  it  is  recommended that the application
  5839.      not send any more than the amount passed as  "cnt"  in  the  transmitter
  5840.      upcall.   The  package  uses shared,  dynamically allocated buffers, and
  5841.      it is entirely possible for a mis- behaving user task to run the  system
  5842.      out of buffers.
  5843.  
  5844.       /* Receive data on a TCP connection */
  5845.       int
  5846.       recv_tcp(tcb,bp,cnt)
  5847.       struct tcb *tcb;
  5848.       struct mbuf **bp;
  5849.       int16 cnt;
  5850.  
  5851.      recv_tcp() passes back through bp a pointer to an mbuf  chain   contain-
  5852.      ing   any  available  receive  data, up to a maximum of "cnt" bytes. The
  5853.      actual number of bytes received (the lesser of  "cnt"  and  the   number
  5854.      pending   on   the  receive queue) is returned. If no data is available,
  5855.      net_error is set to EWOULDBLK and -1 is returned; the r_upcall mechanism
  5856.      may  be   used   to   determine   when  data arrives.  (Technical  note:
  5857.      "r_upcall" is called whenever a PUSH or FIN bit is seen in  an  incoming
  5858.      segment,  or  if  the receive  window  fills.  It  is  called before  an
  5859.      ACK  is  sent back to the remote TCP, in  order  to  give  the  user  an
  5860.      opportunity to piggyback any data in response.)
  5861.  
  5862.      When the remote TCP closes its half of the  connection  and  all   prior
  5863.      incoming  data   has   been  read by the local user, subsequent calls to
  5864.      recv_tcp return 0 rather than -1 as an "end of transmission"  indicator.
  5865.      Note   that   the   local application  is  notified  of  a  remote close
  5866.      (i.e., end-of-file) by a state- change upcall with the new  state  being
  5867.      CLOSE_WAIT;  if   the  local  application has  closed  first,  a  remote
  5868.      close is indicated  by  a  state-change  upcall  to  either  CLOSING  or
  5869.      TIME_WAIT  state. (CLOSING state is used only  when  the  two ends close
  5870.      simultaneously and their FINs cross in the mail).
  5871.  
  5872.       /* Close a TCP connection */
  5873.       close_tcp(tcb)
  5874.       struct tcb *tcb;
  5875.  
  5876.      This tells TCP that the local user has no more  data   to   send.   How-
  5877.      ever,   the  remote  TCP  may  continue to send data indefinitely to the
  5878.  
  5879.  
  5880.  
  5881.  
  5882.  
  5883.  
  5884.  
  5885.  
  5886.  
  5887.                                      - 103 -
  5888.  
  5889.  
  5890.      local user, until the remote user also does a close_tcp.  An attempt  to
  5891.      send data after a  close_tcp is an error.
  5892.  
  5893.       /* Delete a TCP connection */
  5894.       del_tcp(tcb)
  5895.       struct tcb *tcb;
  5896.  
  5897.      When the connection has been closed in both connections and all incoming
  5898.      data  has been read, this call is made to cause TCP to reclaim the space
  5899.      taken up by the TCP control block. Any incoming data remaining unread is
  5900.      lost.
  5901.  
  5902.       /* Dump a TCP connection state */
  5903.       state_tcp(tcb)
  5904.       struct tcb *tcb;
  5905.  
  5906.      This debugging call prints an ASCII-format dump of  the  TCP  connection
  5907.      state  on the  terminal.  You need a copy of the TCP specification (ARPA
  5908.      RFC 793 or MIL- STD-1778) to interpret most of the numbers.
  5909.  
  5910.      8.6.9.  The User Datagram Protocol (UDP)
  5911.  
  5912.      UDP is available for simple applications not needing the services of   a
  5913.      reli-  able  protocol  like TCP.  A minimum of overhead is placed on top
  5914.      of the "raw" IP datagram service, consisting only of port numbers and  a
  5915.      checksum   covering  the  UDP  header  and user data. Four functions are
  5916.      available to the UDP user.
  5917.  
  5918.       /* Create a UDP control block for lsocket, so that we can queue
  5919.        * incoming datagrams.
  5920.        */
  5921.       int
  5922.       open_udp(lsocket,r_upcall)
  5923.       struct socket *lsocket;
  5924.       void (*r_upcall)();
  5925.  
  5926.      open_udp creates a queue to accept incoming  datagrams  (regardless   of
  5927.      source)  addressed   to  "lsocket".  "r_upcall"  is  an  optional upcall
  5928.      mechanism to provide the address of a function to be called  as  follows
  5929.      whenever a datagram arrives:
  5930.  
  5931.       (*r_upcall)(lsocket,rcvcnt);
  5932.       struct socket *lsocket;         /* Pointer to local socket */
  5933.       int rcvcnt;                     /* Count of datagrams pending on  queue
  5934.      */
  5935.  
  5936.       /* Send a UDP datagram */
  5937.       int
  5938.       send_udp(lsocket,fsocket,tos,ttl,bp,length,id,df)
  5939.       struct socket *lsocket;         /* Source socket */
  5940.       struct socket *fsocket;         /* Destination socket */
  5941.       char tos;                       /* Type-of-service for IP */
  5942.       char ttl;                       /* Time-to-live for IP */
  5943.       struct mbuf *bp;                /* Data field, if any */
  5944.  
  5945.  
  5946.  
  5947.  
  5948.  
  5949.  
  5950.  
  5951.  
  5952.  
  5953.                                      - 104 -
  5954.  
  5955.  
  5956.       int16 length;                   /* Length of data field */
  5957.       int16 id;                       /* Optional ID field for IP */
  5958.       char df;                        /* Don't Fragment flag for IP */
  5959.  
  5960.      The parameters passed to send_udp  are  simply  stuffed   in   the   UDP
  5961.      and  IP headers, and the datagram is sent on its way.
  5962.  
  5963.       /* Accept a waiting datagram, if available. Returns length of  datagram
  5964.      */
  5965.       int
  5966.       recv_udp(lsocket,fsocket,bp)
  5967.       struct socket *lsocket;         /* Local socket to receive on */
  5968.       struct socket *fsocket;         /* Place to stash incoming socket */
  5969.       struct mbuf **bp;               /* Place to stash data packet */
  5970.  
  5971.      The "lsocket" pointer indicates  the   socket   the   user   wishes   to
  5972.      receive   a datagram  on (a queue must have been created previously with
  5973.      the open_udp rou- tine). "fsocket" is taken as the address of  a  socket
  5974.      structure  to  be  overwrit-  ten  with  the  foreign  socket associated
  5975.      with the datagram being read; bp is overwritten with a  pointer  to  the
  5976.      data portion (if any) of the datagram  being received.
  5977.  
  5978.       /* Delete a UDP control block */
  5979.       int
  5980.       del_udp(lsocket)
  5981.       struct socket *lsocket;
  5982.  
  5983.      This function destroys any unread datagrams on a queue, and reclaims the
  5984.      space taken by the queue descriptor.
  5985.  
  5986.  
  5987.  
  5988.  
  5989.  
  5990.  
  5991.  
  5992.  
  5993.  
  5994.  
  5995.  
  5996.  
  5997.  
  5998.  
  5999.  
  6000.  
  6001.  
  6002.  
  6003.  
  6004.  
  6005.  
  6006.  
  6007.  
  6008.  
  6009.  
  6010.  
  6011.  
  6012.  
  6013.  
  6014.  
  6015.  
  6016.  
  6017.  
  6018.  
  6019.  
  6020.  
  6021.  
  6022.                                      CONTENTS
  6023.  
  6024.  
  6025.  
  6026.      Section Title                                                       Page
  6027.  
  6028.      1.  Introduction to TCP/IP and the KA9Q Software                      3
  6029.      1.1.  An Overview of the TCP/IP Protocol Family                       3
  6030.      1.1.1.  Acknowledgement                                               3
  6031.      1.1.2.  Introduction                                                  3
  6032.      1.1.3.  What is TCP/IP?                                               3
  6033.      1.1.4.  General description of the TCP/IP protocols                   8
  6034.      1.1.5.  The IP level                                                 12
  6035.      1.1.6.  The Ethernet level                                           13
  6036.      1.1.7.  Well-known sockets and the applications layer                15
  6037.      1.1.8.  An example application: SMTP                                 17
  6038.      1.2.  Protocols other than TCP: UDP and ICMP                         20
  6039.      1.3.  Keeping track of names and information: the domain system      21
  6040.      1.4.  Routing                                                        22
  6041.      1.5.  Details about Internet addresses: subnets and broadcasting     24
  6042.      1.6.  Datagram fragmentation and reassembly                          26
  6043.      1.7.  Ethernet encapsulation: ARP                                    26
  6044.      1.8.  Getting more information                                       27
  6045.      1.9.  Overview of the KA9Q Internet Package                          29
  6046.  
  6047.      2.  Installation                                                     31
  6048.      2.1.  What an IP Address Is, and How to Get One                      31
  6049.      2.2.  Configuring a TNC for TCP/IP Operation                         31
  6050.      2.2.1.  TAPR TNC-1 and Clones                                        31
  6051.      2.2.2.  TAPR TNC-2 and Clones                                        32
  6052.      2.2.3.  AEA PK-232                                                   32
  6053.      2.2.4.  Kantronics TNC's                                             33
  6054.      2.2.5.  Paccomm PC-100 Card                                          34
  6055.      2.2.6.  DRSI                                                         34
  6056.      2.3.  IBM PC and Clones                                              34
  6057.      2.3.1.  Installing the Plug'N'Play Disk                              34
  6058.      2.3.1.1.  The AUTOEXEC.NET File                                      34
  6059.      2.3.1.2.  The FTPUSERS File                                          35
  6060.      2.3.1.3.  The HOSTS.NET File                                         36
  6061.      2.3.2.  Installing on a Hard Disk                                    37
  6062.      2.4.  Unix                                                           37
  6063.      2.5.  Macintosh                                                      38 
  6064.      2.6.  Atari ST                                                       38
  6065.      2.7.  NEC PC-9801                                                    38
  6066.      2.8.  Hewlett-Packard Portable Plus                                  38
  6067.  
  6068.      3.  Taking NET for a Test Drive                                      39
  6069.      3.1.  Trying out the AX.25 Support                                   39
  6070.      3.2.  The Telnet Command                                             39
  6071.      3.3.  The FTP Command                                                40
  6072.      3.4.  The Mail System                                                40
  6073.      3.5.  Tracing and Status Commands                                    40
  6074.  
  6075.      4.  The Mail System                                                  42
  6076.      4.1.  Installing and Using BM                                        42
  6077.      4.1.1.  Installation                                                 42
  6078.      4.1.1.1.  Directory Structure                                        42
  6079.      4.1.1.2.  Configuration File                                         42
  6080.      4.1.1.2.1.  smtp <path>                                              43
  6081.      4.1.1.2.2.  host <your hostname>                                     43
  6082.      4.1.1.2.3.  user <username>                                          43
  6083.      4.1.1.2.4.  edit <path of your editor>                               43
  6084.      4.1.1.2.5.  fullname <your full name>                                43
  6085.      4.1.1.2.6.  reply <return address>                                   43
  6086.      4.1.1.2.7.  maxlet <number of messages>                              43
  6087.      4.1.1.2.8.  mbox <filename>                                          43
  6088.      4.1.1.2.9.  record <filename>                                        44
  6089.      4.1.1.2.10.  folder <directory name>                                 44
  6090.      4.1.1.2.11.  screen [bios|direct]                                    44
  6091.      4.1.1.2.12.  Example BM.RC File                                      44
  6092.      4.1.1.3.  The alias File                                             44
  6093.      4.1.1.4.  /spool/mqueue/sequence.seq                                 45
  6094.      4.1.2.  Environment                                                  45
  6095.      4.2.  Commands                                                       45
  6096.      4.2.1.  Main Menu Commands                                           45
  6097.      4.2.1.1.  m [userlist]                                               45
  6098.      4.2.1.2.  d [msglist]                                                45
  6099.      4.2.1.3.  h                                                          45
  6100.      4.2.1.4.  u [msglist]                                                46
  6101.      4.2.1.5.  n [mailbox]                                                46
  6102.      4.2.1.6.  ! cmd                                                      46
  6103.      4.2.1.7.  ?                                                          46
  6104.      4.2.1.8.  s [msglist] [file]                                         46
  6105.      4.2.1.9.  p [msglist]                                                46
  6106.      4.2.1.10.  w [msglist] file                                          46
  6107.      4.2.1.11.  f [msg]                                                   46
  6108.      4.2.1.12.  b [msg]                                                   46
  6109.      4.2.1.13.  r [msg]                                                   47
  6110.      4.2.1.14.  msg#                                                      47
  6111.      4.2.1.15.  l                                                         47
  6112.      4.2.1.16.  k [msglist]                                               47
  6113.      4.2.1.17.  $                                                         47
  6114.      4.2.1.18.  x                                                         47
  6115.      4.2.1.19.  q                                                         47
  6116.      4.2.2.  Text Input Commands                                          47
  6117.      4.2.3.  Command Line Options                                         48
  6118.      4.3.  Technical Information                                          48
  6119.      4.3.1.  Outbound Mail Queue File Formats                             48
  6120.      4.3.2.  Standards Documents                                          48
  6121.      4.4.  Bug Reports                                                    49
  6122.  
  6123.      5.  NET/ROM Support                                                  50
  6124.      5.1.  Introduction                                                   50
  6125.      5.2.  Setting up the NET/ROM Interface                               50
  6126.      5.3.  Tracing on the NET/ROM Interface                               50
  6127.      5.4.  Routing Broadcasts                                             50
  6128.      5.5.  The NET/ROM Routing Table                                      51
  6129.      5.6.  The Importance of the Routing Table                            52
  6130.      5.7.  Interfacing with NET/ROMs Using Your Serial Port               53
  6131.      5.8.  The Time to Live Initializer                                   53
  6132.      5.9.  Using NET/ROM Support for IP                                   53
  6133.      5.10.  The NET/ROM Transport Layer                                   54
  6134.      5.11.  Connecting via NET/ROM Transport                              55
  6135.      5.12.  Displaying the Status of NET/ROM Connections                  55
  6136.      5.13.  NET/ROM Transport Parameters                                  55
  6137.      5.14.  The Mailbox                                                   56
  6138.      5.15.  Where to go for More Information                              56
  6139.      5.16.  About the Code                                                56
  6140.  
  6141.      6.  Advanced Topics                                                  58
  6142.      6.1.  The Finger Server                                              58
  6143.      6.2.  The GRAPES Multi-Port Digipeating Code                         58
  6144.      6.3.  Multiple Serial Ports on One Interrupt                         59
  6145.  
  6146.      7.  NET Command Reference                                            60
  6147.      7.1.  Startup                                                        60
  6148.      7.2.  Console Mode                                                   60
  6149.      7.3.  Commands                                                       60
  6150.      7.3.1.  <cr>                                                         61
  6151.      7.3.2.  !                                                            61
  6152.      7.3.3.  #                                                            61
  6153.      7.3.4.  arp                                                          61
  6154.      7.3.4.1.  arp add <hostid> ether|ax25|netrom <ether addr|callsign>   61
  6155.      7.3.4.2.  arp drop <hostid> ether|ax25|netrom                        61
  6156.      7.3.4.3.  arp publish                                                61
  6157.      7.3.5.  attach                                                       61
  6158.      7.3.5.1.  HP Portable Specifics                                      63
  6159.      7.3.5.2.  SLIP Modem Dialing                                         63
  6160.      7.3.6.  ax25                                                         64
  6161.      7.3.6.1.  ax25 digipeat [on|off]                                     64
  6162.      7.3.6.2.  ax25 heard [on|off]                                        64
  6163.      7.3.6.3.  ax25 maxframe [<val]>]                                     64
  6164.      7.3.6.4.  ax25 mycall [<call>]                                       64
  6165.      7.3.6.5.  ax25 bbscall [<call>]                                      64
  6166.      7.3.6.6.  ax25 paclen [<val>]                                        64
  6167.      7.3.6.7.  ax25 pthresh [<val>]                                       65
  6168.      7.3.6.8.  ax25 reset <axcb>                                          65
  6169.      7.3.6.9.  ax25 retry [<val>]                                         65
  6170.      7.3.6.10.  ax25 status [<axcb>]                                      65
  6171.      7.3.6.11.  ax25 t1|t2|t3 [<val>]                                     65
  6172.      7.3.6.12.  ax25 window [<val>]                                       65
  6173.      7.3.7.  close [<session #>]                                          65
  6174.      7.3.8.  connect <interface> <callsign> [<digipeater> ... ]           65
  6175.      7.3.9.  dir [<dirname>]                                              66
  6176.      7.3.10.  disconnect [<session #>]                                    66
  6177.      7.3.11.  echo [accept|refuse]                                        66
  6178.      7.3.12.  eol [unix|standard]                                         66
  6179.      7.3.13.  escape <char>                                               67
  6180.      7.3.14.  etherstat                                                   67
  6181.      7.3.15.  exit                                                        67
  6182.      7.3.16.  finger                                                      67
  6183.      7.3.17.  ftp <hostid>                                                67
  6184.      7.3.17.1.  abort                                                     67
  6185.      7.3.17.2.  dir [<file>|<directory> [<localfile>]]                    67
  6186.      7.3.17.3.  get <remote_file> [<local_file>]                          68
  6187.      7.3.17.4.  ls [<file>|<directory> [<localfile>]]                     68
  6188.      7.3.17.5.  mkdir <remote_directory>                                  68
  6189.      7.3.17.6.  put <local_file> [<remote_file>]                          68
  6190.      7.3.17.7.  rmdir <remote_directory>                                  68
  6191.      7.3.17.8.  type [a|i|l<bytesize>]                                    68
  6192.      7.3.18.  help                                                        69
  6193.      7.3.19.  hostname [<name>]                                           69
  6194.      7.3.20.  log [stop|<file>]                                           69
  6195.      7.3.21.  ip                                                          69
  6196.      7.3.21.1.  ip address [<hostid>]                                     69
  6197.      7.3.21.2.  ip status                                                 69
  6198.      7.3.21.3.  ip ttl [<val>]                                            69
  6199.      7.3.22.  memstat                                                     69
  6200.      7.3.23.  mode <interface> [vc|datagram]                              69
  6201.      7.3.24.  mulport [on|off]                                            70
  6202.      7.3.25.  param <interface> [param]                                   71
  6203.      7.3.26.  pwd [<dirname>]                                             71
  6204.      7.3.27.  record [<filename>|off]                                     71
  6205.      7.3.28.  reset [<session>]                                           71
  6206.      7.3.29.  route                                                       71
  6207.      7.3.30.  session [<session #>]                                       72
  6208.      7.3.31.  shell                                                       73
  6209.      7.3.32.  smtp                                                        73
  6210.      7.3.32.1.  smtp gateway [<hostid>]                                   73
  6211.      7.3.32.2.  smtp kick                                                 73
  6212.      7.3.32.3.  smtp maxclients [<val>]                                   73
  6213.      7.3.32.4.  smtp timer [<val>]                                        73
  6214.      7.3.32.5.  smtp trace [<val>]                                        73
  6215.      7.3.33.  start                                                       73
  6216.      7.3.34.  stop                                                        74
  6217.      7.3.35.  tcp                                                         74
  6218.      7.3.35.1.  tcp irtt [<val>]                                          74
  6219.      7.3.35.2.  tcp kick <tcp_addr>                                       74
  6220.      7.3.35.3.  tcp mss [<size>]                                          74
  6221.      7.3.35.4.  tcp reset <tcb_addr>                                      74
  6222.      7.3.35.5.  tcp rtt <tcp_addr> <rtval>                                74
  6223.      7.3.35.6.  tcp status [<tcb_addr>]                                   74
  6224.      7.3.35.7.  tcp window [<val>]                                        75
  6225.      7.3.36.  telnet <hostid>                                             75
  6226.      7.3.37.  trace [<interface> [<flags>]|allmode|cmdmode]               75
  6227.      7.3.38.  udp status                                                  75 
  6228.      7.3.39.  upload [<filename>]                                         75 
  6229.      7.3.40.  ?                                                           75
  6230.  
  6231.      8.  Appendices                                                       76
  6232.      8.1.  Obtaining Current Bits                                         76
  6233.      8.1.1.  Via FTP on the Internet                                      76
  6234.      8.1.2.  On PC Floppies                                               76
  6235.      8.1.2.1.  WB3FFV's Phone BBS in the USA                              76
  6236.      8.1.2.2.  PA0GRI's Phone BBS in Holland                              77
  6237.      8.1.3.  Gary Sanders' Phone BBS in the USA                           77
  6238.      8.1.4.  Michael Broqvist in Sweden                                   77
  6239.      8.2.  The KISS Specification                                         78
  6240.      8.3.  The KISS Host to TNC Protocol                                  78
  6241.      8.3.1.  The Protocol Specification                                   78
  6242.      8.3.1.1.  Introduction                                               78
  6243.      8.3.1.2.  Asynchtronous Frame Format                                 78
  6244.      8.3.1.2.1.  Transparency                                             79
  6245.      8.3.1.3.  Control of the Raw TNC                                     79
  6246.      8.3.1.4.  Persistence                                                80
  6247.      8.3.2.  The TNC-2 Implementation                                     80
  6248.      8.3.3.  The TNC-1 Implementation                                     81
  6249.      8.3.4.  The VADCG/ASHBY Implementation                               81
  6250.      8.3.5.  The AEA Implemenation                                        81
  6251.      8.3.6.  The Kantronics Implemenation                                 81
  6252.      8.5.  Information for Software Developers                            93
  6253.      8.6.  Technical Information for Client/Server Developers             94
  6254.      8.6.1.  Data Structures                                              94
  6255.      8.6.2.  Timer Services                                               95
  6256.      8.6.3.  Internet Type-of-Service                                     95
  6257.      8.6.4.  The Internet Protocol Implementation.                        95
  6258.      8.6.5.  IP Gateway (Packet Router) Support                           95
  6259.      8.6.6.  IP Interfaces                                                96
  6260.      8.6.7.  IP Host Support                                              98
  6261.      8.6.8.  The Transmission Control Protocol (TCP)                      99
  6262.      8.6.9.  The User Datagram Protocol (UDP)                            103
  6263.  
  6264.