Radar forwarder V2


Radar V2 - Changes

Here are the changes from the legacy Radar V1 implementation to the new Radar V2 system.

Port number

Radar V1 protocol used UDP port 2227 - Radar V2 protocol uses UDP port 5997.

You can no longer change the port number from the command line options - this feature isn't meaningful or needed.

Message types

Radar V1 only has a single message which was an Extended Squitter. This was an oversight as we need to support multiple message types.

Messages now have an 8-bit "opcode" field to allow different types of messages to be sent.

Radar V2 has multiple message types for Mode-A/C, Mode-S (Short), Mode-S (Extended), Keep-Alive, Stats and Telemetry.

Authentication tags

The V1 protocol used a magic number (4 bytes) at the start of each message and a CRC32 (4 bytes) at the end of each message - these have been replaced with a 64-bit (8-byte) "authentication tag" on each message. The authentication tag protects each message against corruption, tampering and forgery using a digital signature based on a truncated HMAC-SHA256.

In order to use Authentication Tags both parties (radar sender and aggregator) must agree a pre-shared private key or "pass-phrase". The pass-phrase 16-64 bytes in size and passed with the "-p" option on the command line and converted into the 512-bit key needed for HMAC-SHA-256 using key expansion with the SHA-512 function. If no pass-phrase is specified the sender defaults to using the word "secret".

Good pass-phrases are 16+ characters long and come from random.org's password generator

Message length

The majority of messages sent by Radar V2 protocol are 50 bytes long (telemetry and stats are longer but infrequent).

Improved socket handling

Socket handling on the TCP connection to dump1090/readsb for the BEAST/AVR protocols has been changed from using a blocking read() call to using the select() call to improve performance and ensure that other features that depend on timers are executed on time.

Messages forwarded to the aggregator

By default Radar V2 forwards Mode-S Extended Sequitter types DF17, DF18 and DF19 in the same way as Radar V1, but the command line option "-e <number>" can be specified to increase the Extended Squitter messages to include DF20/21, DF16, DF22 or all extended squitter messages - don't do this (yet) as the aggretgator doesn't use them.

The "-c" option enables sending of Mode-A/C messages but is not enabled by default as the aggregator doesn't use them (yet).

The "-y" option enables sending of Mode-S short messages but is not enabled by default as the aggregator doesn't use them (yet).

Deduplication of messages

ADS-B transmissions from aircraft include many duplicate messages - we that we can deduplicate to improve efficiency. Radar V2 now implements de-duplication hash tables for Mode-S (short) and Mode-S (extended) messages. Both de-duplicators work over a three second window but the hash tables are now cleaned at 10Hz which has been carefully optimised by trial-and-error as the best trade-off between processing effort/network bandwith/system performance. Deduplication reduces the traffic being sent on the network by around 30-35% saving bandwidth and processing at the central aggregator.

Foreground stats

You can monitor the number of frames forwarded per second using the "-f" option (used to be "-s" on v1).

Telemetry

We now send some telemetry about the system Radar forwarder is running on to help understand performance and throughput issues and find bugs. The info we send includes the processor architecture, number of cores, CPU temperature, memory utilisation, number of processes running, CPU load averages, Linux kernel version, GCC compiler version, Glib-C version, etc. We only send info related to the environment and performance of the system - we don't send anything about you, your network, files, IP addresses, personal information, etc. See telemetry.h for further info.

Telemetry updates default to every 15 minutes (900 seconds) but can be altered with the config option "-t <seconds>"

Statistics

The software gathers statistics on the radio channel and the number of Mode-A/C, Mode-S (short) and Mode-S (extended) downlink formats, packet rates and byte counts and sends them to the aggregator periodically to allow us to measure the 1090MHz channel occupancy at your receiving station. See stats.h for further info.

Stats updates default to every 15 minutes (900 seconds) but can be altered with the config option "-t <seconds>"

Fix for 32/64-bit problems

Some ARM platforms have mixed archtecture - for example Raspberry Pi OS 11.7 has a 64-bit kernel (aarch64) but a 32-bit Glibc/runtime. This caused problems with variables of type time_t which may be 32-bit or 64-bit. We changed the code to explicit of use 32-bit and 64-bit data types to address these issues.

Updated setup

The set-up script (setup.sh) has has a few tweaks and been tidied up.

Setup now askes for your API/sharing key and for your pass-phrase.

If you don't set the pass-phrase then the "-p <pass-phrase>" option isn't included in the configuration written out to /etc/default/radar and the sender defaults to using "secret" as the pre-shared key.