Simple Geolocalization and Course Transmission Protocol (SGCTP)

A simple and low-footprint protocol to transmit geolocalization and course data

Author: Cédric Dufour <http://cedric.dufour.name>

Website: http://cedric.dufour.name/software/sgctp

Synopsis

The objective of the Simple Geolocalization and Course Transmission Protocol (SGCTP) is to transmit 2- or 3-dimensional position and motion data in such a way as to use as little bandwidth as possible, thus making it fit to aggregate data from roaming clients with limited network connectivity.

It can be used to:

Resources

The Simple Geolocalization and Course Transmission Protocol (SGCTP) source tree contains the following resources:

Copyright

The Simple Geolocalization and Course Transmission Protocol (SGCTP) is free software:
you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, Version 3.

The Simple Geolocalization and Course Transmission Protocol (SGCTP) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

See the GNU General Public License for more details.

The Simple Geolocalization and Course Transmission Protocol (SGCTP) includes all resources which contain the mention "Simple Geolocalization and Course Transmission Protocol (SGCTP)" in their preamble.

Other resources are (and must be) used according to their original license, which is (should be made) available from their respective author.

Build and Install

The first step is recovering the source code using the GIT versioning system:

mkdir /path/to/source && cd /path/to/source
git clone https://github.com/cedric-dufour/sgctp

Build environment configuration is then achieved using CMake:

mkdir /path/to/build && cd /path/to/build
cmake /path/to/source

Compilation and installation are then achieved using regular Make:

cd /path/to/build
make && ls -al ./lib ./bin
make doc && ls -al ./doc
make install

Alternatively (to Make), distribution-specific Debian packages can be built and installed using the ad-hoc commands:

cd /path/to/source
debuild -us -uc -b && ls -al ../{lib,}sgctp*.deb
dpkg -i ../{lib,}sgctp*.deb

Pre-built Binaries

Pre-built binary packages for Ubuntu are available from the author's Launchpad Personal Package Archive (PPA):

https://launchpad.net/~cedric.dufour/+archive/ppa/

Please follow the PPA instructions to carry out the installation.

Development

Please refer to the Library (Development) Documentation.

Usage

Simple Geolocalization and Course Transmission Protocol (SGCTP) utilities are designed to follow the UNIX/pipe semantic and be chained together in obtain higher level of functionalities.

Apart from the parameters which are specific to each utility - see its --help or man page for further details - all utilities share common settings, controlling how data are encoded and transmitted. In order to use those settings efficiently, one must understand the few building blocks of the Simple Geolocalization and Course Transmission Protocol (SGCTP) protocol.

Data

Given how geolocalization and course data are generated and used, no complex "state machine" is involved - though it could have allowed to (further) lower bandwidth - and each packet contains a "stateful" representation of the data.

While standard content contains geolocalization and course data, extended content adds information about their source and precision.

Payload

In order to achieve low-bandwidth, geolocalization and course data are binary-encoded, using as few bits as necessary to obtain a reasonable precision (based on both the usual precision of their sources and the requirements of common usage scenarios).

This payload is then transmitted according to the user-specified payload type:

  • [0] RAW: as is
  • [1] AES128: encrypted using AES128+CBC crypto/stream ciphers

When using encrypted payload types, one can/must specify additional parameters:

  • Principals Database: the file containing the list of principals (users/agents/clients/...) along their password and allowed payload type(s)
  • Principal ID: the ID of the principal to receive/send data
  • Password: the password for the principal used to receive/send data (ignored if a Principals Database has been specified)
  • Password Salt: password salt used to derive the cryptographic key for the principal used to receive/send data (for transmission types that do not generates this salt dynamically/randomly)

Note that using encryption will significantly increase bandwidth usage (typically ˜2x).

Transmission

Once encapsulated according to the specified payload type, geolocalization and course data are:

  • Transmitted via UDP: transmission via UDP offers the benefits of the minimum bandwidth while trading off reliability and security; it should be used within private network segments or only when reliability/security are no major concerns
  • Transmitted via TCP: transmission via TCP increases bandwidth usage but also increases reliability and (if encryption is used) security; it should be used in public network segments and (along encryption) when privacy and/or authentication is required
  • Store/read to/from file: for archival purposes

Examples

  • Start the Simple Geolocalization and Course Transmission Protocol (SGCTP) hub:
  • sgctphub -P </path/to/principals>
  • Dump data from an GPS receiver and send them (unencrypted) to the hub via UDP:
  • gps2sgctp <gpsd-host> | sgctp2udp <hub-host>
  • Receive (encrypted) data from the hub via TCP and display them on standard output in XML format:
  • hub2sgctp -P </path/to/principals> -Ti 1 -Ii <principal-ID> <hub-host>| sgctp2xml