KERMIT (1) 6/7/84 KERMIT (1) NAME KERMIT - reliable file transfer over terminal connection SYNOPSIS kermit [ifd] kermit r[ifd] kermit s[ifd] [file [-as remote_name]]... DESCRIPTION Kermit provides reliable file transfer between machines. It has been implemented on many different computers, including many microprocessors (see below). The files transferred may be arbitrary ASCII data (full 7-bit characters) and may be of any length. This kermit implementation is capable of transmitting binary data as well (8-bit bytes), even over a 7-bit communication link. (To use this, the other kermit program must also have this capability.) Files are sent in small (96 character) checksummed packets. This version of kermit does not include terminal emulation. (In fact, good terminal emulation is not possible from the HP 3000.) Therefore, this kermit assumes it is running on the remote computer (ie. NOT the machine to which your terminal is attached). Standard input and output is used for all packet transmissions. Kermit has three modes: Send, Receive and Server. Kermit invoked without arguments comes up in server mode: it is ready to receive or send files on command from another kermit, i.e., the kermit running on the user's local machine. The 'r' flag places kermit in Receive mode which is a subset of Server mode; it is included only for compatability with older versions. The 's' flag places kermit in Send mode: this flag must be followed by the names of the file(s) to be sent to the other kermit. Each filename in a Send command may be followed by an optional flag '-as' which must then be followed by the filename which will be sent with the file to the other kermit. In Server or Receive modes, the 'f' flag suppresses conversion of incoming filenames as described below. In all states, the 'i' flag ("image mode") specifies that all files are to be treated as binary files. When receiving files with the 'i' flag turned on, new files are created as fixed record binary files. When sending binary files (or when the 'i' flag is on), only the file contents will be sent; no indication of end-of-record is sent. Thus, information will be lost if variable-record binary files are sent. -1- KERMIT (1) 6/7/84 KERMIT (1) Adding 'd' flags (debug) makes kermit progressively more verbose. Up to three d's may be used. The states kermit goes through are printed along with other traces of it's operation. For debugging a remote kermit, this information may be saved in a file by redirecting the error output. For instance, kermit dd ?logfile will save the diagnostic output in the file 'logfile'. To view such log files (which may contain control characters), it is most informative to use show(1) or ed(1) with the 'l' command. The file transfer protocol uses small (96 character) checksummed packets, with ACK/NACK responses and timeouts. This Kermit uses a ten second timeout and five retries. When using kermit as a remote server, kermit may be exited by typing an interrupt (^Y on the HP 3000) or an end-of-file (^D and return on the HP 3000). The server 'finish' command (sent from the local kermit) has the same effect. When receiving files, kermit deletes any files which are not complete (due to some error or interruption of the transfer). FILENAMES When receiving a file, kermit will first attempt to store the file with the same name that was used to send it. If that is not possible and the 'f' flag was not given, Kermit makes whatever name translations are necessary to make this name legal. (The HP3000 kermit must compress names into 8 alphanumeric characters with no extension.) If a file by that name already exists, kermit simply overwrites it, and no error message is given. (Kermit on the HP 3000 may be run with "-environ noclobber" at the end of the command line to avoid this. In this case, appending ":clob" to the filename overrides this protection.) In Send mode, Kermit will change the name to the "normal form" for sending: directory specifications are stripped off, and a name of the form NAME.EXT is sent. The extension .EXT is optional, and both parts are contain only letters and digits and are capitalized. (The HP3000 kermit does not send an extension.) The "-as name" construction may be used to send files with names that are different from the names on the originating system; 'name' is NOT changed to normal form. When sending files to the HP3000 kermit, it is possible -2- KERMIT (1) 6/7/84 KERMIT (1) to use the full Software Tools filename syntax. A few useful examples: name:fix80 create an 80-char fixed record file name:dev=lp print the file on the HP3000 lineprinter name:code=prog create an HP3000 program file (binary) name:disc=8000 create a large file (8000 => ~10 Mbyes) EXAMPLE For this example we will assume that we are calling the HP 3000 from a Unix system, i.e., a Unix system is our local system. (In many cases, a PC may be the local system.) Assume we are logged onto "Local" (the local machine), and want to communicate with "Remote" (the HP 3000). We first want to connect to "Remote". On "Local", we type: % kermit xlb /dev/tty4 9600 [Local] C-Kermit> c to set up the connection (using the Unix kermit's 'connect' mode for terminal emulation, and assuming that there is a 9600 baud connection on tty4 to the 3000). (Note that '%' is the Unix prompt, '[Local] C-Kermit' is the local Kermit's prompt.) "Local"s kermit answers: [Local] C-Kermit: connected... type ^]c to return to Local and we are talking to "Remote". We hit RETURN, get a login prompt from "Remote" and login. :hello user.tools (MPE login message...) Now we start the kermit server on the remote machine: Remember that we are talking to "Remote" right now. We type: :run kermit.pub.tools [Remote] ST Kermit: Software Tools Kermit (HP 3000) [Remote] ST Kermit Server Mode and there is now a Server kermit on "Remote" We type "^]c" to return to the Local Kermit and come back to the Local prompt. Kermit answers: [Local] C-Kermit: returned. Line is still open. We are now ready to send and receive files. To get files from the other side, we may type: [Local] C-Kermit> g data.user.tools junk.pub.acct [Local] C-Kermit: Saving DATA as data [Local] C-Kermit: Saving JUNK as junk -3- KERMIT (1) 6/7/84 KERMIT (1) [Local] C-Kermit: Done. We may send files with the send command: [Local] C-Kermit> s data.dat file1 -as file.user [Local] C-Kermit: Sending data.dat as DATA.DAT [Local] C-Kermit: Sending file1 as FILE.USER [Local] C-Kermit: Done. After each command, Kermit will type either "Send complete", or "Send failed", depending on the success of the transfer. After all the transfers were done, we should connect again, log off of Remote and leave the Local Kermit. Details on other implementations and on the protocol is given in the Kermit Users Guide, and the Kermit Protocol Manual. FLOW CONTROL The KERMIT Protocol uses only printing ASCII characters (decimal 32-126) and Ctrl-A. The communications channel between kermits must not change or swallow any of these characters. CR is used as the default line-terminator character, though that may be renegotiated by the protocol. Ctrl-S/Ctrl-Q (XOFF/XON) flow control can be used "underneath" the Kermit protocol if the operating system supports it. The HP3000 kermit makes use of XON/XOFF handshaking by sending Ctrl-S at the appropriate times (after sending out a packet). The 3000 tty driver sends the Ctrl-Q when it is ready for more data. This will work if the other machine's operating system recognizes XOFF/XON. (This is the case for TOPS-20 and Unix System III and V.) If it does not, the local kermit should wait for the XON character before sending each packet. The Unix Kermit (the version distributed with the 3000 version) does this if the 'x' flag is given. Many micros' kermits recognize a 'SET IBM' or 'SET HANDSHAKE XON' command which accomplishes the same thing. The 3000 kermit should NOT be given the 'x' flag unless it is talking to another machine that sends out XONs, i.e., an IBM 370. If it is not possible for the other kermit to do this, packets sent to the 3000 kermit may be missed if they are sent before the 3000 is ready (and isssues the prompt character XON). This may occur when the 3000 loading is high; it is characterized by multiple packet timeouts, and possibly, a "Send failed" message from the local kermit. A partial solution is to have the 3000 kermit ask the local kermit to send 'padding' before sending a packet. -4- KERMIT (1) 6/7/84 KERMIT (1) This may be done by using the '-pad N' flag, where N may be from 0 to 94. If a packet is missed, a timeout occurs and the packet will be retransmitted, so file transfer should proceed, but if every packet needs to be transmitted more than once, file transfer will become exceedingly slow. Running the local kermit with debugging on will allow monitoring this situation. This kermit has timeouts, so the protocol is stable when communicating with "dumb" kermits (that don't have timeouts) as long as they can wait for XON. Even with non-XON kermits, it will usually be stable. OTHER IMPLEMENTATIONS Kermits have been written for TOPS-20, TOPS-10, IBM VM/CMS, Unix, VAX/VMS, RT-11, MS-DOS, CP/M, and Apple DOS. More information is given on page 45 of the Kermit Users Guide. The Software Tools kermit runs on the Univac 1100 and the HP 3000, and should be portable to nearly any other system that supports the Software Tools package. ENVIRONMENT VARIABLES The ST environment variable 'kermitheader' sets the prefix to kermit's message banner. It defaults to 'ST '. See env(3:HP3000) for more information on environment variables. SEE ALSO Kermit User Guide, Fifth Edition (2 March 1984), Frank da Cruz, Columbia University Center for Computing Activities, New York, New York, 10027 (usemandf.kermit.tools on the HP 3000) Kermit Protocol Manual, Fifth Edition (30 March 1984), Frank da Cruz, Columbia University Center for Computing Activities, New York, New York, 10027 (promandf.kermit.tools on the HP 3000) AUTHORS KERMIT kernel by Bill Catchings, Columbia University Center for Computing Activities KERMIT-Unix adaptation by Chris Maio and Bob Cattani, Columbia University Computer Science Dept. Translation from C into Software Tools Ratfor on the Univac 1100 by Kendall Tidwell and Allen Cole, University of Utah, Computer Center. Fixes, enhancements and port to the HP 3000 by Ken Poulton. -5- KERMIT (1) 6/7/84 KERMIT (1) DIAGNOSTICS Cant open filename sent to the local kermit (as an error packet) when that condition occurs. BUGS/DEFICIENCIES Use of terminal type 13 may (according to HP) crash a Series 33. If you have a Series 33, alter the TERMTYPE definition in kermitde.src to use terminal type 4 and recompile it using maknew.scripts. When receiving files of more than ~ 1 Mbyte, the sending kermit is likely to time out while the 3000 kermit extends the file. This may be gotten around by sending the file with a 'disc' specification appended to the name. For example, "file1:disc=8000" is good for ~10 Mbytes. -6-