astro

command module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

README

Astro

Go Reference License

Astro is a Go library and CLI implementing CCSDS and ECSS space communication standards, the protocols NASA, ESA, JAXA and other agencies use to talk to spacecraft.

22 standards, from channel coding up to mission operations. pkg/ takes no dependencies outside the Go standard library.

Documentation | Protocols | CLI | Conformance

Install

Requires Go 1.26 or later.

go get github.com/ravisuhag/astro                # library
go install github.com/ravisuhag/astro@latest     # CLI

Library

// A telemetry packet from application 100.
packet, _ := spp.NewTMPacket(100, []byte("temperature=22.5"))
encoded, _ := packet.Encode()

// Framed for the downlink: spacecraft 42, virtual channel 0.
frame, _ := tmdl.NewTMTransferFrame(42, 0, encoded, nil, nil)
frameBytes, _ := frame.Encode()

// Sync marker attached, ready for the radio.
cadu := tmsc.WrapCADU(frameBytes, tmsc.DefaultASM(), true)

That is the chain by hand. pkg/stack builds both ends of it from one configuration value, so the spacecraft and the ground station cannot drift apart.

Start with the Go quickstart, then build a downlink.

CLI

# Encode a telemetry Space Packet, then look at what you built
astro spp encode --apid 100 --type tm --data 68656c6c6f | astro spp inspect --input hex

# Encode with a CRC and check it
astro spp encode --apid 100 --type tm --data a1b2c3d4 --crc | astro spp validate --input hex --crc

22 commands, one per protocol: spp epp tm tc aos usdl pxdl cadu cltu pxsc ocsc sdls cop time xtce pus ldc rhc cfdp ltp bp sle.

Every one takes encode, decode, inspect and friends, reads stdin and writes stdout. Run astro manual for the reference built into the binary, or see the CLI docs.

Protocols

Every standard, its package, and its conformance statement: the protocol index.

Packets SPP | EPP, data link TM | TC | AOS | USLP | Proximity-1, coding TMSC | TCSC | PXSC | OCSC (reliability COP-1) security SDLS, files and DTN CFDP | LTP | BP (ground SLE) compression LDC | RHC, mission time codes | PUS | XTCE.

Each package ships a conformance statement saying what it implements clause by clause, and what it does not.

Examples

Fifteen runnable programs, each with a walkthrough under guides.

# The core chain
go run ./examples/downlink/          # telemetry, spacecraft to ground
go run ./examples/uplink/            # commands, with COP-1 reliable delivery
go run ./examples/lossylink/         # the same downlink under frame loss
go run ./examples/duplex/            # both directions, with the CLCW riding home
go run ./examples/composed/          # both ends from one configuration

# What the bytes mean
go run ./examples/pus/               # five ECSS services working together
go run ./examples/xtce/              # decoding from a mission database
go run ./examples/timecorrelation/   # a drifting clock turned into real time

# Moving more than a packet
go run ./examples/cfdp/              # a file, with the hole in it filled
go run ./examples/dtn/               # store and forward over BP and LTP

# High rate and protected
go run ./examples/aos/               # packets, a bitstream, and opaque blocks
go run ./examples/sdls/              # AES-GCM and AES-CMAC, plus three attacks
go run ./examples/compression/       # Rice coding and POCKET+

# Ground segment
go run ./examples/sle/               # an SLE session over a real TCP connection
go run ./examples/capture/           # writes a capture to practise debugging on

Contributing

Several standards are still unimplemented and open.

Read contributing (especially the rule about never coding a constant or field layout from memory) and adding a protocol. Open an issue to discuss your approach first.

License

Apache 2.0.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
examples
aos command
Example: A high-rate downlink with AOS
Example: A high-rate downlink with AOS
capture command
Example: Making a capture to practise debugging on
Example: Making a capture to practise debugging on
cfdp command
Example: Downlinking a file with CFDP
Example: Downlinking a file with CFDP
composed command
Example: Both ends of a downlink from one configuration
Example: Both ends of a downlink from one configuration
compression command
Example: Compressing data before you downlink it
Example: Compressing data before you downlink it
downlink command
Example: Telemetry from a spacecraft to a ground station
Example: Telemetry from a spacecraft to a ground station
dtn command
Example: Store and forward for deep space
Example: Store and forward for deep space
duplex command
Example: A full-duplex link, with the CLCW riding home
Example: A full-duplex link, with the CLCW riding home
lossylink command
Example: A lossy RF link, and how CCSDS telemetry copes
Example: A lossy RF link, and how CCSDS telemetry copes
pus command
Example: A PUS service model
Example: A PUS service model
sdls command
Example: Encrypting and authenticating a link
Example: Encrypting and authenticating a link
sle command
Example: Pulling telemetry from a ground station with SLE
Example: Pulling telemetry from a ground station with SLE
timecorrelation command
Example: Putting a real timestamp on telemetry
Example: Putting a real timestamp on telemetry
uplink command
Example: Telecommands from a ground station to a spacecraft
Example: Telecommands from a ground station to a spacecraft
xtce command
Example: Decoding telemetry from a mission database
Example: Decoding telemetry from a mission database
internal
cmac
Package cmac implements the AES-CMAC message authentication code of NIST SP 800-38B, also published as RFC 4493.
Package cmac implements the AES-CMAC message authentication code of NIST SP 800-38B, also published as RFC 4493.
pn
Package pn generates the CCSDS pseudo-randomizer sequences used by the TM and TC synchronization and channel coding layers.
Package pn generates the CCSDS pseudo-randomizer sequences used by the TM and TC synchronization and channel coding layers.
pkg
aos
Package aos implements the CCSDS Advanced Orbiting Systems (AOS) Space Data Link Protocol per CCSDS 732.0-B-4.
Package aos implements the CCSDS Advanced Orbiting Systems (AOS) Space Data Link Protocol per CCSDS 732.0-B-4.
bp
Package bp implements the Bundle Protocol version 6 per RFC 5050, profiled for space missions by CCSDS 734.2-B-1.
Package bp implements the Bundle Protocol version 6 per RFC 5050, profiled for space missions by CCSDS 734.2-B-1.
cfdp
Package cfdp implements the CCSDS File Delivery Protocol per CCSDS 727.0-B-5 (July 2020).
Package cfdp implements the CCSDS File Delivery Protocol per CCSDS 727.0-B-5 (July 2020).
cop
Package cop implements the Communications Operation Procedure-1 (COP-1) per CCSDS 232.1-B-2.
Package cop implements the Communications Operation Procedure-1 (COP-1) per CCSDS 232.1-B-2.
crc
Package crc provides CRC checksums used across CCSDS standards.
Package crc provides CRC checksums used across CCSDS standards.
epp
ldc
Package ldc implements CCSDS Lossless Data Compression per CCSDS 121.0-B-3, the Rice adaptive entropy coder.
Package ldc implements CCSDS Lossless Data Compression per CCSDS 121.0-B-3, the Rice adaptive entropy coder.
ltp
Package ltp implements the Licklider Transmission Protocol per RFC 5326, profiled for space links by CCSDS 734.1-B-1.
Package ltp implements the Licklider Transmission Protocol per RFC 5326, profiled for space links by CCSDS 734.1-B-1.
ocsc
Package ocsc implements the data-conditioning chain of the CCSDS optical communications coding and synchronization standard, CCSDS 142.0-B-1 (August 2019).
Package ocsc implements the data-conditioning chain of the CCSDS optical communications coding and synchronization standard, CCSDS 142.0-B-1 (August 2019).
pus
Package pus implements the ECSS Packet Utilization Standard, PUS-C, per ECSS-E-ST-70-41C (15 April 2016).
Package pus implements the ECSS Packet Utilization Standard, PUS-C, per ECSS-E-ST-70-41C (15 April 2016).
pxdl
Package pxdl implements the Proximity-1 Space Data Link Protocol per CCSDS 211.0-B-6 (July 2020), Data Link Layer.
Package pxdl implements the Proximity-1 Space Data Link Protocol per CCSDS 211.0-B-6 (July 2020), Data Link Layer.
pxsc
Package pxsc implements the Proximity-1 Coding and Synchronization Sublayer per CCSDS 211.2-B-3 (October 2019).
Package pxsc implements the Proximity-1 Coding and Synchronization Sublayer per CCSDS 211.2-B-3 (October 2019).
rhc
Package rhc implements Robust Compression of Fixed-Length Housekeeping Data per CCSDS 124.0-B-1, the POCKET+ algorithm.
Package rhc implements Robust Compression of Fixed-Length Housekeeping Data per CCSDS 124.0-B-1, the POCKET+ algorithm.
sdl
Package sdl provides shared data link primitives used by both TM (tmdl) and TC (tcdl) Space Data Link Protocol implementations.
Package sdl provides shared data link primitives used by both TM (tmdl) and TC (tcdl) Space Data Link Protocol implementations.
sdls
Package sdls implements the Space Data Link Security Protocol per CCSDS 355.0-B-2 (July 2022).
Package sdls implements the Space Data Link Security Protocol per CCSDS 355.0-B-2 (July 2022).
sdnv
Package sdnv encodes and decodes Self-Delimiting Numeric Values.
Package sdnv encodes and decodes Self-Delimiting Numeric Values.
sle
Package sle implements the foundation of the CCSDS Space Link Extension transfer services: the Internet SLE Protocol One transport, a BER codec for SLE protocol data units, ISP1 credentials, and the association handshake.
Package sle implements the foundation of the CCSDS Space Link Extension transfer services: the Internet SLE Protocol One transport, a BER codec for SLE protocol data units, ISP1 credentials, and the association handshake.
spp
stack
Package stack wires the protocol layers into a working pipeline.
Package stack wires the protocol layers into a working pipeline.
tcf
Package tcf implements CCSDS Time Code Formats per CCSDS 301.0-B-4.
Package tcf implements CCSDS Time Code Formats per CCSDS 301.0-B-4.
tcsc
Package tcsc implements the TC Synchronization and Channel Coding sublayer per CCSDS 231.0-B-4 (TC Synchronization and Channel Coding).
Package tcsc implements the TC Synchronization and Channel Coding sublayer per CCSDS 231.0-B-4 (TC Synchronization and Channel Coding).
tmsc
Package tmsc implements the TM Synchronization and Channel Coding sublayer per CCSDS 131.0-B-5 (TM Synchronization and Channel Coding).
Package tmsc implements the TM Synchronization and Channel Coding sublayer per CCSDS 131.0-B-5 (TM Synchronization and Channel Coding).
usdl
Package usdl implements the CCSDS Unified Space Data Link Protocol (USLP) per CCSDS 732.1-B-3.
Package usdl implements the CCSDS Unified Space Data Link Protocol (USLP) per CCSDS 732.1-B-3.
xtce
Package xtce implements the XML Telemetric and Command Exchange format, version 1.2, as published by the OMG and described by CCSDS 660.1-G-2.
Package xtce implements the XML Telemetric and Command Exchange format, version 1.2, as published by the OMG and described by CCSDS 660.1-G-2.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL