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
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:
The Simple Geolocalization and Course Transmission Protocol (SGCTP) source tree contains the following resources:
- libsgctp.so: dynamic library
- libsgctp.a: static library
... for devices interfacing:
- gps2sgctp: convert GPSD data to SGCTP data
- ais2sgctp: convert GPSD (AIS) data to SGCTP data
- sbs2sgctp: convert SBS-1 data to SGCTP data
- flarm2sgctp: convert FLARM data to SGCTP data
... for network transmission:
- sgctp2tdp: send SGCTP data via TCP
- tcp2sgctp: receive SGCTP data via TCP (single client)
- sgctp2udp: send SGCTP data via UDP
- udp2sgctp: receive SGCTP data via UDP
... for data display or storage
- sgctp2dsv: decode and display SGCTP data as DSV
- sgctp2xml: decode and display SGCTP data as XML
- sgctp2gpx: decode and display SGCTP data as GPX
... for data aggregation and polling
- sgctphub: aggregates and redistributes the data sent by SGCTP agents
- hub2sgctp: connects to an SGCTP hub and receives SGCTP data
... for data filtering
- sgctpfilter: filter SGCTP data according to specified rules
... for developers/administrators
- sgctperror: explains error codes return by SGCTP utilities/library
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.
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 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.
Please refer to the Library (Development) Documentation.
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.
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.
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:
When using encrypted payload types, one can/must specify additional parameters:
Note that using encryption will significantly increase bandwidth usage (typically ˜2x).
Once encapsulated according to the specified payload type, geolocalization and course data are:
sgctphub -P </path/to/principals>
gps2sgctp <gpsd-host> | sgctp2udp <hub-host>
hub2sgctp -P </path/to/principals> -Ti 1 -Ii <principal-ID> <hub-host>| sgctp2xml