Everything needed to build an interoperable VARA HF modem
2026-11-27
This document specifies the VARA HF protocol (version 4.9.x; checked against 4.9.0) completely enough to build an interoperable modem from scratch: the shared pseudo-random tables, control frames, data frames, forward error correction, the three waveform families, text compression, the ARQ session protocol, CQ frames and the host TCP interface.
Numbers in code are exact constants. “Rnd” and
“Randomize” refer to the generator of §3. Values marked
(unconfirmed) are believed correct but not yet confirmed.
backoff(u) = u + 2 + (10 - u) / 5gain = 10^((d - backoff(u)) / 20)backoff(3) = 6.4 dB and
backoff(6) = 8.8 dB; at -5 dB the control gains are
0.2692 (F0, F1) and 0.2042 (F2), so a control
frame peaks at 0.381 (one tone) or at most 0.408 (two tones) of full
scale; at 0 dB, 0.677 and 0.726. At -5 dB the highest-peak data level
(2300 L16) peaks at about 0.76 of full scale
(unconfirmed).Every table and codebook comes from one generator that behaves
exactly like Visual Basic 6’s Rnd and
Randomize. Single precision matters: several states round
differently in double precision.
0x050000.state = (state × 0xFD43FD + 0xC39EC3) mod 2^24.state / 2^24, computed and returned as a 32-bit
float.Rnd(x), x < 0:
bits = float32_bits(x);
state = (bits + (bits >> 24)) & 0xFFFFFF; then
step. x > 0 steps. (x = 0 would return the last
value without stepping; the protocol never uses it.)
Rnd(-1) always leaves the state at
0x395886.Randomize(d): hi = the upper 32 bits of
the IEEE double d;
mix = ((hi & 0xFFFF) XOR (hi >> 16)) & 0xFFFF;
state = (state & 0xFF0000FF) | (mix << 8).draw(m) = floor(Rnd() × m) with the
product rounded to float32 before the floor; rand_int(n) =
draw(n + 1).seeded(s):
Rnd(-1) then Randomize(s).seed_rnd(x):
Rnd(-1); Randomize(x mod 32768); then step
floor(x / 32768) + 1 times.Both stations use identical tables. Each is defined below by the generator stream that produces it. (The reference implementation computes the whitening, PSK phase and lead-in tables at start-up and ships the data table and the per-level record tables as data files; their contents are exactly the streams defined here.)
seeded(292); 150 000 values rand_int(1) (0
or 1). XORed onto the frame bits from index 0 for every frame.
A phase index counts 128ths of a turn; the phasor is
e^(j·2π·idx/128) (2π taken as
6.28318530717958). An index of 128 gives the same phasor as
0, so a table of indices may store either.
seeded(292) stream; for the symbol span 0..411 then
411..471: for each carrier, for each symbol in the span:
rand_int(128).seeded(292) stream; 65
000 values rand_int(128) (0..128, 128 kept).One seeded(43) stream per bandwidth, consumed level by
level for all 17 rows of the bandwidth’s table (rows past the ladder
included, so the streams line up). Per level, in order:
v = draw(n), keep v if not seen,
until all n values are taken.symbols - 1 entries):
first + (1 if step > 1 and i even) + step × draw(choices),
with choices = bins/step + 1 if step > 1 else
bins (bins = last - first + 1). Then 24
pilot rows:
inc = float32((symbols - 2) / 24), acc = 1.0f;
per pilot acc += inc; row = int(acc). Then a pilot value
per pilot, in row order: (2^bps / 8) × draw(8), placed at
symbol row - 2. Stored as: hop bases, the 24 rows, then a
(flag, value) pair per data symbol.markers
distinct symbol positions: non-QAM 5 + draw(spf - 8); QAM
3 + (first + c) mod 2 + 8 × draw((spf - 3) / 8) (on the
carrier’s pilot parity). Stored as all positions, then per carrier a 0/1
map of spf - 1 symbols (position v sets index
v - 2).Stored form, where an implementation keeps the tables in a file:
every value as a 16-bit big-endian word, levels in order, followed by
the CRC of §5 computed over all table bytes except the last one. The
stored CRCs are 0x1B72 (500 Hz), 0xFBAC (2300
Hz) and 0x3DB1 (2750 Hz).
0x1021,
initial 0xFFFF, MSB first, result inverted. Check value
"123456789" → 0xD64E. Frames carry it
big-endian.-) is 1–7 characters of A–Z and 0–9, and the suffix is
absent, - plus one or two digits (value 1–19), or
-T, -R, -X or -L.
Before checking, an 8-character callsign without - that
ends in T, R, X or L is rewritten with that letter as its SSID
(N0CALLXR becomes N0CALLX-R; for the station’s
own callsigns and the called station). A station has up to five
callsigns.T 16,
R 17, X 18, L 19; numeric SSIDs
16–19 pack as the same codes as T, R, X, L. No other character or SSID
can occur, because such callsigns are refused.& 0x1F: 0 none, 16–19
-T/-R/-X/-L, otherwise - and the number. A
leading-zero SSID (-05) packs as 5 but hashes differently
from -5 (effect on a session unconfirmed).Control frames carry all session signalling: connect requests and replies, acknowledgements, turn changes, disconnects, CQ and KISS announcements.
sample[n] = (2 / norm) × Σ_tones sin(2π·k·n/2048)
(norm = √2 for one tone, 2 for two), n restarting at 0 every
symbol; then the gain of §2 and the ±1.0 clip.nsym - 1 symbols), then 25
silent symbols and one further silent block as the transmission
ends.Lead-in length: ceil(lead_ms / (2048/48 ms)) + extra.
The long lead is used for GO AHEAD, NO TRAFFIC, BREAK and IDLE, the
short one otherwise. extra applies only to the first
transmission after a session reset (performed at the end of a session
and when a call is started): 9 when calling (the first connect request),
7 when answering (the first connect reply) unless chat mode or the
tuning-tone option is on, else 0.
| Fmt | Symbols (incl. lead slot) | Tones/symbol | Lead long ms | Lead short ms | Min hits | Decode SNR dB | k dB | Lead-in symbols (long / short) |
|---|---|---|---|---|---|---|---|---|
| F0 | 32 | 1 | 40 | 40 | 19 | -15.5 | 3 | 1 / 1 |
| F1 | 16 | 1 | 80 | 40 | 13 | -7.5 | 3 | 2 / 1 |
| F2 | 8 | 2 | 160 | 40 | 12 | -3.5 | 6 | 4 / 1 |
The minimum hits are out of a maximum of 31, 15 and 14 (format 2
counts each of its 14 tones). Receivers also use a second threshold of
Decode SNR - (9.4 - k) dB (informative).
Lead-in tones: a generator in its program-start state (not seeded)
produces, for F0, F1, F2 in that order, 100 lead-in symbols each: per
symbol ntones distinct bins rand_int(34) + 50
(bins 50–84; a repeated bin is drawn again). A frame uses the first
L symbols of its format’s grid.
| Code | Meaning |
|---|---|
| 1 | ACK, stay at level |
| 2 | NACK (frame lost) |
| 3 | QRT (disconnect, CW ID follows) |
| 4 | unused |
| 5 | ACK, up 2 levels |
| 6 | ACK, down 1 level (stays at level 1) |
| 7 | ACK, up 1 level |
| 8 | ACK, up 3 levels |
| 9 | ACK, up 4 levels |
| 10 | ACK of the second frame only (first lost) |
| 11 | ACK of the first frame only (second lost) |
| 12 | ACK REQUEST (alternating bit 0) |
| 13 | ACK REQUEST (alternating bit 1) |
| 14 | GO AHEAD (turn granted) |
| 15 | CONNECT REPLY, 2300 Hz, first level 1 |
| 16 | CONNECT REPLY, 2300 Hz, first level 2 |
| 17 | CONNECT REPLY, 2300 Hz, first level 3 |
| 18 | CONNECT REPLY, 2300 Hz, first level 4 |
| 19 | NACK, transmission missed (ACK request received) |
| 20 | unused |
| 21 | NO TRAFFIC (answer to IDLE: nothing queued) |
| 22 | CONNECT REPLY, 500 Hz, first level 1 |
| 23 | CONNECT REPLY, 500 Hz, first level 2 |
| 24 | CONNECT REPLY, 500 Hz, first level 3 |
| 25 | CONNECT REPLY, 500 Hz, first level 4 |
| 26 | CONNECT REQUEST, 2300 Hz, alias 0 |
| 27 | CONNECT REQUEST, 2300 Hz, alias 1 |
| 28 | CONNECT REQUEST, 2300 Hz, alias 2 |
| 29 | CONNECT REQUEST, 2300 Hz, alias 3 |
| 30 | CONNECT REQUEST, 2300 Hz, alias 4 |
| 31 | CONNECT REQUEST, 500 Hz, alias 0 |
| 32 | CONNECT REQUEST, 500 Hz, alias 1 |
| 33 | CONNECT REQUEST, 500 Hz, alias 2 |
| 34 | CONNECT REQUEST, 500 Hz, alias 3 |
| 35 | CONNECT REQUEST, 500 Hz, alias 4 |
| 36 | CONNECT REQUEST, 2750 Hz, alias 0 |
| 37 | CONNECT REQUEST, 2750 Hz, alias 1 |
| 38 | CONNECT REQUEST, 2750 Hz, alias 2 |
| 39 | CONNECT REQUEST, 2750 Hz, alias 3 |
| 40 | CONNECT REQUEST, 2750 Hz, alias 4 |
| 41 | CONNECT REPLY, 2750 Hz, first level 1 |
| 42 | CONNECT REPLY, 2750 Hz, first level 2 |
| 43 | CONNECT REPLY, 2750 Hz, first level 3 |
| 44 | CONNECT REPLY, 2750 Hz, first level 4 |
| 45 | KISS / unproto announcement, level 1 |
| 46 | QRT without CW ID |
| 47 | KISS / unproto announcement, level 2 |
| 48 | CQ (callsign frame follows) |
| 49 | BREAK (request the turn / end of received turn) |
| 50 | IDLE (nothing to send) |
| 51 | START LEVEL 1 (BREAK reply: offered level) |
| 52 | START LEVEL 2 (BREAK reply: offered level) |
| 53 | START LEVEL 3 (BREAK reply: offered level) |
| 54 | START LEVEL 4 (BREAK reply: offered level) |
| 55 | START LEVEL 5 (BREAK reply: offered level) |
| 56 | START LEVEL 6 (BREAK reply: offered level) |
| 57 | START LEVEL 7 (BREAK reply: offered level) |
| 58 | KISS / unproto announcement, level 4 |
Code 43 doubles as REJECT and as “2750 Hz connect reply, level 3”
(2750 replies are 40 + level); the receiving state tells
them apart.
Code blocks: connect requests base + alias (500: 31,
2300: 26, 2750: 36; aliases 0–4 = the callee’s callsigns 1–5); connect
replies base + level - 1 (500: 22, 2300: 15, 2750: 41;
level 1–4); start levels 50 + level (1–7).
While waiting for the acknowledgement of data it has sent, a station also takes BREAK and IDLE as acknowledging that data (at the current level).
KISS announcements (45, 47, 58) always use the 500 Hz level table, whatever the session bandwidth.
Which decoded codes a station acts on. Besides the codes expected in its current state:
The tones of every code’s codeword come from a codebook drawn per session, so a station only recognises frames meant for it (except the unproto codes 45, 47, 48 and 58, which use fixed seeds).
Tone families: family 1 (500 Hz layout): comb bases {50, 64}; family 2 (2300): {29, 43, 57, 71, 85}; family 3 (2750): {22, 36, 50, 64, 78, 92} (bases 14 bins apart from the first). A code’s family: connect replies use their own bandwidth’s family; connect requests too, except that 2750 requests use family 2; codes 47, 48 and 58 family 1; all others, including code 45 in the main pass, the session bandwidth’s family. Code 45’s final codeword is redrawn with family 1 (step 3 below).
Drawing one codeword (format with nsym
symbols and ntones tones): for s = 2..nsym: first
pick ntones distinct bases by repeating
base = rand_int(nbases - 1) × 14 + first; then, for each
tone in order, tone = base + odd + 2 × rand_int(6), where
odd = 1 if s is even and the family is not 1, else
0.
A codebook has two sides: what we expect to receive
and what we send. Side offsets: answerer 278, caller
50; the receive side uses the peer’s offset, the send side
our own. For each side and each format f (0, 1, 2), with
off = f + side_offset:
seed_rnd(link_seed + 10 + off).seed_rnd(callee + off + R(b)), R = 7 (500), 0 (2300), 8
(2750); callee = the link seed on our sending side for
alias 0, else our alias a’s hash;seed_rnd(link_seed + 300 + off);seed_rnd(0xCD80A4 + off); code 48
(CQ): seed_rnd(0xA3CE37 + off); code 58 (KISS L4):
seed_rnd(0x49E730 + off);seed_rnd(link_seed + 1500 + off).seed_rnd(0x2D277B0 + off) and draw code 45 (KISS L1)
again with family 1; this replaces the codeword drawn for it in step 2.
(The step-2 draw still advances the stream that code 46 continues
from.)Link seed and keys by state:
| State | Link seed | Our hashes | Role | Connect codes |
|---|---|---|---|---|
| Listening | 0 | our 1–5 callsigns | answerer | none |
| Calling | hash(callee) | our callsigns | caller | from hash(our call), drawn when the call starts |
| Linked, caller | hash(peer) | our callsigns | caller | from hash(our call) |
| Linked or answering, answerer | hash of our callsign the caller addressed | our callsigns | answerer | from hash(peer) once known |
Connect codes: once the peer is known, BREAK and
IDLE are redrawn: offsets answerer 1078, caller
850; per side and format,
seed_rnd(f + connect_seed + offset), then draw BREAK, then
IDLE, both with the session bandwidth’s family.
Unproto codebook (CQ and KISS, decodable by anyone): any codebook with link seed 0 on the caller side. The unproto codes (45, 47, 48, 58) depend only on their fixed seeds, the side offset and family 1, so the callsign hashes and the bandwidth make no difference to them.
Tuning tone: 70 symbols of bin 64 at half the
amplitude of a control tone (sin(2π·64·n/2048) / norm, then
the current format’s control gain), then 24 silent symbols. When the
tuning-tone option is on it replaces the first transmission in the
answering state (circumstances otherwise unconfirmed).
Each level is a waveform, a bit depth, a turbo code rate and an
information length K in bits. The rate index r selects
the code rate num/den: 2 → 1/3, 3 → 1/2, 4 → 2/3, 6 → 4/5, 7 → 5/6
(index 5 → 3/4 is used by no level). With N coded bits per
frame, K = floor((N - 12) / den) × num (12 = the four tail
bits of each of the three tail steps), and the frame is
floor(K / 8) bytes, including 3 bytes of overhead (control
byte and CRC). When K is not a multiple of 8, the last
K mod 8 information bits are zero.
Every table has 17 rows and all 17 are fully derived by both
stations. Rows marked * are special rows past the ladder:
at 500 Hz, row 15 is the CQ callsign frame (it has no control byte, so
its payload is frame − 2 = 6 bytes); row 14 (a PSK row) and rows 16–17,
and row 17 at 2300 Hz, have no known use.
“Step thr” = snr_thr - (9.4 - papr), computed in double
and stored as float32; it is the threshold used by the speed rules
(§10). “Ctrl fmt” = the control format replies use at that level
(§10.6): the last of F0, F1, F2 whose control threshold does not exceed
the level’s step threshold (float32 comparison; at 2300 and 2750 Hz L5
the two are exactly equal, giving F2).
Derived columns: - coded bits N = data cells × bps, with data cells
per frame: FSK symbols - 1 - 24; PSK and non-QAM OFDM
carriers × (symbols - 2 - markers); QAM OFDM
carriers × (symbols - 1 - markers) - pilots, where pilots
counts the pilot cells of §9.3 on the level’s subcarriers for symbols 2
.. symbols; - pad = N minus the punctured length (§8.3); - lead-in =
ceil(80 ms / symbol), or ceil(120 ms / symbol)
when bps ≥ 4 (this includes the 16-tone FSK levels, not only the QAM
depths); - symbol time: FSK and PSK sps / 3000 s; OFDM
1.125 × 64 / 3000 s (24 ms); - Airtime is nominal:
(lead-in + symbols - 1 + flush) × symbol time, with flush =
round(2 × pulse span) for PSK and 0 otherwise. The real PSK
burst is a little longer (§9.2). - Net bit/s =
8 × frame bytes / ((symbols - 1) × symbol time), rounded. -
Amp norm is the float32 value of the decimal constant shown.
| L | Waveform | Layout | bps | Rate idx (punct. p) | K bits | Frame B | Payload B | N coded | Pad | Lead-in sym | Symbol ms | Airtime s | Net bit/s | SNR thr dB | PAPR dB | Step thr | Skip↓ | Amp norm | Ctrl fmt |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | FSK | 125 sym, sps 128@3k, bins 54..74 step 2 | 3 | 2 (1) | 96 | 12 | 9 | 300 | 0 | 2 | 42.67 | 5.376 | 18 | -13.6 | 3 | -20.0 | 1.41 | F0 | |
| 2 | FSK | 229 sym, sps 64@3k, bins 27..37 step 1 | 3 | 2 (1) | 200 | 25 | 22 | 612 | 0 | 4 | 21.33 | 4.949 | 41 | -11.2 | 3 | -17.6 | yes | 1.41 | F0 |
| 3 | FSK | 227 sym, sps 64@3k, bins 27..37 step 1 | 3 | 3 (2) | 297 | 37 | 34 | 606 | 0 | 4 | 21.33 | 4.907 | 61 | -10.4 | 3 | -16.8 | 1.41 | F0 | |
| 4 | PSK | 394 sym, 2 carriers [1350, 1650] Hz, RC , 18 markers | 1 | 3 (2) | 368 | 46 | 43 | 748 | 0 | 8 | 10.67 | 4.288 | 88 | -8.4 | 4.4 | -13.4 | 0.61 | F1 | |
| 5 | PSK | 395 sym, 2 carriers [1350, 1650] Hz, RC , 18 markers | 2 | 3 (2) | 744 | 93 | 90 | 1500 | 0 | 8 | 10.67 | 4.299 | 177 | -5.4 | 4.4 | -10.4 | 0.61 | F1 | |
| 6 | PSK | 376 sym, 3 carriers [1320, 1500, 1680] Hz, RRC span 2 , 12 markers | 2 | 3 (2) | 1080 | 135 | 132 | 2172 | 0 | 8 | 10.67 | 4.128 | 270 | -3.8 | 7.2 | -6.0 | 1.22 | F2 | |
| 7 | OFDM | 150 sym, 11 subcarriers from bin 27, 4 markers | 2 | 3 (2) | 1578 | 197 | 194 | 3168 | 0 | 4 | 24.00 | 3.672 | 441 | -1.2 | 8.3 | -2.3 | 4.9678 | F2 | |
| 8 | OFDM | 150 sym, 11 subcarriers from bin 27, 4 markers | 2 | 4 (4) | 2104 | 263 | 260 | 3168 | 0 | 4 | 24.00 | 3.672 | 588 | 0.6 | 8.3 | -0.5 | 4.9678 | F2 | |
| 9 | OFDM | 150 sym, 11 subcarriers from bin 27, 4 markers | 2 | 6 (8) | 2524 | 315 | 312 | 3168 | 1 | 4 | 24.00 | 3.672 | 705 | 2.6 | 8.3 | 1.5 | 4.9678 | F2 | |
| 10 | OFDM | 150 sym, 11 subcarriers from bin 27, 4 markers | 3 | 4 (4) | 3160 | 395 | 392 | 4752 | 0 | 4 | 24.00 | 3.672 | 884 | 5 | 8.2 | 3.8 | yes | 4.9678 | F2 |
| 11 | OFDM | 150 sym, 11 subcarriers from bin 27, 4 markers | 3 | 6 (8) | 3792 | 474 | 471 | 4752 | 0 | 4 | 24.00 | 3.672 | 1060 | 6.4 | 8.2 | 5.2 | 4.9678 | F2 | |
| 12 | OFDM | 155 sym, 11 subcarriers from bin 27, 4 markers, QAM pilots | 4 | 7 (10) | 4755 | 594 | 591 | 5720 | 2 | 5 | 24.00 | 3.816 | 1286 | 8 | 8.2 | 6.8 | 4.21 | F2 | |
| 13 | OFDM | 155 sym, 11 subcarriers from bin 27, 4 markers, QAM pilots | 5 | 6 (8) | 5708 | 713 | 710 | 7150 | 3 | 5 | 24.00 | 3.816 | 1543 | 10.6 | 8.2 | 9.4 | 4.67 | F2 | |
| 14* | PSK | 451 sym, 2 carriers [1350, 1650] Hz, RC , 18 markers | 2 | 3 (2) | 856 | 107 | 104 | 1724 | 0 | 8 | 10.67 | 4.896 | 178 | -5.4 | 4.4 | -10.4 | 0.61 | - | |
| 15* | FSK | 93 sym, sps 128@3k, bins 54..74 step 2 | 3 | 2 (1) | 64 | 8 | 6 | 204 | 0 | 2 | 42.67 | 4.011 | 16 | -13.6 | 3 | -20.0 | 1.41 | - | |
| 16* | OFDM | 51 sym, 11 subcarriers from bin 27, 4 markers, QAM pilots | 5 | 6 (8) | 1704 | 213 | 210 | 2145 | 3 | 5 | 24.00 | 1.320 | 1420 | 5.4 | 8.7 | 4.7 | 4.67 | - | |
| 17* | OFDM | 51 sym, 11 subcarriers from bin 27, 4 markers, QAM pilots | 5 | 6 (8) | 1704 | 213 | 210 | 2145 | 3 | 5 | 24.00 | 1.320 | 1420 | 5.4 | 8.7 | 4.7 | 4.67 | - |
Decode allowance (ticks of 64 samples) by level: [168, 135, 154, 142, 150, 150, 199, 204, 204, 212, 230, 236, 259]
| L | Waveform | Layout | bps | Rate idx (punct. p) | K bits | Frame B | Payload B | N coded | Pad | Lead-in sym | Symbol ms | Airtime s | Net bit/s | SNR thr dB | PAPR dB | Step thr | Skip↓ | Amp norm | Ctrl fmt |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | FSK | 125 sym, sps 128@3k, bins 33..96 step 2 | 3 | 2 (1) | 96 | 12 | 9 | 300 | 0 | 2 | 42.67 | 5.376 | 18 | -13.6 | 3 | -20.0 | 1.41 | F0 | |
| 2 | FSK | 229 sym, sps 64@3k, bins 17..48 step 2 | 3 | 2 (1) | 200 | 25 | 22 | 612 | 0 | 4 | 21.33 | 4.949 | 41 | -11.2 | 3 | -17.6 | 1.41 | F0 | |
| 3 | FSK | 229 sym, sps 64@3k, bins 17..48 step 2 | 4 | 3 (2) | 402 | 50 | 47 | 816 | 0 | 6 | 21.33 | 4.992 | 82 | -9.4 | 3 | -15.8 | 1.41 | F0 | |
| 4 | FSK | 396 sym, sps 32@3k, bins 9..24 step 1 | 4 | 3 (2) | 736 | 92 | 89 | 1484 | 0 | 12 | 10.67 | 4.341 | 175 | -6.6 | 3 | -13.0 | 1.41 | F1 | |
| 5 | PSK | 376 sym, 3 carriers [900, 1500, 2100] Hz, RC , 12 markers | 2 | 3 (2) | 1080 | 135 | 132 | 2172 | 0 | 8 | 10.67 | 4.096 | 270 | -3.6 | 6.1 | -6.9 | 0.75 | F2 | |
| 6 | PSK | 365 sym, 4 carriers [750, 1250, 1750, 2250] Hz, RC , 9 markers | 2 | 3 (2) | 1410 | 176 | 173 | 2832 | 0 | 8 | 10.67 | 3.979 | 363 | -2.4 | 7.1 | -4.7 | 0.86 | F2 | |
| 7 | PSK | 355 sym, 6 carriers [700, 1020, 1340, 1660, 1980, 2300] Hz, RRC span 2 , 6 markers | 2 | 3 (2) | 2076 | 259 | 256 | 4164 | 0 | 8 | 10.67 | 3.904 | 549 | -0.6 | 8.5 | -1.5 | yes | 1.73 | F2 |
| 8 | PSK | 352 sym, 8 carriers [702, 930, 1158, 1386, 1614, 1842, 2070, 2298] Hz, RRC span 2 , 5 markers | 2 | 3 (2) | 2754 | 344 | 341 | 5520 | 0 | 8 | 10.67 | 3.872 | 735 | 0.4 | 8.6 | -0.4 | yes | 2 | F2 |
| 9 | PSK | 349 sym, 10 carriers [555, 765, 975, 1185, 1395, 1605, 1815, 2025, 2235, 2445] Hz, RRC span 1 , 4 markers | 2 | 3 (2) | 3424 | 428 | 425 | 6860 | 0 | 8 | 10.67 | 3.819 | 922 | 1.3 | 8.9 | 0.8 | 2.23 | F2 | |
| 10 | OFDM | 150 sym, 49 subcarriers from bin 8, 1 markers | 2 | 3 (2) | 7197 | 899 | 896 | 14406 | 0 | 4 | 24.00 | 3.672 | 2011 | 5.4 | 9.4 | 5.4 | 10.44435 | F2 | |
| 11 | OFDM | 150 sym, 49 subcarriers from bin 8, 1 markers | 2 | 4 (4) | 9596 | 1199 | 1196 | 14406 | 0 | 4 | 24.00 | 3.672 | 2682 | 7.2 | 9.4 | 7.2 | yes | 10.44435 | F2 |
| 12 | OFDM | 150 sym, 49 subcarriers from bin 8, 1 markers | 2 | 6 (8) | 11512 | 1439 | 1436 | 14406 | 4 | 4 | 24.00 | 3.672 | 3219 | 8.5 | 9.4 | 8.5 | 10.44435 | F2 | |
| 13 | OFDM | 150 sym, 49 subcarriers from bin 8, 1 markers | 3 | 4 (4) | 14398 | 1799 | 1796 | 21609 | 0 | 4 | 24.00 | 3.672 | 4025 | 11.2 | 9.4 | 11.2 | 10.44435 | F2 | |
| 14 | OFDM | 150 sym, 49 subcarriers from bin 8, 1 markers | 3 | 6 (8) | 17276 | 2159 | 2156 | 21609 | 2 | 4 | 24.00 | 3.672 | 4830 | 13.2 | 9.4 | 13.2 | yes | 10.44435 | F2 |
| 15 | OFDM | 155 sym, 49 subcarriers from bin 8, 1 markers, QAM pilots | 4 | 7 (10) | 21710 | 2713 | 2710 | 26068 | 4 | 5 | 24.00 | 3.816 | 5872 | 14.2 | 9.3 | 14.1 | 8.82035 | F2 | |
| 16 | OFDM | 155 sym, 49 subcarriers from bin 8, 1 markers, QAM pilots | 5 | 6 (8) | 26056 | 3257 | 3254 | 32585 | 3 | 5 | 24.00 | 3.816 | 7050 | 17.2 | 9.3 | 17.1 | 10.01805 | F2 | |
| 17* | OFDM | 51 sym, 11 subcarriers from bin 27, 4 markers, QAM pilots | 5 | 6 (8) | 1704 | 213 | 210 | 2145 | 3 | 5 | 24.00 | 1.320 | 1420 | 5.4 | 8.7 | 4.7 | 4.67 | - |
Decode allowance (ticks of 64 samples) by level: [162, 140, 148, 148, 150, 164, 172, 176, 190, 263, 303, 319, 365, 415, 480, 556]
| L | Waveform | Layout | bps | Rate idx (punct. p) | K bits | Frame B | Payload B | N coded | Pad | Lead-in sym | Symbol ms | Airtime s | Net bit/s | SNR thr dB | PAPR dB | Step thr | Skip↓ | Amp norm | Ctrl fmt |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | FSK | 125 sym, sps 128@3k, bins 24..103 step 2 | 3 | 2 (1) | 96 | 12 | 9 | 300 | 0 | 2 | 42.67 | 5.376 | 18 | -13.6 | 3 | -20.0 | 1.41 | F0 | |
| 2 | FSK | 229 sym, sps 64@3k, bins 12..51 step 2 | 3 | 2 (1) | 200 | 25 | 22 | 612 | 0 | 4 | 21.33 | 4.949 | 41 | -11.2 | 3 | -17.6 | 1.41 | F0 | |
| 3 | FSK | 229 sym, sps 64@3k, bins 12..51 step 2 | 4 | 3 (2) | 402 | 50 | 47 | 816 | 0 | 6 | 21.33 | 4.992 | 82 | -9.4 | 3 | -15.8 | 1.41 | F0 | |
| 4 | FSK | 396 sym, sps 32@3k, bins 6..25 step 1 | 4 | 3 (2) | 736 | 92 | 89 | 1484 | 0 | 12 | 10.67 | 4.341 | 175 | -6.6 | 3 | -13.0 | 1.41 | F1 | |
| 5 | PSK | 376 sym, 3 carriers [600, 1500, 2400] Hz, RC , 12 markers | 2 | 3 (2) | 1080 | 135 | 132 | 2172 | 0 | 8 | 10.67 | 4.096 | 270 | -3.6 | 6.1 | -6.9 | 0.75 | F2 | |
| 6 | PSK | 365 sym, 4 carriers [510, 1170, 1830, 2490] Hz, RC , 9 markers | 2 | 3 (2) | 1410 | 176 | 173 | 2832 | 0 | 8 | 10.67 | 3.979 | 363 | -2.4 | 7.1 | -4.7 | 0.86 | F2 | |
| 7 | PSK | 355 sym, 6 carriers [450, 870, 1290, 1710, 2130, 2550] Hz, RRC span 2 , 6 markers | 2 | 3 (2) | 2076 | 259 | 256 | 4164 | 0 | 8 | 10.67 | 3.904 | 549 | -0.6 | 8.4 | -1.6 | yes | 1.73 | F2 |
| 8 | PSK | 352 sym, 8 carriers [380, 700, 1020, 1340, 1660, 1980, 2300, 2620] Hz, RRC span 2 , 5 markers | 2 | 3 (2) | 2754 | 344 | 341 | 5520 | 0 | 8 | 10.67 | 3.872 | 735 | 0.4 | 8.7 | -0.3 | yes | 2 | F2 |
| 9 | PSK | 349 sym, 10 carriers [375, 625, 875, 1125, 1375, 1625, 1875, 2125, 2375, 2625] Hz, RRC span 1 , 4 markers | 2 | 3 (2) | 3424 | 428 | 425 | 6860 | 0 | 8 | 10.67 | 3.819 | 922 | 1.3 | 8.8 | 0.7 | yes | 2.23 | F2 |
| 10 | PSK | 349 sym, 13 carriers [240, 450, 660, 870, 1080, 1290, 1500, 1710, 1920, 2130, 2340, 2550, 2760] Hz, RRC span 1 , 3 markers | 2 | 3 (2) | 4466 | 558 | 555 | 8944 | 0 | 8 | 10.67 | 3.819 | 1203 | 2.3 | 8.8 | 1.7 | 2.5422 | F2 | |
| 11 | OFDM | 150 sym, 59 subcarriers from bin 3, 1 markers | 2 | 3 (2) | 8667 | 1083 | 1080 | 17346 | 0 | 4 | 24.00 | 3.672 | 2423 | 6 | 9.3 | 5.9 | 11.4219 | F2 | |
| 12 | OFDM | 150 sym, 59 subcarriers from bin 3, 1 markers | 2 | 4 (4) | 11556 | 1444 | 1441 | 17346 | 0 | 4 | 24.00 | 3.672 | 3230 | 8 | 9.3 | 7.9 | yes | 11.4219 | F2 |
| 13 | OFDM | 150 sym, 59 subcarriers from bin 3, 1 markers | 2 | 6 (8) | 13864 | 1733 | 1730 | 17346 | 4 | 4 | 24.00 | 3.672 | 3877 | 9.3 | 9.4 | 9.3 | 11.4219 | F2 | |
| 14 | OFDM | 150 sym, 59 subcarriers from bin 3, 1 markers | 3 | 4 (4) | 17338 | 2167 | 2164 | 26019 | 0 | 4 | 24.00 | 3.672 | 4848 | 11.8 | 9.5 | 11.9 | 11.4219 | F2 | |
| 15 | OFDM | 150 sym, 59 subcarriers from bin 3, 1 markers | 3 | 6 (8) | 20804 | 2600 | 2597 | 26019 | 2 | 4 | 24.00 | 3.672 | 5817 | 14 | 9.5 | 14.1 | yes | 11.4219 | F2 |
| 16 | OFDM | 155 sym, 59 subcarriers from bin 3, 1 markers, QAM pilots | 4 | 7 (10) | 26145 | 3268 | 3265 | 31388 | 2 | 5 | 24.00 | 3.816 | 7074 | 15 | 9.3 | 14.9 | 9.6459 | F2 | |
| 17 | OFDM | 155 sym, 59 subcarriers from bin 3, 1 markers, QAM pilots | 5 | 6 (8) | 31376 | 3922 | 3919 | 39235 | 3 | 5 | 24.00 | 3.816 | 8489 | 18 | 9.3 | 17.9 | 10.9557 | F2 |
Decode allowance (ticks of 64 samples) by level: [150, 118, 140, 136, 136, 144, 152, 164, 172, 180, 276, 315, 340, 415, 450, 535, 636]
The QAM limit is the last of all 17 rows that has no QAM pilots. At 500 Hz the special rows 14 (PSK) and 15 (FSK) count, so the limit there is row 15, above the 13-level ladder; it does not stop climbs into L12–L13. Decode allowances of the special rows: 500 Hz row 14 → 180, row 15 → 192, rows 16–17 → 391; 2300 Hz row 17 → 391.
| payload | [0x14, marker, 0, 0, ...] | [next level] | control | CRC-16 (big-endian) |
frame bytes - 3, minus 1 more
when the “next level” byte is present. (The 500 Hz CQ row 15 is the
exception: 6 payload bytes, no control byte, §12.)0x14, then (if room) the
marker, then zeros up to the capacity. A frame whose
payload exactly fills the capacity is “full”: it has no terminator and
sets F. With text compression the payload is the compressed bytes.0x00 and 0x14 become 0x01. Both
directions use the caller’s marker. The caller computes it from its own
callsign as configured; the answerer from the callsign text it unpacks
from the header frame (§5), so the two agree only for callsigns that
pack and unpack to the same text (an SSID written -0 or
with a leading zero does not; consequence unconfirmed).0x14 in the payload field
(capacity, less the next-level byte when L is set). It rejects the frame
only when the byte after that 0x14 is neither the marker
nor 0x00 (a 0x14 in the field’s final position
is accepted). With no 0x14 at all the frame is not rejected
but delivers nothing. A frame with F delivers the whole field. The
payload is the bytes before the terminator. At 500 Hz this check
(and the header check of §8.2) is not made at all; frames are
accepted on the CRC alone.RR C HHH L F (MSB
first): RR = control format the receiver should reply in (0–2); C =
payload is text-compressed (only ever set on the first or only frame of
a transmission; the second frame of a pair always has C = 0); HHH =
queue bucket “hint” 0–6 (§10.5); L = next-level byte present; F = frame
full.FQ\r is a B2F end-of-session request (§10.9).The caller’s first data frame carries no payload but identifies it.
Its 8-byte payload is packed callsign (6) | 0x00 | flags;
it is sent with the next-level byte (the offered level), so the frame is
payload (8) | [0x14 marker 0 ...] | offered level | control | CRC.
At a level whose capacity is exactly 8 bytes (every bandwidth’s L1,
12-byte frames) the header fills the frame: no terminator, F set.
flags =
0x80 | encryption << 4 | compression << 1 | registered:
- bit 7 is always 1; a receiver refuses a header without it (refusal
code unconfirmed); - bits 4–5: the sender’s encryption setting,
sent only when its callsign passes a fixed eligibility test, else 0. A
non-zero value changes how payloads are handled; that transform is not
covered here; - bits 1–2: compression 0 off, 1 text, 2 files. An
unregistered station always sends 0, whatever its setting; the receiver
adopts the value for the session; - bit 0: registered.
A receiver requires L set, C clear, byte 6 = 0 and a payload of exactly 8 bytes (terminator at byte 8, or a full frame of capacity 8) — except at 500 Hz, where these checks are skipped (§8.1). The registered bit matters: a peer limits an unregistered station to level 4.
info[perm[i]] (turbo
interleaver). Encoder registers r0, r1, r2 start at 0; per input bit
u: fb = u ⊕ r0 ⊕ r1, systematic = u,
parity = fb ⊕ r2 ⊕ r0, then
(r0, r1, r2) = (r1, r2, fb). Three tail bits per encoder
drive it to zero (u = r0 ⊕ r1).p = 1 or t mod p = 0,
then encoder-2 parity if p = 1 or
t mod p = p/2. Then for each of the 3 tail steps emit sys1,
par1, sys2, par2 (unpunctured). Pad with zeros to N (0–4 bits).chan[i].A transmission is the lead-in followed by one frame, or two frames back to back (two-frame mode, §10.4), without a second lead-in: the second frame’s symbols follow the first frame’s last symbol directly, and each frame keeps its own per-frame structure (reference symbols, pilots, marker positions, phase-table indices restarting at 0). Lead-in content is random and need not be reproduced by the receiver.
All data audio is divided by the level’s amplitude normaliser, multiplied by the drive gain of §2 (each product stored as float32), then clipped to ±1.0.
3000 / sps Hz spacing (48 kHz symbols
of 16 × sps samples, no prefix).symbols - 1): offset
t = the pilot value if the symbol is a pilot, else
GRAY[next bps bits] with
GRAY = [0,1,3,2,7,6,4,5,15,14,12,13,8,9,11,10] (its first
2^bps entries); bin =
first + (hop[i] + step × t - first) mod nbins, with the
level’s tone step (1 or 2, “step” in §7).lead_in symbols with random offsets
draw(2^bps) (not Gray-mapped) on hop bases
hop[1..]. In a two-frame burst a lead-in is drawn for each
frame and only the last one is sent.2·sin(2π·bin·n / (16·sps)),
n restarting every symbol; symbols are not cross-faded; the
last 16·sps/32 samples of the burst are tapered by a
falling half-cosine.{1, -1}; QPSK {1, j, -j, -1}; 8PSK
{1, e^jπ/4, e^j3π/4, j, e^-jπ/4, -j, -1, e^-j3π/4}, indexed
MSB first.draw(2^bps)); for s =
1 .. spf-2: if it is a marker position, d repeats (no data);
otherwise d ×= point(next bps bits) (marker positions are
never below 5). Each transmitted symbol is
d × conj(phasor_PSK[c][s]) × 178.× conj(phasor[c][k]) × 178. Draw order: one reference per
frame per carrier, then the lead-in (per symbol, per carrier).h(0) = 1; h(±8) = 0.5; otherwise with
x = n/16:
h = sin(πx)·cos(πx) / (πx·(1 - 4x²)), numerator and
denominator each rounded to float32 before the division, the result
stored as float32;h(0) = 4/π;
h(±8) = (1/√2)·((1 + 2/π)·sin(π/4) + (1 - 2/π)·cos(π/4));
otherwise with x = n/32:
h = 4x·cos(2πx) / (πx·(1 - 16x²)), rounded the same
way.m = i - 16, f = float32(125/48000):
h = 2f if m = 0 else
sin(2πf·m)/(π·m);
w = float32(0.54 - 0.46·cos(2π·i/32)); tap =
float32(h·w). (The window is symmetric about i =
16, so the same filter can be written with i = 1..32 and a
one-sample shift.)round(32·c/3 + 1) - 1); otherwise odd carriers 16, even
carriers 0. Mix up with a float32 phase accumulator (step
2π·fc/48000, added before each sample, wrapped when above
2π): Re{v·e^jφ}. Sum the carriers.(lead-in + frames × (spf - 1) + 1) × 32 + delay + taps - 1
samples at 3000 Hz, then ×16 plus 31 interpolation-tail samples at 48
kHz.first .. first + nc - 1 (500: 11 from 27; 2300: 49 from 8;
2750: 59 from 3).1; afterwards a marker
keeps the previous cell (normalised to unit magnitude), otherwise
cell ×= point(bits).1 (even bins when s mod 8 = 2, odd bins when
s mod 8 = 3; bin parity is that of the absolute FFT bin); a
pilot takes precedence over a marker; a marker repeats the previous cell
normalised; otherwise point(bits). 16QAM point v =
(L[v >> 2], L[v & 3]) with
L = [-0.7778175, -0.2592725, 0.7778175, 0.2592725]; 32QAM
is a cross built from the magnitudes
A = [0.2121320, 0.6363961, 1.0606602]: points 0–7 are
(A[i], A[q]) for (i, q) = (0,0), (1,0), (1,2), (2,0),
(0,1), (1,1), (0,2), (2,1); points 8–15 are their complex conjugates,
16–23 the negated conjugates, 24–31 the negations.conj(phasor_OFDM[bin][r]).draw(2^bps) per subcarrier
(for each subcarrier, all lead-in rows); for two-frame bursts three
lead-in sets are drawn and the middle one is used.2·Re;
prefix = the last 128 samples. The first 32 samples of each symbol are
cross-faded (falling half-cosine on the old, rising on the new) with the
32 samples that followed the previous symbol’s prefix; before the first
symbol those are zero, so the burst fades in. The final 32 samples of
the burst are tapered.Half duplex. Times are in ticks of 64 samples (750 per second) unless stated.
| State | Meaning |
|---|---|
| Listen | idle, listening for connect requests to our callsigns |
| Answering | sent a connect reply, waiting for the caller’s header |
| Receiving | the peer is sending data to us |
| Break | we asked for the turn (BREAK) |
| HeaderSent | caller: header sent, waiting for BREAK/IDLE |
| Sending | we are sending data |
| Qrt | disconnect sent; the station closes as soon as the QRT has been transmitted |
| Calling | caller: sending connect requests |
| IdleSent | sent IDLE, waiting for NO TRAFFIC or BREAK |
| Idle | link up, nothing to send either way |
| FqWait | after receiving a B2F FQ, waiting for the peer’s
QRT |
Each state listens only for some codes; anything else is not decoded:
| State | Codes heard |
|---|---|
| Listen | 26–40 (connect requests); 45, 47, 58 when KISS is enabled |
| Answering | 3, 12, 13, 26–40, 46 |
| Calling | the connect replies |
| HeaderSent, Sending | 1, 2, 3, 5–11, 19, 46, 49, 50 |
| Receiving | 3, 12, 13, 46, 49, 50 |
| Break | 3, 12, 13, 14, 46, 50, 51–57; in chat mode 3, 12, 13, 14, 46, 49, 50 |
| IdleSent | 3, 12, 13, 21, 46, 49 |
| Idle | 3, 46, 49, 50 |
| FqWait | 3, 12, 13, 46 |
round(400 ms / symbol)). Retries when no
reply has ended within codeword(F1) + 32 + allowance ticks,
until the configured retry count is used up, then reports UNABLE TO
CONNECT.round(300 ms / symbol); none in chat mode), and enters
Answering. Connect requests are handled in any state that hears them: an
answerer that hears the request again (its reply was missed) answers
again.valid clear → REJECT and Qrt. Otherwise
connected: chat mode sends IDLE (→ IdleSent); otherwise
BREAK (→ Break) and the answerer may hold the turn for
its host (§10.7).FQ\r: last
frame, not full, single frame, payload exactly FQ\r), or
IDLE in chat mode with an empty queue (→ IdleSent); otherwise
acknowledges with the code from the step decision (§10.5).A counter counts good uncompressed frames in a row at one level; a failure, a level change or a hint of 2 resets it. When it reaches 6, the next transmission carries two frames; both ends latch this when they send (receiver when it replies, sender when it transmits) so they switch together. The first transmission of a turn is always a single frame. Text-compressed turns never use pairs. Partial results: second frame lost → ACK FIRST ONLY; first lost → ACK SECOND ONLY; both step down one level (the sender only above level 1). If the first frame of the pair already ended the turn, a lost second frame is answered with BREAK.
queued ≤ frames × capacity - 1; with text compression, by
actually compressing (input window 3 × capacity + 39
bytes).capacity(L) + capacity(L + s) reaches the capacity of the
start maximum (one lower with compression), coded 0 for s = −1
and s + 2 otherwise, else 6.0.5/15.
Good frame: run += 1, margin = max(margin - decay, 1.5),
QAM frame → “QAM seen”, climbing (level above the previous frame’s)
clears the failed-climb count. Lost frame at or above the last good
level, above level 1 and with a run of at least one:
margin += 1; climbing adds 4 × failed climbs;
a run under 15 adds 3 × (15 - run) / 15; decay becomes
(new - old) / 15; first QAM loss before any QAM success
sets “QAM lost first”. Every lost frame then sets run = 0, and climbing
counts a failed climb. All in float32.m_d = snr - step_thr(level + d) - margin - max(d - 1, 0),
disabled when beyond the top, or (d ≥ 2) above the QAM limit or
after any failed climb, or (d = 1) above the QAM limit after a
QAM-first loss. QAM limit = last of all 17 rows without QAM pilots (§7):
500: row 15, 2300: L14, 2750: L15; at 500 Hz it lies
above the ladder, so these two tests never disable a climb there. Then,
from d = 4 down to 1: climb by d if
level + d ≤ ceiling, m_d > 0 and
hint ≥ d + 2 (codes UP1 7, UP2 5, UP3 8, UP4 9). Otherwise
ACK DOWN if level > 1 and (m_0 < 0 or hint = 0);
otherwise ACK STAY (hint 2 also resets the pair counter).
Ceiling: the top level for a registered peer,
level 4 otherwise.snr - step_thr > max(margin, 6) (strict, float32),
stopping at the first that fails; else 1.snr - step_thr > max(margin, 3) + penalty, stopping at
the first that fails. Penalty +1 / +2 / +3 dB for offering
2 / 3 / 4+ levels above the last good one. In HeaderSent (the header’s
offer and the START LEVEL reply) there is no penalty and snr is
the last control frame’s; otherwise snr is the data-frame SNR
trend once data has been received. Start cap: 4 if unregistered; the QAM
limit while a B2F FS proposal is pending (a host write that
starts FS and ends \r, until the turn carrying
it is acknowledged); otherwise the bandwidth’s start maximum (500: L7,
others L6), one lower with text compression. The search has no ladder
clamp: at 500 Hz with FS pending the cap is row 15, and
rows 14 and 15 have step thresholds of -10.4 and -20 dB, so whenever L13
qualifies the offer becomes 15 (not observed on the air).snr - (9.4 - k) does not exceed the level’s step threshold
(“Ctrl fmt” in §7).>\r) or a queue too big for one
frame ends the hold. When the hold ends with data, the first frame
carries the table minimum hint unless it ended on a prompt. The
hold stays armed until the answerer first sends data or IDLE.allowance = delay + 150. On the first
measurement every unmeasured level gets
ack_delay = decode_allow(level) + delay - 100.ack_delay + 400, plus
0.45 × (ack_delay - ctrl_delay) when positive, computed
exactly: the product uses the double constant 0.45 (slightly above
0.45), so exact halves round up.codeword(F1) + 32 + allowance; HeaderSent
and Sending ACK window(level) + long lead-in + codeword of
the expected reply format, or F0 frame + allowance after an
ACK REQUEST; Break the BREAK back-off; IdleSent
F0 frame + allowance (F0 frame = 1024 ticks).(1..3) × 1024 + 1.5 × base allowance ticks (rounded to
even), drawn anew for every BREAK. FQ wait:
9 × (1024 + allowance) ticks, then the link closes without
a frame.QRT (3) or QRT without CW ID (46); the peer closes on receipt. A
requested disconnect waits until queued data is acknowledged; with
nothing queued it is sent at the next opportunity: in reply to the next
control or data frame, at once from Idle (via BREAK), and from Receiving
if no frame arrives within the expected frames plus
1.25 × base allowance. A CW identification follows QRT when
the station’s own base callsign is a United States callsign or its own
CW-ID option is set, provided the session had connected; the host’s
CWID ON/OFF does not change this. B2F: a received lone
FQ\r makes the receiver wait for the sender’s QRT (FqWait);
FS ...\r from the host raises the start cap (§10.6).
COMPRESSION TEXT: a phrase-Huffman coder with 8
states (code tables in Appendix A). Each state has a 3-bit
start code (its number − 1), phrase entries (phrase, bit code, next
state; 0 = stay) and either an escape code (switch state without output)
or a single-byte entry for every byte value (state 3). All codes of a
state, escape included, form a prefix-free set of at most 10 bits.
Encoding one frame of capacity c bytes (the
full payload capacity, without the next-level reservation): - The input
is at most 3c + 39 queued bytes. - Output starts with the
3-bit code of the current state. The state is reset to
1 when a turn starts; later frames of the turn start in the state the
previous frame ended in (a resent frame restarts from the state its
first transmission started in). - Then codes are matched
greedily in table order: the first entry whose whole
phrase matches at the current position, not the longest; if none
matches, the escape code (no input consumed). - A code that would not
fit in 8c bits is not written and encoding stops, but its
state change still happens (the next frame starts in that state). -
Padding: the complement of the last bit, repeated to the byte boundary;
if the output is already aligned, a whole byte. If that byte does not
fit, the last code (and its state change) is removed and the output is
padded again.
Per turn: the compressor is tried on the first
min(queued, 150) bytes from state 1 with capacity equal to
that length; the turn is compressed only if this consumes more bytes
than it writes. Compression is used only when the session’s compression
is text, and not for a final frame whose rest fits uncompressed with the
next-level byte; such a frame is sent uncompressed with C clear. Only
single-frame transmissions are compressed (§10.4).
Decoding a frame with C set (only when the session’s
compression is text): strip the final run of equal bits (the padding),
read the 3-bit start state, then repeatedly follow escape codes and take
the first entry whose code matches, until the bits run out. The decoder
never carries state between frames. Output is limited to
3 × (payload length + 39) + 1 bytes; on overflow the raw
compressed bytes are delivered instead and a compression error is
logged, without ending the session; when no code matches, the text
decoded so far is delivered (unconfirmed). The first frame of a
two-frame transmission is not inflated even if C were set
(unconfirmed).
A CQ is the CQ control frame (code 48, unproto codebook, F0),
1920 samples of silence (unconfirmed), then
one 8-byte frame on the 500 Hz table’s row 15 (FSK, K =
64): the callsign packed in 6 bytes (base padded to 7 characters, 6 bits
each in the alphabet " A-Z0-9", then
bandwidth_code × 16 + ssid, bandwidth code 1 = 500, 2 =
2300, 3 = 2750), then CRC-16. Receivers that hear the control frame look
for the callsign frame within 4 lead-ins plus one frame airtime. The CQ
control frame is decoded only in chat mode
(CHAT ON or LISTEN CQ); the station then
reports SN x and
CQFRAME <call> <bw>. Sending a CQ does not need
chat mode.
Status of this section: taken from the receive side of a transcription of the reference implementation and confirmed by decoding 26 broadcast objects received off the air (23 single-block command-2 objects and three two-block AX.25 messages, at levels 1, 2 and 4). It has not had the claim-by-claim check the other sections had, and the transmit side (how a sender chooses the packing) is not covered.
A broadcast is connectionless: no connect, no acknowledgement. A host hands the modem a KISS frame on the KISS TCP port (§13); the modem packs it into an object, cuts the object into blocks and sends an announcement control frame followed by one data frame per block. A receiving modem rebuilds the object and hands its own KISS client the equivalent KISS frame. The KISS framing itself is never sent.
On the air. The announcement is control code 45, 47
or 58 (unproto codebook, §6.4), meaning the blocks follow at level 1, 2
or 4 of the 500 Hz table, whatever bandwidth the
stations otherwise use. Each block is an ordinary data frame of that
level (§8.1). The block is the payload field when the frame is full (F
set), otherwise the bytes before the last
0x14 in the field. An empty block is ignored. A receiver
only takes blocks while a KISS client is connected.
Block byte 0 (flags):
| Bits | Meaning |
|---|---|
7 (0x80) |
more blocks of this object follow |
6 (0x40) |
commands 0/1: the AX.25 control and PID bytes 03 F0
follow the addresses |
5–4 (0x30) |
command: 0 = AX.25 with 6-character addresses, 1 = AX.25 with 7-character addresses, 2 = raw payload, 3 = same command as the previous object |
3 (0x08) |
commands 0/1: digipeaters present |
| 2–0 | commands 0/1: digipeater count − 1 (when bit 3 is set); command 2: bit 0 set = 7-bit packing, clear = 8-bit |
Objects of more than one block. In the first block,
byte 1 is checksum nibble << 4 | (blocks − 2). The
object is byte 0, then the first block from byte 2 on, then every later
block from its byte 1 on (each later block’s byte 0 is its own flags
byte). When the last block (bit 7 clear) arrives, object byte 0 is
replaced by that block’s byte 0, and the object is accepted only if the
top four bits of its CRC-16 (§5) equal the checksum nibble; otherwise
nothing is delivered. The announced block count is recorded but not
checked. A one-block object has no check beyond the data frame’s own
CRC. An object holds at most 5000 bytes. The receiver’s assembly is
cleared only by the next announcement control frame,
not by a delivery or a failed check, so a block whose announcement was
missed is appended to whatever was left.
Object body. Everything after object byte 0 is one bit string, most significant bit first.
Command 2 (raw). The body is cut into 7-bit or 8-bit values (flag bit 0) and delivered as bytes. With 7-bit packing the trailing run of equal bits (the padding) is removed first, as in text compression (§11).
Commands 0 and 1 (AX.25). In order:
AP and the next bit is 1, a 3-bit region 1–7 follows and
digipeater i (from 1) is <REGION><i>-1
with regions WIDE, PNW, MW,
OR, WA (regions 6 and 7 have an empty root,
giving <i>-1; region 0 is an error); otherwise one
compact address each;AP, otherwise 1 bit;| Kind | Information field |
|---|---|
| 0 (and 7) | 7-bit characters (trailing padding run removed) |
| 1 | 8-bit bytes |
| 2 | APRS position: ! then the position fields and text
(below) |
| 3 | APRS position with time: @, a 20-bit time as 6 digits,
h, then as kind 2 |
| 4 | APRS message: :, a compact address padded with spaces
to 9 characters, :, then text |
| 5 | nothing is delivered |
| 6 | third-party: }, address, >, address,
,TCPIP,, address, *:, then a 2-bit selector
k (3 → plain text, otherwise kind k + 2) and that
kind’s fields |
The delivered AX.25 frame has each address as 6 (command 0) or 7
(command 1) characters, space padded, each shifted left one bit,
followed by the SSID byte 0x60 | ssid << 1; the last
address has bit 0 set and a repeated digipeater has 0x80
set in its SSID byte. 03 F0 follows when flag bit 6 is set,
then the information field.
Compact address. A 6-bit code selects from
" A-Z0-9!:#$%&'()*+,-./;" (53 entries):
| First code | Address |
|---|---|
| space, letter or digit | that character, then 6-bit codes from " A-Z0-9" until
the address width (6 or 7) is reached or a space is read; then a 4-bit
SSID, written -n when not zero |
! : # $
% |
WIDE, PNW, MW,
OR, WA; then 1 bit (digit − 1) and a suffix: 1
bit, except WIDE which reads two bits as two decimal
digits; written <ROOT><digit> or
<ROOT><digit>-<suffix> |
& |
ALL |
' |
CQ |
( ) * |
APIN + (4-bit value + 20), APWW + (3-bit
value + 11), APDR + (5-bit value + 16), the number as two
digits |
+ , - .
/ |
the fixed names APBPQ1, APJYC1,
APOPYT, APU25N, APVARA |
; |
AP, then 6-bit codes as in the first row up to the
address width; no SSID |
Position fields (kinds 2 and 3). Latitude: 20 bits
written as 6 digits with . after the fourth, then 1 bit (1
= N, 0 = S). Symbol table: 1 bit; if set a
3-bit index into /\IRVTDS, otherwise a 7-bit character.
Longitude: 21 bits written as 7 digits with . after the
fifth, then 1 bit (1 = W, 0 = E). Symbol: a
7-bit character. Text follows.
Text (after kinds 2, 3, 4 and 6). 7-bit codes until
fewer than 7 bits remain. Codes 32 and above are characters. Codes 0–9
are phrases: 0 nothing, 1 /A=00, 2 VARA, 3
PinPoint, 4 HF (with the space), 5
ack, 6 APRS, 7 ping{, 8
Digi, 9 Gate; codes 10–31 produce nothing. In
kinds 2 and 3, phrase 1 is followed by a 14-bit altitude written as 4
digits (giving /A=00dddd).
Delivery to the host. The receiver writes
C0 <command> <payload> C0 to its KISS client,
command 0, 1 or 2 as above, with C0 in the payload sent as
DB DC and DB as DB DD. On the
host side a frame is accepted when it starts and ends with
C0, its command byte is at most 2, and for commands 0 and 1
it is at least 19 bytes long. The station reports SN x
after a broadcast reception (§13).
What programs put inside command 2 (fixed-layout text records, for example) is their own convention and is not part of this protocol.
Command port 8300 (configurable), data port = command port + 1 (raw
bytes both ways). A separate KISS port (8100 by default) carries unproto
broadcasts as KISS frames in both directions (§12.2). One client per
port; a new connection replaces the old one. Lines end in
\r (a \n is ignored); commands are
case-sensitive and their arguments are separated by single spaces. Most
commands are answered OK or WRONG;
VERSION, TUNE ? and CLEANTXBUFFER
answer with their own line instead. For LISTEN, DISCONNECT, ABORT,
CONNECT, CQFRAME and COMPRESSION the OK comes before the
action.
| Command | Effect |
|---|---|
MYCALL c1 [c2..c5] |
our callsigns (connect-request aliases 0–4); each must be a valid
callsign; while not in Listen it is answered WRONG and
applied after the next DISCONNECTED |
LISTEN ON / LISTEN OFF |
accept incoming connects (default off; also
switched off whenever either TCP port is not connected); outside Listen
the session is dropped to Listen without a QRT or
DISCONNECTED |
LISTEN CQ |
same as CHAT ON |
CONNECT src dst |
call dst; only in Listen (or Answering) |
ABORT |
disconnect at the next opportunity (QRT); before any reply, just stop retrying |
DISCONNECT |
QRT once the queued data has been acknowledged; with nothing queued,
as ABORT |
BW500 / BW2300 / BW2750 |
bandwidth (default 2300); only in Listen |
COMPRESSION OFF / TEXT / FILES (ON =
TEXT) |
default TEXT; only the caller’s setting is used, and only if it is registered |
CHAT ON / CHAT OFF |
chat mode: control allowance base 850, no QRT after idle polls, IDLE instead of BREAK when the answerer connects or a received turn ends with nothing queued, CQ reception; ON implies LISTEN ON; only in Listen |
CQFRAME src bw |
send a CQ (only in Listen; chat mode not needed) |
WINLINK SESSION / P2P SESSION |
control allowance base 438 / 850 ticks (default WINLINK) |
RETRIES n |
connect-request retry count (0 restores the configured value) |
CLEANTXBUFFER |
empty the transmit queue while receiving; answers
CLEANTXBUFFER OK, BUFFEREMPTY or
FAILED |
TUNE n, TUNE OFF, TUNE ?,
DRIVELEVEL n |
transmit drive level (−30..0 dB) and tune signal |
CWID ON/OFF, PUBLIC ON/OFF,
GATEWAY x, GATEWAY OFF |
accepted, no effect |
IGNOREKISSDCD ON/OFF |
KISS option |
VERSION |
answers VERSION VARA HF v<version> |
Asynchronous lines: CONNECTED src dst bw (bw
500/2300/2750),
DISCONNECTED (only after a session that connected or a call
that was started; a failed incoming request ends with
CANCELPENDING), PTT ON/OFF,
BUFFER n (when acknowledgements retire queued data),
PENDING (incoming request for our callsign, or a CQ or KISS
send starting), CANCELPENDING, BUSY ON/OFF,
REGISTERED[ call ...] and then
ENCRYPTION READY or ENCRYPTION DISABLED 5 s
after MYCALL, LINK REGISTERED/UNREGISTERED (answering side,
the caller’s status, after CONNECTED), ENCRYPTED LINK /
UNENCRYPTED LINK, BITRATE (...) n bps,
IAMALIVE (every 60 s), CQFRAME src bw (chat
mode), SN value (one decimal; after every good data frame
except the first of a pair, and after KISS and CQ receptions, in every
mode), MISSING SOUNDCARD.
Format:
S <state> <start code> <escape code | -> [escape next state]
opens a state; each following
E <phrase as hex | -> <code bits> <next state>
line is one entry (next state 0 = stay). Codes are written MSB
first.
S 1 000 10101101 2
E 3b574c324b2d526164696f2f496e7465726e65745f4e6574776f726b0d 101010 0
E 5b524d5320457870726573732d 010 5
E 524d53205472696d6f646520 0010 5
E 5b524d532052656c61792d 100010 5
E 434d532076696120 1101 8
E 7b534649203d20 0011 4
E 5b574c324b2d 1110 5
E 464320454d20 10010 6
E 3b46573a20 000 8
E 3b50513a20 1011 7
E 3b50523a20 1100 7
E 3b504d3a20 10100 8
E 3b46523a0d 1000111 0
E 5b4250512d 1010111 5
E 2a2a2a20 1000110 8
E 46460d 1111 0
E 463e20 10011 6
E 646520 10101100 8
E 3b20 011 8
E 0a 10000 0
S 2 001 1011101100 3
E 666f7277617264656420746f2074686520726563697069656e742076696120484620726164696f 111010011 0
E 206d696e757465732072656d61696e696e67207769746820 01010001 8
E 207468726f7567682074686520496e7465726e657420 110111000 0
E 20436f6e6e656374656420746f20434d530d 101101101 1
E 57656c636f6d6520746f2074686520 10000110 0
E 20524d53205472696d6f6465 01010010 0
E 20524d532052656c6179 101101111 0
E 202f2f574c324b20 1011110010 0
E 2068617320 01010011 0
E 2056415241 101101001 0
E 203e0d 010100000 1
E 2620 1110100000 0
E 20 011 0
E 69 0001 0
E 72 0010 0
E 61 0100 0
E 65 1001 0
E 75 00000 0
E 63 01011 0
E 6c 10001 0
E 73 10100 0
E 6e 11100 0
E 74 11110 0
E 6f 11111 0
E 66 000010 0
E 62 001100 0
E 0d 001101 1
E 2c 001110 0
E 40 001111 0
E 2e 010101 0
E 67 100000 0
E 6d 101011 0
E 68 101100 0
E 70 110101 0
E 64 111011 0
E 76 0000110 0
E 2d 0000111 0
E 6b 1000010 0
E 77 1010100 0
E 79 1110101 0
E 49 10101010 0
E 52 10101011 0
E 42 10110101 0
E 5a 10111000 0
E 4f 10111001 0
E 4a 10111010 0
E 32 10111101 0
E 35 10111110 0
E 36 10111111 0
E 47 11000000 0
E 44 11000001 0
E 37 11000010 0
E 38 11000011 0
E 4d 11000100 0
E 4c 11000101 0
E 45 11000110 0
E 50 11000111 0
E 33 11001000 0
E 59 11001001 0
E 54 11001010 0
E 57 11001011 0
E 51 11001100 0
E 34 11001101 0
E 53 11001110 0
E 31 11001111 0
E 46 11010000 0
E 55 11010001 0
E 39 11010010 0
E 4e 11010011 0
E 43 11011000 0
E 4b 11011001 0
E 41 11011010 0
E 48 11011011 0
E 30 11011101 0
E 56 11011110 0
E 58 11011111 0
E 3a 010100001 0
E 2a 110111001 0
E 3c 1000011100 0
E 3d 1000011101 0
E 23 1000011110 0
E 24 1000011111 0
E 5b 1011010000 0
E 5c 1011010001 0
E 5d 1011011000 0
E 5f 1011011001 0
E 21 1011011100 0
E 22 1011011101 0
E 3b 1011101101 0
E 3e 1011101110 0
E 3f 1011101111 0
E 28 1011110000 0
E 29 1011110001 0
E 2f 1011110011 0
E 27 1110100001 0
E 6a 1110100010 0
E 71 1110100011 0
E 78 1110100100 0
E 7a 1110100101 0
S 3 010 - 0
E 00 00000000 0
E 01 00000001 0
E 02 00000010 0
E 03 00000011 0
E 04 00000100 0
E 05 00000101 0
E 06 00000110 0
E 07 00000111 0
E 08 00001000 0
E 09 00001001 0
E 0a 00001010 0
E 0b 00001011 0
E 0c 00001100 0
E 0d 00001101 1
E 0e 00001110 0
E 0f 00001111 0
E 10 00010000 0
E 11 00010001 0
E 12 00010010 0
E 13 00010011 0
E 14 00010100 0
E 15 00010101 0
E 16 00010110 0
E 17 00010111 0
E 18 00011000 0
E 19 00011001 0
E 1a 00011010 0
E 1b 00011011 0
E 1c 00011100 0
E 1d 00011101 0
E 1e 00011110 0
E 1f 00011111 0
E 20 00100000 2
E 21 00100001 2
E 22 00100010 2
E 23 00100011 2
E 24 00100100 2
E 25 00100101 0
E 26 00100110 0
E 27 00100111 2
E 28 00101000 2
E 29 00101001 2
E 2a 00101010 2
E 2b 00101011 0
E 2c 00101100 2
E 2d 00101101 2
E 2e 00101110 2
E 2f 00101111 2
E 30 00110000 2
E 31 00110001 2
E 32 00110010 2
E 33 00110011 2
E 34 00110100 2
E 35 00110101 2
E 36 00110110 2
E 37 00110111 2
E 38 00111000 2
E 39 00111001 2
E 3a 00111010 2
E 3b 00111011 2
E 3c 00111100 2
E 3d 00111101 2
E 3e 00111110 2
E 3f 00111111 2
E 40 01000000 2
E 41 01000001 2
E 42 01000010 2
E 43 01000011 2
E 44 01000100 2
E 45 01000101 2
E 46 01000110 2
E 47 01000111 2
E 48 01001000 2
E 49 01001001 2
E 4a 01001010 2
E 4b 01001011 2
E 4c 01001100 2
E 4d 01001101 2
E 4e 01001110 2
E 4f 01001111 2
E 50 01010000 2
E 51 01010001 2
E 52 01010010 2
E 53 01010011 2
E 54 01010100 2
E 55 01010101 2
E 56 01010110 2
E 57 01010111 2
E 58 01011000 2
E 59 01011001 2
E 5a 01011010 2
E 5b 01011011 2
E 5c 01011100 2
E 5d 01011101 2
E 5e 01011110 0
E 5f 01011111 2
E 60 01100000 0
E 61 01100001 2
E 62 01100010 2
E 63 01100011 2
E 64 01100100 2
E 65 01100101 2
E 66 01100110 2
E 67 01100111 2
E 68 01101000 2
E 69 01101001 2
E 6a 01101010 2
E 6b 01101011 2
E 6c 01101100 2
E 6d 01101101 2
E 6e 01101110 2
E 6f 01101111 2
E 70 01110000 2
E 71 01110001 2
E 72 01110010 2
E 73 01110011 2
E 74 01110100 2
E 75 01110101 2
E 76 01110110 2
E 77 01110111 2
E 78 01111000 2
E 79 01111001 2
E 7a 01111010 2
E 7b 01111011 0
E 7c 01111100 0
E 7d 01111101 0
E 7e 01111110 0
E 7f 01111111 0
E 80 10000000 0
E 81 10000001 0
E 82 10000010 0
E 83 10000011 0
E 84 10000100 0
E 85 10000101 0
E 86 10000110 0
E 87 10000111 0
E 88 10001000 0
E 89 10001001 0
E 8a 10001010 0
E 8b 10001011 0
E 8c 10001100 0
E 8d 10001101 0
E 8e 10001110 0
E 8f 10001111 0
E 90 10010000 0
E 91 10010001 0
E 92 10010010 0
E 93 10010011 0
E 94 10010100 0
E 95 10010101 0
E 96 10010110 0
E 97 10010111 0
E 98 10011000 0
E 99 10011001 0
E 9a 10011010 0
E 9b 10011011 0
E 9c 10011100 0
E 9d 10011101 0
E 9e 10011110 0
E 9f 10011111 0
E a0 10100000 0
E a1 10100001 0
E a2 10100010 0
E a3 10100011 0
E a4 10100100 0
E a5 10100101 0
E a6 10100110 0
E a7 10100111 0
E a8 10101000 0
E a9 10101001 0
E aa 10101010 0
E ab 10101011 0
E ac 10101100 0
E ad 10101101 0
E ae 10101110 0
E af 10101111 0
E b0 10110000 0
E b1 10110001 0
E b2 10110010 0
E b3 10110011 0
E b4 10110100 0
E b5 10110101 0
E b6 10110110 0
E b7 10110111 0
E b8 10111000 0
E b9 10111001 0
E ba 10111010 0
E bb 10111011 0
E bc 10111100 0
E bd 10111101 0
E be 10111110 0
E bf 10111111 0
E c0 11000000 0
E c1 11000001 0
E c2 11000010 0
E c3 11000011 0
E c4 11000100 0
E c5 11000101 0
E c6 11000110 0
E c7 11000111 0
E c8 11001000 0
E c9 11001001 0
E ca 11001010 0
E cb 11001011 0
E cc 11001100 0
E cd 11001101 0
E ce 11001110 0
E cf 11001111 0
E d0 11010000 0
E d1 11010001 0
E d2 11010010 0
E d3 11010011 0
E d4 11010100 0
E d5 11010101 0
E d6 11010110 0
E d7 11010111 0
E d8 11011000 0
E d9 11011001 0
E da 11011010 0
E db 11011011 0
E dc 11011100 0
E dd 11011101 0
E de 11011110 0
E df 11011111 0
E e0 11100000 0
E e1 11100001 0
E e2 11100010 0
E e3 11100011 0
E e4 11100100 0
E e5 11100101 0
E e6 11100110 0
E e7 11100111 0
E e8 11101000 0
E e9 11101001 0
E ea 11101010 0
E eb 11101011 0
E ec 11101100 0
E ed 11101101 0
E ee 11101110 0
E ef 11101111 0
E f0 11110000 0
E f1 11110001 0
E f2 11110010 0
E f3 11110011 0
E f4 11110100 0
E f5 11110101 0
E f6 11110110 0
E f7 11110111 0
E f8 11111000 0
E f9 11111001 0
E fa 11111010 0
E fb 11111011 0
E fc 11111100 0
E fd 11111101 0
E fe 11111110 0
E ff 11111111 0
S 4 011 01000 2
E 5554437d0d0a 0111 1
E 204f6e203230 1001 0
E 30 00 0
E 2d 101 0
E 32 0101 0
E 31 0110 0
E 3a 1000 0
E 20 1100 0
E 35 01001 0
E 37 11010 0
E 38 11011 0
E 36 11100 0
E 39 11101 0
E 33 11110 0
E 34 11111 0
S 5 100 1011001 8
E 2d4232465749484a4d245d0d 000 0
E 2d42324649484a4d245d0d 101110 0
E 2d4232465749484d245d0d 1011011 0
E 2d423246484d245d0d 010 0
E 3b50513a20 0010 7
E 3b50523a20 0011 7
E 3b20 1000 8
E 2e 11 0
E 31 011 0
E 0a 1010 0
E 35 101111 0
E 0d 1001000 1
E 37 1001001 0
E 34 1001010 0
E 39 1001011 0
E 30 1001100 0
E 32 1001101 0
E 20 1001110 2
E 33 1001111 0
E 38 1011000 0
E 36 1011010 0
S 6 101 100110 2
E 20 1010 7
E 0d 1011 1
E 45 00000 0
E 4c 00001 0
E 51 00010 0
E 53 00011 0
E 43 00100 0
E 47 00101 0
E 46 00110 0
E 4e 00111 0
E 44 01000 0
E 4a 01001 0
E 4f 01010 0
E 41 01011 0
E 49 01100 0
E 48 01101 0
E 42 01110 0
E 50 01111 0
E 52 10000 0
E 4b 10001 0
E 4d 10010 0
E 39 100111 0
E 59 110000 0
E 56 110001 0
E 5a 110010 0
E 54 110011 0
E 58 110100 0
E 32 110101 0
E 57 110110 0
E 38 110111 0
E 34 111000 0
E 31 111001 0
E 35 111010 0
E 36 111011 0
E 33 111100 0
E 37 111101 0
E 30 111110 0
E 55 111111 0
S 7 110 1110 2
E 20300d 110 1
E 31 00 0
E 20 10 0
E 0d 011 1
E 34 01000 0
E 39 01001 0
E 36 01010 0
E 32 010110 0
E 35 010111 0
E 37 111100 0
E 38 111101 0
E 30 111110 0
E 33 111111 0
S 8 111 01100101 2
E 495330475242 01100100 0
E 20444520 01001 0
E 574c324b 10010000 0
E 203e0d 110010 1
E 290d 101111 1
E 2028 110011 0
E 2d 0111 0
E 4b 1101 0
E 4d 00000 0
E 32 00001 0
E 36 00010 0
E 33 00011 0
E 39 00100 0
E 35 00101 0
E 44 00111 0
E 45 01011 0
E 37 01101 0
E 42 10000 0
E 34 10011 0
E 57 10100 0
E 41 10101 0
E 4e 11101 0
E 58 001100 0
E 30 001101 0
E 53 010000 0
E 5a 010001 0
E 50 011000 0
E 48 100010 0
E 4f 100011 0
E 49 100101 0
E 38 101101 0
E 4c 101110 0
E 56 110000 0
E 4a 110001 0
E 47 111000 0
E 43 111001 0
E 31 111100 0
E 46 111101 0
E 54 111110 0
E 52 111111 0
E 20 0110011 6
E 55 1001001 0
E 59 1011000 0
E 51 1011001 0
E 0d 10010001 1
E 0d 01010 1