APRS-AX.25.en

Radioamatööriwikistä
(Ohjattu sivulta APRS-AX25.en)
Siirry navigaatioon Siirry hakuun

Finnish version is at APRS-AX.25 page

APRS uses variation of AX.25-link-layer protocol, which leaves several of AX.25 protocol details ignored.

The variations are very small, and usually possible to ignore. Just do not use any other protocol that uses UI frames with PID=0xF0.

AX.25-like link-layer and its differences

Used frame structure is per AX.25 v2.0 specification, not AX.25 v2.2.

  • Source callsigns are always identifying message sender
  • Destination callsigns indicate target group, most commonly "APRS", but also message originator specific software identifiers are used.
  • Digipeater fields use preferrably "New-N paradigm" style "WIDEn-N" or "TRACEn-N" values on frame origination, and the digipeaters will then place their callsigns on the via-field as trace information:
    • Original: N0CALL-9>APRS,WIDE2-2
    • After first digipeat either:
      • N0CALL-9>APRS,WIDE2-1
      • N0CALL-9>APRS,N1DIGI*,WIDE2-1
    • After second digipeat any of:
      • N0CALL-9>APRS,WIDE2*
      • N0CALL-9>APRS,N1DIGI*,WIDE2*
      • N0CALL-9>APRS,N1DIGI*,N2DIGI*,WIDE2*
    • ('*' means that H-bit on digipeater field's SSID byte has been set, and that other digipeaters must ignore those fields.)
  • Also several older token schemes in the via-fields are still recognized

Important differences on address field bit treatments:

  • Three topmost bits on Source and Destination address fields SSID bytes are never validated.
    • Most common values seen on radio transmissions are based on AX.25 v2.2 chapter 6.1.2 "Command" combinations: 011 for source, and 111 for destination.
    • In practice all 64 combinations of these 6 bits are apparent in radio networks. Receiver really must ignore them.
  • VIA address fields (digipeater fields) can be up to 8, AX.25 v2.2 changed earlier specification from 8 to 2 via fields, and thus AX.25 v2.2 is ignored here.
  • The topmost bit on SSID bytes of VIA address fields is "H" alias "Has been digipeated", and the two reserved ones should be "11", but only "H"-bit is used, and everybody ignores those two reserved bits!

After the AX.25 address fields, used control byte is always 0x03, and used PID byte is 0xF0. These are validated very commonly, so always do use correct values here!

1200 baud AFSK over NBFM radio

Primary transmission format is 1200 baud AFSK tone modulation over unmodified NBFM voice radios. Frequency depends on the area of operation. 144.390 MHz on USA, 144.800 MHz in Europe, etc.

Original datastream is at first run thru HDLC encoding, then NRZI encoding, and finally the NRZI datastream controls production of AFSK modulation tones:

  • For HDLC and NRZI processing see further below
  • AFSK tones are per Bell-202: 1200 Hz (for bit 1) / 2200 Hz (for bit 0)
  • Some use V.23 tones (1300 Hz / 2100 Hz), but that is not very common, nor fully compatible with Bell-202 tones

Use of HDLC and NRZI together means that there are no very long modulation data streams that are of same bit value. Receiver's bit clock recovery depends on finding alterations on transmit waveforms. Best source bit pattern for NRZI clock recovery is all zeros, and such should be used in preamble.


On audio modulation front there are two major way incompatible modes, and third which is a compromise in between:

  • Unmodified NBFM voice radios with microphone pre-emphasis and speaker de-emphasis, which results varying deviations (FM's presentation of signal amplitude) per modulated AFSK tones. (Emphasis is 6dB/octave.)
  • Modified NBFM voice radios, and systems with integrated modems without emphasis in AFSK->FM-modulator path. This includes Kenwood D7/D70/D700 series, Radiometrix receiver and transmitter modules, etc.
  • Third way modified systems with voice emphasis about half of normal value, which produces received signal tones with less difference than either normal voice de-emphasis receiver, or all flat receiver. (Emphasis is 3dB/octave.)

The microphone emphasis affects deviation so that 2200 Hz tone has deviation about double of that of 1200 Hz tone. Without this emphasis both tones have same deviation.

  • Similar emphasis systems receive tones with same amplitudes
  • When voice emphasis transmits, flat receiver hears two different amplitudes, high tone having about double amplitude of low tone.
  • When flat modulator transmits, a voice de-emphasis hears the low tone at about twice the amplitude of high tone.
  • A well functioning receiver needs to have dynamics to handle both cases without encountering distortion in the audio waveform, and the AFSK demodulator must be able to handle this radically different sinewave amplitude. This means that audio signal path to AFSK demodulator must have enough headroom to receive "excessively strong" tones, and simultaneously to have high enough audio level for weaker tone to be demodulated correctly.
  • Technically speaking, a flat (non-emphasized) modulator does produce better quality FM signal, but existing voice radios treat the received result in nasty ways.

In every case the modulation should have its deviation fitting within center 5 kHz of 25 kHz channel. There is no good definition of how to fit this modulation on narrower 12.5 kHz channel without partial signal overlap.

Often there is no way that an average user could adjust the signal amplitudes, or deviation. Nor even measure them.

Transmit preamble

For preamble before first HDLC flag, there should be at least 16 zero bits, which produce alternating bit pattern from NRZI encoding resulting then an alternating tone pattern, which enables quick bit synchronization achievement.

Duration of the preamble depends on transmitter, in particular on how long it takes to stabilize on correct center-frequency. Stabilization should be achieved for at least 4/1200 seconds before end of preamble, presuming that a receiver can catch up with correct bit clock phase from four AFSK bit transitions.


About HDLC and CRC-CCITT (16 bits)

HDLC is bit synchronous transmission of data, where encoded payload has never more than 5 consecutive high (1) bits. This allows transmission of arbitrary bit patterns without special treatment of any payload byte values, nor even requiring specific datastream to be exact multiple of 8 bits long.

Details:

  • AX.25 payload is always exact bytes long, never sending partial bits
  • Bytes in AX.25 payload are sent low bit first to HDLC processing
  • When payload would have more than 5 sequential 1 bits, the bit-stuffing algorithm inserts a zero bit after 5 consecutive one bits. Receiver removes these inserted zero bits.
  • FLAG sequences in HDLC separate payload frames, and fill also idle time in between data carrying frames. The flag sequence is: 0111,1110, and is separated from payload's raw representation by the zero-bit-stuffing rule.
  • If more than one data frame is sent in single transmission, those frames can be separated by anything from one to several flags. Single flag separation is called "back-to-back".
  • If more than one data packet is sent, the entire time after first data packet's ending flag until next packet's start flag must be filled with flags, not zero bits, nor anything else!
  • HDLC specification says that data is followed by 16 bits of CCITT-CRC sent out high bit first.
    • Calculating this CRC with reciprocal polynome permits sending it low bit first, where that may be necessary for extremely memory space sensitive assembly coding. Scott A Miller has example codes of this for OpenTracker use at his web: http://n1vg.net/packet/index.php


HDLC data to NRZI self-clocking bit stream

Converting HDLC to NRZI (and back) can be done with this circuitry, or equivalent software:

Packet-radio-hdlc-to-nrzi-conv.png

Main benefit here is that a stream of zero bits to NRZI encoder produces alternating output bits, and HDLC processing takes care of limiting the number of one bits to maximum of 6 in sequence before a zero is present.

Thus there will not be more than 6 bit times without alteration on modulation tone, and opportunity to re-tune the bit clock timing with the data stream.