/ccsds

Open source Java implementation of publicly available CCSDS standards: SLE, TM/TC, AOS, Space Packets, COP-1, time formats, CFDP.

Primary LanguageJavaApache License 2.0Apache-2.0

Build

FOSSA Status

An open source implementation of CCSDS protocols and formats in Java 11

This repository contains an attempt to code an open source, not validated (but hopefully working and performant) implementation of some of the public available CCSDS standards (Time Code Format, SLE, TM/TC/AOS, Space Packet, COP-1) and support utilities. The implementation has been done in Java and follows the latest modular changes in the Java platform since version 9.

Stable releases are published on Maven Central. The latest code version is always available on the master branch here on GitHub.

Disclaimer: this code is implemented as personal hobby, without any use of external systems or software to test or validate its behaviour (it is neither operationally nor effectively tested). It is not endorsed by any organization, association or company. As such, strict compliance to the different standards as well as correct behaviour cannot be guaranteed. As the Apache License makes clear, use the modules of this repository at your own risk.

SLE

The SLE User Test Library (eu.dariolucia.ccsds.sle.utl) is a test library that implements the user side (fully compliant) and provider side (partially compliant) of an SLE data exchange session. It supports RAF, RCF, ROCF and CLTU. Support for FSP is currently missing. It uses a custom format for the configuration of the service instances (currently not documented, can be derived by the classes inside the "config" package). Highlights are:

  • support of multiple SLE versions
  • support of credentials encoding SHA-1 and SHA-256 independently from the SLE version
  • support of user and provider as initiator
  • light codebase, as it heavily relies on the generated code from the ASN.1 definitions

A simple but effective graphical interface to inspect the user-side peer is provided as separate module (eu.dariolucia.ccsds.sle.utlfx).

TM/TC

The TM/TC Library (eu.dariolucia.ccsds.tmtc) is a library that provide support to parse and build CCSDS TM frames, TC frames, AOS frames, Space Packets and full FARM/FOP implementation for COP-1. It allows encoding/decoding of space packets into TM frames, TC frames or AOS frames. It also provides some basic encodings (e.g. CLTU encoding/decoding, randomization, FECF encoding/checking, Reed-Solomon encoding/checking) but no error correction capabilities.

A simple graphical interface to inspect TM/TC/AOS/Space Packet data as stream is provided as separate module (eu.dariolucia.ccsds.inspector). It is possible to implement custom connectors to allow inspection of data delivered from a custom source/protocol/format by providing a new service (in Java 11 terms) implementing the interface eu.dariolucia.ccsds.inspector.api.IConnectorFactory. Some connectors to read data from file or socket are already available.

ENC/DEC

A packet identification/encoding/decoding library, which supports basic data types (integer, real, enumeration, CCSDS absolute and relative time formats, strings, octet streams, bit streams), array structures, ECSS TM/TC PUS headers, as derived from the ECSS Packet Utilisation Standard (http://everyspec.com/ESA/download.php?spec=ECSS-E-70-41A.047794.pdf), with main focus on performance.

Encoding performance has not been measured yet.

The packet structure is defined using a custom XML format definition, built by means of JAXB annotations.

Examples

A modules providing examples on how to use the three modules above in a combined way, to demonstrate the capabilities of the library to write compact code. The following examples are provided:

  • TM generator with output to file and/or TCP socket, from packet definition to TM CADU or TM frame;
  • TM processor with output to console, from CADU or TM frames read from a TCP socket to encoded parameter extraction;
  • TM processor with output to console, from SLE RAF to encoded parameter extraction;
  • TC generator from list of parameters (as defined in the packet definition) to CLTU with output to file and/or TCP socket;
  • TC generator from list of parameters to SLE CLTU;
  • TC processor with output to console, from CLTU to encoded parameter extraction.

The main target of the examples module is not to provide final applications ready to be used, rather to explain the different levels and concepts of the libraries, and how to link the various objects together.

Data Viewer

To ease the debug and visualisation of encoded information in telemetry and telecommand data, the module viewer (eu.dariolucia.ccsds.viewer) contains an application that can display decoded and structure information from all the data types supported by this library (CADUs, TM frames, AOS frames, TC frames, CLTU, Space Packets, all SLE operations, time encodings, CLCW).

Goals

The purpose of this repository is to produce, as far as my possibilities allow, simple, well-designed, well-documented, well-tested code with top performance. For each module (examples and tools excluded) I have the following targets:

  • full CI integration with Travis CI;
  • at least 90% line coverage with unit tests (measured by JaCoCo and reported in Sonarcloud);
  • a set of performance tests;
  • no warnings when compiling;
  • a reasonable quality gate, with reasonable QA metrics measured by Sonarcloud;
  • good documentation at package, class, instance variable and method level;
  • provide specific code, and not generic, one-fits-all code: generic code is usually slow because it is over-engineered. Here simplicity is the key.

Each module is built using Maven and can be compiled out of the box (if all its dependencies are satisfied) with Maven. If you want to compile them all in one go, just run 'mvn clean install' on the root folder.

License

All original source code on this repository is released under the terms and conditions of the Apache License 2.0. The source code includes code and resources from other authors, which can be freely obtained from the web. To be more specific:

All other source code and resources, such as test data files, FXML and some images are genuine new implementation or generated using the library itself (e.g. TM data file, SLE configuration file). These resources are therefore released under the terms of the Apache License, 2.0.

As a general rule, I tried to make sure that each external contribution is acknowledged where the contribution appears. Each module contains a NOTICE file that contains all the required attributions. By using any of the resources on this repository, you need to comply with the terms and conditions of the Apache License, including the distribution of the NOTICE files of the modules you use/modify in any software/products you deliver commercially or free of charge, in binary or source code. A copy of the relevant licenses must be provided: I usually include the relevant links in the NOTICE file.

Make sure you comply with all license terms. I take this point very seriously. Really.

If by any chance I forgot/missed to provide due credits to authors or I made inappropriate use of any license terms, please contact me here on GitHub.

Acknowledgements

I would like to thank the people behind the following technologies/libraries, which the code in this repository depends on. Too often we give things for granted, forgetting the amazing amount of work that people spend everyday to deliver good resources, efficient code and effective solutions to everybody free of charge:

A special mention goes to the people that took some of their time to contribute to this project by providing improvements via Pull Requests:

  • Alessio Di Fazio, for the POM update to generate OSGi compliant bundles;
  • Javier Peña, for the .gitignore and POM update to improve the support in Eclipse IDE;
  • @nculijun for the approach to package UI applications into self-executable JARs;
  • @sv5d for bug fixes to the SLE code.

Contributions

If you find any issue with the provided code or you would like to see a specific feature implemented, please raise a request on GitHub. If you spot and fix any issue by using the provided code, please consider contributing back to the project, by raising the issue on GitHub, hopefully with your solution attached and/or a pull request :)

I am not looking for active contributors, because I would pretend from them the same goals I set a few paragraphs above. However, if you want to actively contribute to this project and you think you can accept my way of dealing with the code, please contact me :)