VARAHF.com / Callsigns

Callsigns in the VARA HF protocol

How a station’s callsign is hashed, packed and carried on the air

1. Overview

A VARA HF station’s callsign reaches the air in five forms. Only three of them carry the callsign as readable text; the rest carry a hash of it or a byte derived from it.

Form Where it is used Readable by anyone?
Station hash (24 bits) Selects the tones of every control frame of a session No: it is never sent, it only seeds the tone choice
Packed callsign (6 bytes) The caller’s header frame at the start of a session Yes, by any station that decodes the frame
CQ callsign frame (6 bytes + CRC) After a CQ control frame Yes
Marker byte (8 bits) Padding of every data frame of a session Only as a check value
Morse ID End of a session Yes

All examples use the placeholder callsign N0CALL.

1.1 Which callsigns a station accepts

Every callsign a station is given (its own callsigns, a connect target, the callsign of a CQ) is first converted to upper case and then checked. A callsign that fails the check is refused; it never reaches the air.

The station keeps the callsign in this upper-case, checked form; everything below is computed from it.

2. The CRC

Every callsign function is built on one CRC-16:

crc = 0xFFFF
for each byte b:
    crc ^= b << 8
    repeat 8 times:
        crc = (crc << 1) ^ 0x1021 if crc & 0x8000 else crc << 1
        crc &= 0xFFFF
return crc ^ 0xFFFF

The CRC is taken over the callsign as the station keeps it (section 1.1): upper case, in ASCII, including any -SSID suffix exactly as it was written. The CRC of zero bytes is 0x0000.

3. The station hash

3.1 Definition

hash(call) = (crc(last 3 characters) >> 8) << 16  |  crc(whole call)

The low 16 bits are the CRC of the whole callsign. The high 8 bits are the high byte of the CRC of its last three characters, or of the whole text if it is shorter than three characters. An empty callsign (an unused alias slot) hashes to 0, since the CRC of zero bytes is 0.

3.2 Examples

Callsign CRC of whole call Last 3 chars CRC of last 3 Hash
N0CALL 0x0986 ALL 0xD817 0xD80986
N0CALL-3 0xDFAC L-3 0x2D25 0x2DDFAC
N0CALL-T 0xC3ED L-T 0x3164 0x31C3ED

3.3 Properties

4. How the hash selects the tones of control frames

4.1 Control frames carry no callsign

Control frames (connect requests and replies, acknowledgements, BREAK, IDLE, disconnect and the rest) are short MFSK codewords on a 23.4375 Hz tone grid. A frame says only which of 58 codes it is. Who it is for is expressed by which tones the codeword uses: every session draws its own codebook, a table of 58 tone sequences per control format, from VARA’s pseudo-random generator seeded with station hashes. A receiver recognises a frame when it matches one of the codewords it expects; a frame drawn from a different codebook looks like noise to it.

4.2 Drawing a codebook

A codebook has two sides: the codewords a station expects to receive and the codewords it sends. Each side has an offset, 50 for the caller and 278 for the answerer; the receive side uses the peer’s offset and the send side the station’s own. For each side and each control format f (0, 1, 2), with off = f + side offset:

  1. Seed the generator with link_seed + 10 + off.
  2. Draw the codewords of codes 1 to 58 in order, reseeding first for these codes:

The tone-drawing procedure for one codeword (tone families per bandwidth, bases 14 bins apart, two tones per symbol in format 2) is the same for every code and is described with the control-frame format.

4.3 Which hashes are used when

Station’s situation Link seed Role (side offsets) Extra “connect codes”
Listening for calls 0 answerer none
Calling a station hash(called station) caller drawn from hash(own call) when the call starts
Linked, as the caller hash(peer) caller drawn from hash(own call)
Answering or linked, as the answerer hash(own callsign that was called) answerer drawn from hash(peer), once known

Connect codes. BREAK and IDLE are drawn again from a second seed: offsets 1078 (answerer) and 850 (caller); per side and format, seed f + connect_seed + offset, then draw BREAK, then IDLE. The connect seed is the caller’s own hash. The caller redraws them when it starts the call; the answerer redraws them when the header frame has told it who is calling. Turn changes are therefore bound to both stations of the link.

Aliases. A station may register up to five callsigns (MYCALL c1 c2 c3 c4 c5; more than five is refused, unused slots are empty and hash to 0). Its listening codebook contains connect-request codewords for each of them, so it answers calls to any alias. When a connect request for alias a arrives, the station takes the hash of alias a as its link seed for the session.

The unproto codebook. A station sending a CQ draws its codebook with link seed 0 on the caller side, 500 Hz layout. The other hashes do not matter: the CQ and KISS codewords come from the fixed seeds above. A listening station’s own codebook (link seed 0, answerer side) already expects these codewords on its receive side, so every station can decode them.

4.4 What a receiver can and cannot decode

5. The packed callsign (header frame)

5.1 Packing

Six bytes hold eight 6-bit codes, most significant bits first. The characters use the alphabet " ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", a character’s code being its position in it:

Characters Code
space (padding) 0
A–Z 1–26
0–9 27–36

No other character can occur, because the callsign was checked when it was set (section 1.1).

SSID text Code 8
none 0
1–19 (01–09 also) 1–19
T 16
R 17
X 18
L 19

The numbers 16 to 19 and the letters T, R, X, L share codes: N0CALL-16 packs exactly like N0CALL-T and is unpacked as N0CALL-T. A base never has more than seven characters (section 1.1), so it never reaches the SSID position.

5.2 Examples

Callsign Codes Packed bytes
N0CALL 14 27 3 1 12 12 0 · 0 39 B0 C1 30 C0 00
N0CALL-3 14 27 3 1 12 12 0 · 3 39 B0 C1 30 C0 03
N0CALL-T 14 27 3 1 12 12 0 · 16 39 B0 C1 30 C0 10

5.3 Unpacking

Read the 48 bits as eight 6-bit codes. Map codes 1–7 through the alphabet (code 0 is a space; a code above 36 gives no character) and remove trailing spaces. Take the low five bits of code 8: 16–19 append -T, -R, -X or -L, any other non-zero value appends - and the number in decimal, 0 appends nothing.

5.4 The header frame

The caller’s first data frame identifies it:

packed callsign (6) | 0x00 | flags | 0x14 marker 0 ... | offered level | control | CRC-16

6. The CQ callsign frame

A CQ is a CQ control frame (unproto codebook), a short silence, then one 8-byte data frame on row 15 of the 500 Hz table (an FSK level). The silence is 40 ms (1920 samples at 48 kHz) and the control frame is sent in format 0 (both unconfirmed). The frame uses its own packing, different from the header’s:

Only SSIDs 0–15 survive the trip. A letter SSID has numeric value 0 and is sent as no SSID. The SSIDs 16–19, which the callsign check accepts, spill into the bandwidth bits: N0CALL-16 calling at 500 Hz is received as N0CALL at 2300 Hz.

The receiver reads the SSID from the low four bits of the field and the bandwidth from the two bits above them, and leaves the bandwidth empty when those bits are 0.

Example, N0CALL-3 calling at 500 Hz: fields 14 27 3 1 12 12 0 · 19 (1 × 16 + 3), frame 39 B0 C1 30 C0 13 8C 0C.

A receiver accepts the CQ control frame only when chat mode is on (CHAT ON or LISTEN CQ); otherwise it ignores the CQ entirely. After the control frame it switches to row 15 of the 500 Hz table and looks for the callsign frame until four lead-ins plus one frame airtime have passed. It reports a decoded CQ to its host program as CQFRAME <call> <bandwidth>.

Host programs may give SSIDs on CQs their own meaning (for example, which nearby frequency the caller will listen on, or that the transmission is a beacon); the modem treats the SSID as part of the callsign.

7. The marker byte

When a data frame’s payload does not fill its capacity, the payload is followed by the terminator 0x14, then the marker (if there is room for it), then zeros. The marker is the high byte of the CRC-16 of the calling station’s callsign; the values 0x00 and 0x14, which would be ambiguous, become 0x01. Both directions of a session use the caller’s marker, so every padded frame carries a small check that it belongs to this session. A receiver looks for the last 0x14 in the field and accepts it as the terminator only when it is followed by the marker, a zero or the end of the field.

Example: the CRC of N0CALL is 0x0986, so a session called by N0CALL uses marker 0x09.

8. The Morse ID

At the end of a session that reached the connected state, a station may send its base callsign (the SSID removed) in Morse. The answerer sends the callsign it was called on. The ID is sent when the station’s own CW ID option is on, or when its base callsign is shaped like a United States amateur callsign, whatever the option says. The host commands CWID ON and CWID OFF are accepted but change nothing.

A base callsign counts as United States-shaped when all of these hold:

So N0CALL (prefix of 1, suffix of 4) qualifies, N0C (three characters) does not, and a callsign of the form NA1ABC does not while KA1ABC does.

A station that will not send an ID signals it in its disconnect: it sends the “disconnect without CW ID” code instead of the plain disconnect code.

9. Summary

Need Mechanism
Address a connect request to a station Codewords drawn from the called station’s hash
Answer calls to several callsigns Up to five aliases, each with its own connect-request codewords
Tell the answerer who is calling Packed callsign in the header frame
Keep sessions apart on a busy frequency Codebook drawn from the link seed; BREAK/IDLE also from the caller’s hash
Let everyone hear a CQ Unproto codebook plus a readable callsign frame
Check a data frame belongs to the session Marker byte from the caller’s callsign
Identify the station by ear Morse ID