Kermit Transfer Reference
Kermit is the survivor protocol — designed for links that lose, mangle, or 7-bit-strip bytes, and the one to reach for when XMODEM/ZMODEM won't go through.
Kermit (Frank da Cruz & Bill Catchings, Columbia University, 1981)
moves files as small, fully printable packets with an
aggressively negotiated feature set. Everything that could trip up a
hostile transport is quoted into the printable ASCII range, so a Kermit
transfer survives 7-bit gateways, XON/XOFF flow control, and terminal
servers that eat control characters — conditions that defeat the
XMODEM family and ZMODEM. The gateway implements a spec-complete Kermit
(following da Cruz & Catchings, Kermit, A File Transfer
Protocol, 1987) plus the modern long-packet, sliding-window, and
streaming extensions used by C-Kermit, in src/kermit.rs.
The gateway is both a Kermit client (push/pull from the
File Transfer menu) and a Kermit server (idle, answering
a peer's GET / SEND / directory commands). This
page walks the transfer mechanics — how a session
negotiates and how data moves, for uploads and downloads.
Every byte on the wire belongs to a packet, and every packet is printable.
MARK LEN SEQ TYPE DATA ... CHECK
01 ' '.. 0-63 S/F/A/D/Z/B/Y/N/... 1-3 bytes
| Field | Bytes | Meaning |
|---|---|---|
MARK | 1 | Start-of-packet sentinel, normally 0x01 (Ctrl-A). |
LEN | 1 | Length of the rest of the packet, tochar-encoded (value + 0x20). A LEN of zero signals a long packet whose real length follows in two extended bytes. |
SEQ | 1 | Sequence number 0–63 (mod 64), tochar-encoded. Drives ACK matching and sliding windows. |
TYPE | 1 | A single letter naming the packet (table below). |
DATA | 0–n | The payload, with control / 8-bit / repeated bytes quoted into printable form. |
CHECK | 1–3 | Block check: 1 byte (6-bit sum), 2 bytes (12-bit sum), or 3 bytes (CRC-16) per the negotiated CHKT. |
The packet types used in a transfer:
| Type | Name | Meaning |
|---|---|---|
S | Send-Init | Opens a session; its data field is the parameter list. |
F | File header | Announces the next file's name. |
A | Attributes | Optional: size, modification time, mode, type. |
D | Data | A chunk of file data. |
Z | EOF | End of the current file. |
B | EOT (Break) | End of the whole batch — no more files. |
Y | ACK | Packet accepted (carries negotiated params when acking an S). |
N | NAK | Packet missing or bad — resend it. |
E | Error | Fatal error; the data field is a human-readable reason. |
(R get-request, G generic and C
host commands, and I init drive server mode
— see the full reference.)
Before any data, the two ends trade an S packet and agree on a working feature set.
A Kermit session opens with a Send-Init (S)
packet whose data field is a string of tochar-encoded
parameters. The other end answers with a Y (ACK) packet
carrying its parameters, and each side then adopts the safe
common subset — the smaller packet length, the lower window size,
the intersection of the capability bits. The key fields:
| Field | Meaning | Gateway default |
|---|---|---|
MAXL | Maximum packet length (classic, ≤ 94) | extended via long packets |
TIME | Timeout the peer should use | — |
QCTL | Control-character quote prefix | # |
QBIN | 8th-bit quote prefix (for 7-bit links) | & (when asked) |
CHKT | Block-check type (1 / 2 / 3) | 3 (CRC-16) |
REPT | Repeat-count compression prefix | ~ |
CAPAS | Capability bitmask (long / sliding / attributes) | all advertised |
WINDO | Sliding-window size | 4 |
MAXLX1/2 | Extended (long) max packet length | up to 4096 |
| CHKT | Check | Notes |
|---|---|---|
1 | 6-bit checksum (1 byte) | The universal baseline; weakest. |
2 | 12-bit checksum (2 bytes) | Middle ground for slow microcontrollers. |
3 | CRC-16/KERMIT (3 bytes) | Reflected CCITT, poly 0x8408. The default. |
#): a control byte is sent as # followed by the byte with bit 6 flipped, so it prints.&): on a 7-bit link, a high-bit byte is sent as & plus its low 7 bits — this is what makes Kermit 8-bit-clean over a 7-bit path.~): a run of identical bytes is collapsed to ~, a count, and the byte — cheap compression for padding and sparse files.You send a file to the gateway with Kermit. The remote end initiates; the gateway answers and consumes the file.
term -> S (Send-Init: peer's params)
gateway <- Y (ACK: gateway's params -> common subset)
term -> F (filename) gateway -> Y
term -> A (size, mtime, mode) gateway -> Y (optional)
term -> D (data) x N gateway -> Y each (or windowed)
term -> Z (EOF) gateway -> Y
term -> B (EOT, no more files)gateway -> Y
SEND to it.S (Send-Init) with its parameters. The gateway replies with a Y (ACK) carrying its own params; both sides settle on the common subset (block-check type, packet length, window size, capabilities).F packet with the filename; the gateway validates the path (no traversal) and ACKs.A packet (size, modification time, mode); the gateway records it and ACKs.D (data) packets. The gateway un-quotes each (# / & / ~), verifies the block check, and ACKs — or, with sliding windows, acknowledges several outstanding packets at once and asks for selective retransmit of any that are missing or bad. A corrupt or timed-out packet is NAK'd to re-prompt the sender; after kermit_max_retries consecutive failures the gateway sends an E (Error) packet and aborts.Z (EOF); the gateway closes the file, applying mtime / mode from the A packet when present.B (EOT) to end the batch; the gateway ACKs and the session ends. (More F…Z groups before the B mean more files.)You pull a file from the gateway with Kermit. The gateway initiates the Send-Init and pushes the file.
gateway -> S (Send-Init: gateway's params)
term <- Y (ACK: peer's params -> common subset)
gateway -> F (filename) term -> Y
gateway -> A (size, mtime, mode) term -> Y (if attributes negotiated)
gateway -> D (data) x N term -> Y each (or windowed/streamed)
gateway -> Z (EOF) term -> Y
gateway -> B (EOT) term -> Y
GET and the gateway sends in response — same data flow.)S (Send-Init) advertising its parameters and capabilities. The receiver ACKs with its own; the gateway adopts the common subset.F packet with the filename, then — if attributes were negotiated — an A packet with the size, mtime, and mode.D (data) packets, quoting bytes as the negotiated QCTL / QBIN / REPT require. On a reliable link with streaming negotiated it does not pause for per-packet ACKs; otherwise it waits for each Y (or keeps a sliding window of them in flight).kermit_max_retries times. If it still can't get a packet through, it sends an E (Error) packet so your terminal stops cleanly instead of waiting out its own timeout.Z (EOF), then B (EOT) once the last file is done. The receiver ACKs and the session ends.What the gateway advertises in its Send-Init — each used only if the peer also offers it.
| Capability | Effect |
|---|---|
| Long packets | Packets up to kermit_max_packet_length (default 4096, max 9024) instead of the classic 94-byte cap — far less per-packet overhead. |
| Sliding windows | Up to kermit_window_size (default 4; max 31) packets in flight at once, with selective retransmit — hides round-trip latency. |
| Streaming | On a reliable link (TCP / SSH) the sender skips per-packet ACKs entirely — a big speed win. |
| Attribute packets | Carry file size, mtime, mode, type, and ~10 other typed fields so metadata survives the transfer. |
| Repeat compression | Runs of identical bytes collapse to the ~ prefix + count. |
| Locking shifts | SO/SI region quoting for 8-bit transit on 7-bit links (off by default; per-byte & prefixing covers the same need). |
| RESEND (resume) | Resume a partial upload via attribute disposition (off by default; see the full reference). |
The core transfer keys. The full kermit_* family (18 keys, including the quoting and server-mode settings) is documented on the full reference.
| Key | Default | Meaning |
|---|---|---|
kermit_negotiation_timeout | 300 s | Time to complete the Send-Init handshake. |
kermit_packet_timeout | 10 s | Per-packet read deadline after Send-Init. |
kermit_max_retries | 5 | NAK / timeout retransmits per packet. |
kermit_max_packet_length | 4096 | Advertised long-packet length (10–9024). |
kermit_window_size | 4 | Sliding-window depth (1–31; 1 = stop-and-wait). |
kermit_block_check_type | 3 | 1 = 6-bit, 2 = 12-bit, 3 = CRC-16/KERMIT. |
Deep-dive reference pages for every protocol and interface, plus the character-set tables and ANSI escape-sequence reference.
128-byte blocks; CRC-16 / checksum negotiation.
Block-0 metadata, batch, exact size truncation.
Streaming; ZDLE, CRC-32, autostart, resume.
Send-Init negotiation; F / A / D / Z / B transfer.
C1 dual checksum, two-phase, GOO/BAD/ACK.
Hayes command set, S-registers, +++ escape.
IAC negotiation, every option, the NVT data phase.
Server, gateway, host keys, TOFU, auth modes.
Hex tables for every encoding: ASCII, ANSI, PETSCII, ATASCII, Baudot/ITA2, ZX Spectrum, TRS-80.
Cursor, colour/SGR, erase, and screen-mode escape codes, with the raw hex bytes.