home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / pdp11 / k11art.txt < prev    next >
Text File  |  2020-01-01  |  18KB  |  347 lines

  1. ].rm 66
  2.                   The Kermit protocol and the PDP-11
  3.                    Brian Nelson   12-APR-1986 06:54
  4. Abstract
  5.  This article will describe the author's implementation of the  Kermit
  6. file  transfer protocol for the PDP-11 series under RSTS/E, RSX11M/M+,
  7. P/OS RT11 and TSX+.  This protocol allows many (if not most) types  of
  8. computer  systems to effect, at minimum, error free file transfer with
  9. other systems and microcomputers over asynchronous lines.
  10. The  first  obvious  use  of  any  program  or  protocol  designed  to
  11. accomplish  file  transfer  is  to  be  able to provide the ability to
  12. support file uploads and downloads from superminis such as the VAX and
  13. PDP-11  to  remote  personal  computers,  such  as the PC and Rainbow.
  14. Additionally, there is a need  to  provide  at  least  basic  terminal
  15. emulation.   This  can  be  done  several  ways;  a Kermit program can
  16. provide a simple 'glass' tty mode, or in  the  case  of  a  PC,  might
  17. provide  an  intelligent  terminal  emulation,  most likely to be of a
  18. VT100 series terminal  such  as  MacKermit  provides.   Some  mode  of
  19. terminal  emulation  is  generally  required  since  the file transfer
  20. operation of Kermit requires two Kermits to be  running;  one  on  the
  21. LOCAL  system  (your  PC,  Rainbow,  ...),  and one on the HOST (often
  22. called the REMOTE system) system.  Obviously, the simplest  method  of
  23. achieving  this  is to use Kermit on the local system as a terminal to
  24. log into the remote system and then invoke the host's Kermit program.
  25. The first step one usually takes in starting a Kermit  session  is  to
  26. establish  the  connection  between  the  two  systems.   When  we are
  27. connecting two single user systems,  such  as  a  Rainbow  to  another
  28. Rainbow,  we  would  simply connect the COM ports together with a NULL
  29. modem cable and then invoke Kermit on each  system.   One  would  most
  30. often  set  one  of  the PC's up as a Kermit 'server'; this allows the
  31. other system to control the server and initiate file transfer requests
  32. without the need to move between the two machines.
  33. If we are on our  Rainbow  and  we  wish  to  transfer  files  from  a
  34. multiuser  host,  such  as  a  VAX  or  PDP-11,  we would first make a
  35. connection to the host with a modem or direct line.  Once the physical
  36. link  has  been  made,  we would log into the remote system and invoke
  37. Kermit on that system and run it as a server.  This is often  done  by
  38. typing 'KERMIT SERVER' on the host.
  39.                 (slide CONNECT1 goes here)
  40. Note that the micro-computer Kermits assume the use of the systems COM
  41. port  for  communications.   When a larger system, such as a PDP-11 or
  42. VAX, is used to connect to a remote system, the  Kermit  program  must
  43. usually  be  told  which  terminal  line to use.  For example, using a
  44. PDP-11 to dial out to a remote  system  would  require  the  SET  LINE
  45.                                                                 Page 2
  46. command,  where  the line given is the name of a terminal device, such
  47. as TT27:  or TXA0:.  When this is done, there may be a need to control
  48. some of the modem signals, most likely DTR (Data Terminal Ready).
  49.                 (slide CONNECT2 goes Here)
  50. Basic Kermit commands
  51. Now that we have established the physical link, how do  we  get  files
  52. transferred?   Well,  it's  quite  simple.   Assuming that we gave the
  53. remote Kermit the SERVER command, we use:
  54.         Kermit-11>GET file.type         Request a file from the remote
  55.         Kermit-11>SEND file.type        Send a file to the remote system
  56.         Kermit-11>BYE                   Tell the remote Kermit to log out
  57. These are the commands we need when talking to a Kermit server.  There
  58. are, of course, many others which may support file manipulation on the
  59. host, as well as obtaining HELP.  These commands are normally  thought
  60. of  as  REMOTE  commands.   Indeed,  they  are  prefixed by the REMOTE
  61. keyword, as in:
  62.         Kermit-11>REMOTE HELP
  63.         Kermit-11>REMOTE COPY FILE1.TYP FILE2.TYP
  64.         Kermit-11>REMOTE CWD [USERFILES]
  65. Before continuing, note that not all  Kermit  programs  implement  the
  66. same  level of support.  In general, the large system Kermits, such as
  67. Kermit-32 (VMS), Kermit-20 (Tops-20) and Kermit-11  (PDP-11  and  PRO)
  68. support  a large command set.  No single command is really required by
  69. Kermit; the protocol specifies the transportation of  files,  not  the
  70. command  interface.   At a minimum, however, a Kermit program requires
  71. the SEND and RECEIVE commands to effect file transfer.  Server support
  72. is  optional,  if  we don't have server support available then we must
  73. use the SEND and RECEIVE commands and tell each Kermit such every time
  74. we want to move a file.
  75. What do we use Kermit for?
  76. I routinely use Kermit for transferring  software  developed  for  the
  77. PRO/350 on a RSTS/E 11/23+ host as well as using the PDP-11/44 and VAX
  78. 11/785 I run at the University of Toledo  for  dialing  out  to  other
  79. systems,  such  as  the  LCG  Tops 20 system and the LDP public domain
  80. library.  Considering that there exists a Kermit for  almost  any  DEC
  81. configuration  one  can even use Kermit as a poor man's Decnet.  In my
  82. case, I have a DMF32 modem port from the 11/785 and a DZ11  port  from
  83. the 11/44 connected to the Gandalf PACX front end switch, which allows
  84. me to connect either system to any of the other systems on  the  PACX,
  85. which  includes an IBM 370 compatible system as well as connecting the
  86.                                                                 Page 3
  87. VAX to the PDP-11.
  88. With the knowledge that there  are  Kermit  implementations  for  most
  89. personal computers in use it becomes apparent that the Kermit standard
  90. is well worth looking in to.  A list of versions  running  on  Digital
  91. hardware follows the article.
  92. The Kermit protocol
  93. The Kermit protocol is designed to operate  over  normal  asynchronous
  94. terminal  lines.   All data and commands are transferred with a packet
  95. oriented protocol, basically consisting of a start of packet character
  96. (normally SOH), followed by length, control, data and checksum fields.
  97. Communications is half duplex, in that  for  every  packet  sent,  the
  98. sender  must  wait  for  either  an  acknowledgement packet (ACK) or a
  99. negative acknowledgement packet (NAK).  Transmission is in ascii, with
  100. no requirements needed for the transmission of eight bit characters or
  101. control characters other than the choice of control-A for marking  the
  102. start  of a packet.  All 'control' characters imbedded in the data are
  103. prefixed to convert them to printable characters, the same applying to
  104. eight  bit  characters if required by the characteristics of the line.
  105. Since there are many different implementations of Kermit, the protocol
  106. provides  a  mechanism  by  which  the  capabilities  of two connected
  107. Kermits can be negotiated to allow for differences  in  the  level  of
  108. protocol  support.  Examples of protocol features that not all Kermits
  109. understand include data compression and transfer of file attributes.
  110. How Kermit transfers a file
  111. The means by which Kermit  transfers  a  file  is  quite  simple;  the
  112. protocol includes a START OF HEADER (normally a SOH, control A), after
  113. which follows a LENGTH field, then a SEQUENCE  character  and  a  TYPE
  114. field.   After  this,  the  DATA follows, with a checksum trailing the
  115. data segment.  The checksum can be one of three types, the first being
  116. basically  an  additive  sum wrapped into 6 bits, the second being the
  117. same but 12 bits in size, and the third type  a  CRC  based  checksum.
  118. The sequence number increments for each packet sent, module 64.
  119.         (example slide goes here)
  120.         (checksum1 and Checksum2 files go here, if you feel its needed)
  121.  Rather than to go into more detail about the the Kermit protocol, the
  122. reader  should  consult  the  references  listed  at  the  end of this
  123. article.
  124. The PDP-11 Kermit-11 implementation
  125.  The author's version of Kermit-11 is written in Macro-11 and can  run
  126. on  RSTS/E, RSX11M, RSX11M Plus, P/OS and RT11.  The RSTS and RSX file
  127. system interface is via RMS11 version  2,  while  the  RT11  interface
  128. attempts  to  emulate the RMS11 subsystem.  The choice of Macro-11 for
  129. the implementation language was made for several  reasons,  one  being
  130.                                                                 Page 4
  131. the  availability  of  the  assembler on all systems and another being
  132. speed and compactness of the code.
  133.  RMS11 was used for RSTS/E and RSX to provide a common  i/o  interface
  134. to  the  host  file  system.  Additionally, Bob Denny of Alisa Systems
  135. further extended the RMS interface to support remote file access  over
  136. DECNET    with    Kermit,    allowing    commands    such    as   SEND
  137. NODENAME::[BRIAN.FUBAR]FILE.TYPE and other remote file  accesses  over
  138. DECNET.   RMS11  version  2  also  provides a very simple and powerful
  139. means of doing wildcard searching, file renames and file deletion  via
  140. the  $PARSE,  $SEARCH, $RENAME and $DELETE macros.  Points against RMS
  141. basically amount to it's size, RMS is quite large even  if  overlayed.
  142. This  is  helped by using the segmented RMSRES available on RSTS/E and
  143. RSX11M Plus, though there is no remote file access for RMSRES  in  the
  144. current  release  of  Kermit-11.  The other objection to RMS will come
  145. from RSTS/E users, who are used to using files that normally lack file
  146. attributes.   This  is  overcome  by  the  ability of RMS v2 to create
  147. stream ascii files.
  148. The RSTS/E Kermit, while it does 'run' under RSX emulation,  does  NOT
  149. use  any  RSX  directives  (apart  from  GTSK$S)  to  interface to the
  150. executive, as (one) the RSX directive emulation under RSTS/E is only a
  151. small  subset of 'real' RSX and (two) there is no need to go though an
  152. additional layer of overhead to make RSTS/E map RSX  calls  to  native
  153. calls.   The  'multiple  private  delimiters' feature is used to avoid
  154. losing read pass all (binary)  mode  on  read  timeouts,  as  well  as
  155. setting  the  link  to  '8-bit'  mode to keep the terminal driver from
  156. stripping the high bit from data received.
  157. The RSX11M/M+ and P/OS versions of Kermit-11, like the RSTS/E  and  RT
  158. versions,  receive  eight  bit data assuming no parity is used.  Where
  159. parity is a must, Kermit-11 has to use a prefixing  scheme  for  eight
  160. bit binary data.  Like the RSTS/E version, binary files are created as
  161. FIXED no carriage control files such as used for  task  images.   Note
  162. that  parity  generation  is  done by software in Kermit-11.  The P/OS
  163. version runs under control of DCL.  The  next  release  of  Kermit-11,
  164. which  will  be  3.50, will include support for the PRO TMS (Telephone
  165. Management System) option.
  166.  The RT11 and  TSX+  version  of  Kermit-11  maintains  source  module
  167. compatability  with  the  RSTS/E  and  RSX  versions.  Each version of
  168. Kermit-11 has it's own source file to deal with the operating  system,
  169. for  RSX  it  is  K11M41.MAC,  for  RSTS/E  they  are  K11E80.MAC  and
  170. K1180S.MAC, and for RT11 they are called K11RT*.MAC.  Apart from these
  171. specific files, all other source files are shared.  The RT11 Kermit-11
  172. can use either the version 5.x XL and XC handler for high  throughput,
  173. or  it  can  use multiple terminal service to do all its terminal i/o.
  174. This  second  option  allows  the  use  of  any  interface  supported,
  175. including  the  PDT150  modem  port,  DL/DLV11's  and DZ/DZV11's.  The
  176. drawback is overhead, the RT11 MT service can't sustain  a  rate  much
  177. past  1200  baud  at most.  This is not a problem for Kermit, however,
  178. due to it's half duplex nature and the fact that no packet received is
  179. ever  longer  than  the ring buffer size.  The only problem is in when
  180. Kermit-11 is running  as  a  terminal  emulator  (the  Kermit  CONNECT
  181. command) where the data coming from the remote host can easily overrun
  182. the executive's buffer.  A SET RT11  [NO]FLOW  command  was  added  to
  183.                                                                 Page 5
  184. force  Kermit-11  to send its own flow control to the host via XON and
  185. XOFF.  TSX+ users can connect to CL:  for dialing out, the exact means
  186. is documented in the Kermit-11 users guide.  The disk i/o emulates the
  187. RSTS/E and RSX RMS11 version, and each  executive  directive  has  its
  188. error codes mapped into an unique global error code, with the symbolic
  189. names corresponding to the nearest RMS11 error name.   Wildcarding  is
  190. handled,  of course, by non file-structured access to the directory on
  191. the desired volume, and supports full RT11 wildcard filenames.
  192. Transmission of file attributes
  193. One of the optional features of the Kermit protocol is  the  ATTRIBUTE
  194. packet.   The  attribute  packets  allow a Kermit program to send to a
  195. receiving Kermit information regarding the  file  organization,  size,
  196. cluster/retrieval  size,  protection  and  so  forth.  There is even a
  197. system dependant attribute packet type that can be  used  to  transfer
  198. things  like  the  RMS11  IFAB  (the  RMS/FCS attributes).  One of the
  199. things that two Kermits  exchange  before  any  file  transfer  is  an
  200. information  packet,  this  packet  tells  the  receiving Kermit about
  201. itself.  The last field in this packet, the CAPAS mask,  tells  Kermit
  202. if  the  other  one can process attribute packets.  If two Kermit-11's
  203. are communicating, they will find that each can do so, and the  sender
  204. of  a  file  will then send over attribute packets indicating the need
  205. (or lack of) for binary transmission, based on the file  organization,
  206. filetype  and  protection code (for RSTS/E).  If the sending Kermit-11
  207. is running on RSTS/E, RSX11M/M+ or P/OS it will also send  a  copy  of
  208. the  RMS/FCS attributes so the received file will be identical (to FCS
  209. and/or  RMS)  to  the  copy  on  the  sender's  system.   Since  other
  210. implementations  of  Kermit  may  use  this  special  system attribute
  211. packet,  Kermit-11  always  sends  an  attribute  packet  telling  the
  212. receiver what hardware and operating system it is running on, and thus
  213. will only use such data if they are compatible.  Of course, there will
  214. be  times  when a file may be binary and Kermit-11 can't tell so, many
  215. Kermit's have a SET FILE BINARY and SET FILE ASCII to allow  the  user
  216. to  override  defaults.   Kermit-11 also has a SET FILE AUTO/NOAUTO to
  217. disable it from trying to determine a file's binary status.
  218. Future directions
  219. With  the  advent  of   packet   switched   networks   and   satellite
  220. communications the Kermit protocol will likely be extended to increase
  221. efficiency over such links.  The  main  problem  is  the  half  duplex
  222. nature  of  Kermit, the packet acknowledgements can take up to several
  223. seconds in transit thus drastically reducing  the  throughput.   There
  224. are  several  possibilities  under discussion and a standard should be
  225. appearing shortly.
  226.                                                                 Page 6
  227. Summary
  228.  There are currently over 200  implementations  of  Kermit  available.
  229.  This  article describes only the PDP-11 Kermit-11 implementation, for
  230. further reading see:
  231. Kermit: A File-transfer Protocol for Universities 
  232. Frank da Cruz and Bill Catchings
  233. BYTE Magazine, June/July 1984
  234. The Kermit Protocol Manual, version 5
  235. Frank da Cruz   April 1984
  236. Columbia University Center for Computing Activities
  237.         (slide GETKERMIT should be here)
  238. Digital hardware that Kermit is currently available for:
  239.                  Operating  Program   
  240. Machine          System     Language     Contributor
  241.      
  242. DEC PDP-11       MUMPS-11   MUMPS-1982   Cornell U
  243. DEC PDP-11       RSTS/E     Macro-11     U of Toledo
  244. DEC PDP-11       RSX-11/M   Macro-11     U of Toledo
  245. DEC PDP-11       RSX-11/M+  Macro-11     U of Toledo
  246. DEC PDP-11       RT-11      Macro-11     U of Toledo
  247. DEC PDP-11       RT-11      OMSI Pascal  U of Toronto
  248. DEC PDP-11       TSX+       Macro-11     U of Toledo
  249. DEC PDP-11       Unix 2xBSD C            Columbia U
  250. DEC PDP-11, ...  Unix V7    C            Columbia U
  251. DEC PDP-8        OS8, RTS8  PAL-8        R. Hippe
  252. DEC Pro-3xx      P/OS       Bliss, Macro Stevens I.T.
  253. DEC Pro-3xx      P/OS       Macro-11     U of Toledo
  254. DEC Pro-3xx      Pro/RT     Macro-11     U of Toledo
  255. DEC Pro-3xx      Venix V1   C            Columbia U
  256. DEC Pro-3xx      Venix V2   C            Columbia U
  257. DEC Rainbow      CPM86      ASM86        Columbia U
  258. DEC Rainbow      MS-DOS     MASM         Columbia U
  259. DEC Rainbow      QNX 1.x    C            Merrell-Dow
  260. DEC VAX          Ultrix-32  C            Columbia U
  261. DEC VAX          VMS        Bliss,Macro  Stevens I.T.
  262. DEC VAX          VMS        C (VAX-11 C) Columbia U
  263. DEC VAX          VMS        Pascal       U of Toronto
  264. DEC VAX, ...     Unix 4xBSD C            Columbia U
  265. DEC VT-180 Robin CPM80      Turbo Pascal Jeff Duncan
  266. DEC VT-180 Robin CPM80 2.2  M80,LASM     ACC
  267.                                                                 Page 7
  268. DECmate-II,III   CPM80 2.2  M80,LASM     ACC
  269. DECsystem-10     TOPS-10    Bliss, Macro Stevens I.T.
  270. DECSYSTEM-20     TOPS-20    MACRO-20     Columbia U
  271.      
  272.