All docsStellar ControlMission control · by Stellar Systems v1.1.0

SDKs and Integration

Extending Stellar Control

Drivers, transports, gateways, output connectors and pass feeders talk to Stellar Control through a NATS contract.

The core of Stellar Control never touches a byte of a target. Everything that depends on a platform, a medium or a downstream system lives in external components: processes outside Stellar Control that talk to it through NATS only (or, for pass feeders, through the HTTP API). This section explains how to write them.

License#

The SDKs — Rust stellar-common, stellar-contract and stellar-sdk, Python stellar-control — are under the Apache License 2.0: you may write, ship and sell drivers, transports, gateways and connectors built with them, under the license of your choice. The CLI is free to use; the core of Stellar Control runs under the license of each cell.

The components you can write#

ComponentWhat it doesTalks throughContract
DriverEncodes semantic telecommands into bytes (ACK 1), decodes telemetry into raw values, recognises echoes, extracts file chunks, decodes recorded filesNATSDriver contract
TransportFrames the units of a driver for a medium (CCSDS TC frames under COP-1, CSP over KISS…), and backNATSDriver contract, Transports
GatewayCarries frames to and from a ground station, a bench or an EGSE (ACK 2), reports link availability and throughputNATSGateway contract
Output connectorConsumes the data of Stellar Control to store it (a time-series database) or relay itNATS (JetStream consumers)Connector contract
Pass feederPushes the passes of a flight dynamics system or a ground station providerHTTP APIPOST /v1/passes, POST /v1/passes/replace_window
flowchart LR
    subgraph CORE["Core of Stellar Control"]
      EX[Executor]
      CO[Compute stage]
      RE[Reconciler]
    end
    EX -- "SemanticTc<br/>stellar.tc.encode.*" --> D[Driver]
    D -- "unit<br/>stellar.tc.wrap.*" --> T[Transport]
    T -- "frame<br/>stellar.tc.uplink.*" --> G[Gateway]
    D -. "frame (no transport)" .-> G
    G -- "raw frame<br/>stellar.tm.raw.*" --> T
    T -- "unit<br/>stellar.tm.unit.*" --> D
    D -- "RawSample[]<br/>stellar.tm.decoded.*" --> CO
    RE -- "bindings, credentials" --> D & T & G
    CORE -- "JetStream consumers" --> C[Output connector]
    F[Pass feeder] -- "HTTP" --> API[API]

The contract is the interface#

The contract is JSON over NATS, independent of any language: registration, heartbeats, control verbs, bindings and the data plane. Stellar Control checks it at registration and binds only the instances that fit the topology. The NATS contract reference lists every subject, header and message; stellar schema <kind> prints the JSON Schema of each message.

Two SDKs implement it, so that a component only declares what it does:

Rust SDKPython SDK
Packagecrate stellar-sdk, with stellar-contract and stellar-commonpackage stellar-control (module stellar_control)
DriverDriver trait, driver_main / run_driverDriver with @driver.encode, @driver.decode, @driver.echo, @driver.chunks, @driver.decode_file
TransportTransport trait, transport_main / run_transportTransport with @transport.wrap, @transport.unwrap
GatewayGateway trait, run_gatewayGateway with @gateway.send, @gateway.receive, @gateway.link_available
Output connectorConnector trait, run_connectorConnector with @connector.on("<kind>")
Pass feeder— (plain HTTP)PassFeeder
Own control verbsRpc trait@component.rpc("verb")
COP-1 in a transportyes (Transport::cop1, Transport::clcw)no
CFDP entity in a driveryes (Driver::cfdp and friends)no
Protocol helpersCCSDS space packets and frames, CLCW, COP-1 FOP and FARM, CFDP entity, CSP 1/2, KISS, CAN frames, CSP over CAN (CFP)CSP 1/2, CAN frames, CSP over CAN (CFP)
Prometheus endpointyes (STELLAR_METRICS_ADDR)no

Both SDKs handle the same chores: the nkey key pair, registration with retries, the JWT issued by the reconciler and its renewal, heartbeats, the common control verbs (status, credentials, bindings, reregister), subscriptions derived from the bindings, JetStream consumers, telecommand events (ACK 1 and ACK 2), deadlines, fragments and reconnection.

A component in another language sends the same messages: nothing in Stellar Control knows which SDK, if any, a component uses.

Choosing#

  • Python for a quick integration, a bench instrument, a text protocol, a connector or a feeder script: a driver of a SCPI power supply is a few dozen lines. The driver of the HSC-100 camera in the Payload integration use case (drivers/hsc_100, made with stellar generate driver) is a complete one over CSP.
  • Rust for flight links: CCSDS framing, COP-1, CFDP, strict timing, test vectors replayed bit for bit, and a Prometheus endpoint.
  • Any language when a component must live in an existing code base: follow the NATS contract.

Layering#

The SDKs depend on nothing of the core: a component embeds the contract and the SDK, never the core, and the core does not need the SDK. What a component of Stellar Systems does, a team outside Stellar Control can do.

Reference components#

Reference components built on the SDK alone ship with it, on request: drivers (SCPI-like text lines, PUS-C packets behind CCSDS TC frames, CSP 1 packets, a partial driver on a CAN bench bus, an RF bench through its control plane), transports (CCSDS TC frames under COP-1, CSP over KISS, CSP over CAN), gateways (SocketCAN, an RF bench with a REST and ZeroMQ interface, a minimal logging gateway), the TimescaleDB output connector, and their Python counterparts (a driver, a TCP gateway, a CSV connector, a CSP over CAN transport, a pass feeder). They are the best starting points.

How a component joins a target#

  1. The topology declares a link of a target with a driver (by name and version, cubesat-6u-csp@1), an optional transport and a gateway (by name, or a tag constraint such as any(tag: sband)).
  2. The component starts with bootstrap credentials limited to registration and heartbeats, and registers: software name and version, and what it implements.
  3. The reconciler checks the registration, binds the instance to the links it fits, issues it a JWT with exactly the permissions of its bindings, and sends it its bindings.
  4. The component subscribes to the subjects of its bindings; the target becomes ready when every link has a driver, a transport when declared, and a gateway bound.

See Drivers, Transports and Gateways for the binding rules seen from the topology.

↑↓ to moveEnter to open