Skip to content

Instantly share code, notes, and snippets.

@yvbbrjdr
Last active December 23, 2024 16:58
Show Gist options
  • Save yvbbrjdr/1d7b0c83f1c86337b2cb00071eacc8bd to your computer and use it in GitHub Desktop.
Save yvbbrjdr/1d7b0c83f1c86337b2cb00071eacc8bd to your computer and use it in GitHub Desktop.

NeoArpe Protocol Specification

NeoArpe stands for Neo Amateur Radio Packet Exchange. It is a packet radio protocol for amateur radio communication. All data in this protocol, unless otherwise noted, is transmitted in big-endian format.

Physical Layer (PHY)

Preamble Version Payload Length CRC-32 Payload Error Correction
8 bits 4 bits 12 bits 32 bits Variable TBD

Modulation

The modulation is 2-AFSK. Both sides need to agree on the baud rate, mark frequency, and space frequency. Parameters can be chosen arbitrarily based on specific conditions and requirements.

Preamble

The preamble byte is 0b01010101 (0x55). It is used for synchronizing the demodulator with the modulator.

Version

A 4-bit version field. For this protocol, it is 0b0001 (0x1).

Payload Length

The length of the payload. The maximum length is 4095.

CRC-32

The CRC-32 checksum of the payload.

Payload

The data payload itself, which corresponds to the data link layer.

Error Correction

TBD. Possibly Reed-Solomon and/or convolutional coding.

Data Link Layer

Destination Callsign Source Callsign Upper Layer Protocol Payload
48 bits 48 bits 8 bits Variable

Destination Callsign

The destination callsign. The 48 bits are divided into 8 groups of 6 bits. The first 7 groups are the callsign itself, and the last group is the SSID (Secondary Station IDentifier). The callsign characters are encoded so that 0-9 is 0-9, A-Z is 10-35, and NULL is 36. If the length of the callsign is less than 7 characters, the remaining characters are NULL. The SSID is encoded as a number. If a packet is broadcast, the destination callsign is CQ.

Source Callsign

The source callsign. The format is the same as the destination callsign.

Upper Layer Protocol

The upper layer protocol. For IPv4, it is 0b00000100 (0x04). For IPv6, it is 0b00000110 (0x06). For other protocols, it is custom-defined.

Payload

The data payload itself, which corresponds to the network layer or directly to the application layer.

Arpegram

Arpegram is an application layer messaging protocol on top of the data link layer. The protocol ID is 0b00000000 (0x00). It's a simple protocol that allows for sending messages between stations. Each message is a JSON object following the schema below.

{
  "type": "msg",
  "data": {
    "id": "uuid",
    "msg": "message",
    "loc": {
      "lat": 0.0,
      "lon": 0.0
    }, // Optional
    "ts": 0
  }
}

To acknowledge a message, the receiver sends an ACK message.

{
  "type": "ack",
  "data": {
    "id": "uuid",
    "loc": {
      "lat": 0.0,
      "lon": 0.0
    }, // Optional
    "ts": 0
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment