Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site yetti.UUCP Path: utzoo!utcs!mnetor!yetti!oz From: oz@yetti.UUCP (Ozan Yigit) Newsgroups: net.micro Subject: Kermit protocol in a nutshell (troff -me) Message-ID: <189@yetti.UUCP> Date: Thu, 30-May-85 14:00:56 EDT Article-I.D.: yetti.189 Posted: Thu May 30 14:00:56 1985 Date-Received: Thu, 30-May-85 17:42:15 EDT Reply-To: oz@yetti.UUCP (Ozan Yigit) Organization: York University Computer Science Lines: 151 Keywords: kermit, comm-protocols Following is a one page document describing the kermit protocol. It is in troff -me format. This was used in a class to compare available communication protocols for micros. Oz (all wizardesque side effects are totally unintentional, unless stated otherwise..) Usenet: {decvax|ihnp4|linus|allegra}!utzoo!yetti!oz Bitnet: oz@yuleo | oz@yuyetti -------------------------- .m1 2v .m4 2v .po 9 .ps 18 .nf KERMIT Protocol .ps 10 \fBCreators: \fIFrank Da Cruz\fR \fIBill Catchings\fR \fIColumbia University\fR .sp \fBProtocol:\fR .sp [MARK] [LEN] [SEQ] [TYPE] [DATA] [...] [CHKS] .sp [MARK] = SOH by default [LEN] = 1 char contents length, 0 to 94. [SEQ] = 1 char packet sequence number [TYPE] = 1 char packet type (see below) [DATA] = 7-bit data characters (see below) [CHKS] = 1 or 2 bytes checksum (see below) .sp .2c .ps 7 .vs 9 \fBPacket description\fR .sp .nf .na \fB[MARK]\fR Start-of-packet character, normally SOH (control-A). .sp \fB[LEN]\fR The number of characters, including prefix characters and checksum. Must be between 0 - 94 inclusive. 96 is the maximum packet length, including [MARK] and [LEN]. .sp \fB[SEQ]\fR The packet sequence number between 0 and 63. The sequence number wraps around after transmission of 64 packets. .sp \fB[TYPE]\fR The packet type, a single printable ascii character. One of the following .sp D data Y Acknowledge (ACK) N Negative acknowledge (NAK) S Send-initiate R Receive initiate B Break transmission (EOT) F File header Z End of file (EOF) E Error .sp G Generic command: single character in data field, with possible operands requesting host-independent remote execution of specified command .sp L Log out, bye F Finish, don't logout D Directory query U Disk usage query E Erase file T Type file Q Server status query .sp C Host command. Data field contains a command string to be executed by the host. .sp X Text display header. Contents of the data field is a result of a generic or host command, to be displayed on the screen .sp \fB[DATA]\fR The contents of the packet. Interpreted according to the packet type. Non-printable ascii characters are prefixed. A prefixed sequence of characters may not be broken across packets. .sp \fB[CHKS]\fR Block check sequence, based on all characters between the [MARK] and [CHKS]. Can be one, two or three characters. Normally, single character checksum. .sp .nr pp 7 \fBData encoding\fR .sp .ip \(bu \fBControl characters\fR .br Kermit only uses the printable portion of the ASCII character set. Any control character is transformed into a printable character by complementing the seventh bit and prefixing with a special prefix character (\fB#\fR). Thus, \fBA\fR becomes \fB#A\fR. The prefix character is also used to prefix itself or other prefix characters. .ip \(bu \fB8-bit characters\fR .br Kermit uses another prefix character (\fB&\fR) to indicate the status of the eight-bit (parity). If the low-order seven bits coincide with a control character, the control-character prefixing is used. Thus, binary \fB10000001\fR becomes \fB&#A\fR. This prefixing is employed only when necessary. If both sides have control over the hardware for 8-bit transmission, the parity bit prefixing is not used. .ip \(bu \fBData compression\fR .br Where possible, Kermit uses a run-length encoding for data compression. Another prefix character (\fB~\fR) is used to indicate that the next character is a repeat count for the character following it. Thus, \fB~}#A\fR indicates a series of \fB93 A\fRs. .sp .lp .sp \fBChecksum and CRC\fR .sp Kermit usually uses a single-character checksum, by adding all characters between the start-of-header [MARK] and itself. In the worst case, this is a 14-bit number. It is converted to a single character by the following formula: .sp (sum + ((sum AND 0300) / 0100)) AND 077 .sp Kermit may also use a two-character checksum, by simply breaking the low order 12 bits into two printable characters. A 3-character CRC checking is also available, depending on the level of error detection needed. .sp 3 \fBReferences:\fR .sp [1] F. De Cruz, B. Catchings, \fBKERMIT: A file transfer protocol for Universities, PART 1: Design Considerations and Specifications\fR, \fIBYTE Magazine\fR, Vol. 8, No. 6, June 1984. .sp [2] F. De Cruz, B. Catchings, \fBKERMIT: A file transfer protocol for Universities, PART 2: States and Transitions, Heuristic Rules, and Examples\fR, \fIBYTE Magazine\fR, Vol. 8, No. 7, July 1984. .1c