Optical Communications Coding and Synchronization (CCSDS 142.0-B)

Files
README.md

occs #

Optical Communications Coding and Synchronization (CCSDS 142.0-B).

Overview #

A laser link to a spacecraft carries the same transfer frames as a radio link, but the laser needs to know which time slots to pulse, and the coding must survive a channel where every detected photon counts. CCSDS 142.0-B-1 and its 142.0-P-1.1 pink sheets (the draft revision of a published CCSDS Blue Book, circulated to the agencies for review) define that Coding and Synchronization sublayer. It sits between a Data Link Protocol (TM, AOS or USLP transfer frames) and the optical Physical Layer (CCSDS 141.0-B), and turns frames into the binary vector that drives the laser.

The package implements three signalling chains:

  • Occs.Hpe is High Photon Efficiency telemetry for photon-starved deep space links. It uses SCPPM coding (a serially concatenated convolutional code with a permutation interleaver and an accumulator) over M-ary pulse position modulation, with convolutional channel interleaving and codeword sync markers. In M-ary pulse position modulation (PPM) each symbol is a frame of M time slots of which exactly one carries a laser pulse, so one pulse carries log2 M bits: 16-PPM carries 4 bits per pulse.
  • Occs.Beacon is the HPE beacon channel carrying AOS or USLP frames, with short LDPC codes over 2-PPM and PN spreading.
  • Occs.O3k is Optical On-Off Keying telemetry for near-Earth links with a high photon flux. It uses Reed-Solomon (255, 223) or QC-LDPC coding (a rate-1/2 PBRL and a rate-9/10 ARA code), block channel interleaving, and Gold-code sync-layer framing with in-band signalling.

Encoders are pure functions from transfer frames to slot vectors; the decode functions implement the corresponding hard-decision receive paths and are exact inverses on clean channels. Soft-decision decoding is out of scope.

Supporting modules: Occs.Bits (bit vectors, since HPE block sizes are not byte multiples), Occs.Prbs (the two pseudo-randomizers), Occs.Gold (the 65 preferred Gold sequences of annex D), Occs.Crc (the bit-level SCPPM CRC-32), Occs.Scppm and Occs.Qc_ldpc (the two code families specific to this standard).

Installation #

Install with opam:

$ opam install occs

If opam cannot find the package, it may not yet be released in the public opam-repository. Add the overlay repository, then install it:

$ opam repo add samoht https://tangled.org/gazagnaire.org/opam-overlay.git
$ opam update
$ opam install occs

Specifications #

  • CCSDS 142.0-B-1, Optical Communications Coding and Synchronization (HPE), August 2019.
  • CCSDS 142.0-P-1.1, Non-Coherent Optical Communications Coding and Synchronization (adds O3K), draft pink sheets, November 2023.
  • CCSDS 141.0-B-1, Optical Communications Physical Layer (the layer below; not implemented here).
  • CCSDS 415.1-B-1, 5.3 (the Gold code generator referenced by annex D).

The ccsds package carries text conversions of these books. The LDPC exponent tables of annex C are transcribed in lib/qc_tables.ml and regenerated by scripts/extract_annex_c.py, which validates the submatrix structure of the standard while parsing.

Known limitations #

Optical ranging (142.0-P-1.1 section 6) is implemented in lib/ranging.ml: ranging codeword assembly for every row of table 6-1, CWID/RCID extraction, the 38-octet ranging bit field, and synchronous-mode RSM periodicity. What this package deliberately does not own, being outside the coding and synchronization sublayer: computing or measuring the E value (spacecraft clock and timing hardware). E is the uplink ranging phase: the phase of the received uplink ranging signal that the spacecraft records once per downlink ranging codeword, so that the ground can work out the two-way light time. It travels in the first 8 octets of the ranging bit field as the rounded value of E x 2^28, a fixed-point number with 28 fractional bits (Occs.Ranging.e_field, 142.0-P-1.1 section 6.6.3.2.2). Also outside it are the ground-side two-way light-time arithmetic and the marker constants and channel codecs of table 6-1's TM/TC rows (those belong to CCSDS 131.0-B and 231.0-B).

Soft-decision decoding (SCPPM iterative decoding, QC-LDPC belief propagation over noisy channels) is not implemented; the receive paths are hard-decision.

No public test vectors exist for the O3K QC-LDPC codes, so those codes rest on structural tests anchored in the standard alone. A roundtrip test cannot catch an encoder and a decoder that are wrong in the same way; an interop trace against an independent implementation would. That trace is the planned follow-up, and the EDHPC'25 FPGA work may publish one to compare against.

Spec erratum (142.0-P-1.1). Section 6.6.3.3.3's worked 256-PPM RCID example packs into 14 octets, but section 6.6.3.3.1 and figure 6-2 mandate a 15-octet RCIDu field (8 + 15 + 15 = 38, matching 6.6.3.1.1). lib/ranging.ml implements the normative 15-octet width. The erratum should be reported to CCSDS while the Pink Book is in review.

  • scc implements the RF Synchronization and Channel Coding sublayer (131.0-B, 231.0-B). This package reuses its ASM constant, randomiser sequence and RS(255, 223) code.
  • ldpc provides the LDPC codes of the HPE beacon chain.

License #

ISC License. See LICENSE.md for details.