Skip to main content

Crate remoteid

Crate remoteid 

Source
Expand description

Drone Remote ID in pure Rust.

remoteid decodes and encodes the broadcast Remote ID messages defined by ASTM F3411-22a and ASD-STAN EN 4709-002 (the format the Open Drone ID project implements in C), and pulls them out of the frames receivers actually see:

  • Bluetooth 4 legacy advertising and Bluetooth 5 extended / long range advertising (ble),
  • Wi-Fi Beacon vendor elements and Wi-Fi NAN service discovery frames (wifi), with or without a radiotap header,
  • the French “signalement electronique” beacon format (france).

Decoded messages can be merged into one record per aircraft (UasData), and with the std feature a Tracker keeps those records per transmitter, counts duplicate and missed frames from the message counters, and expires aircraft that went quiet.

The crate has no dependencies and works in no_std (turn off the default std feature). It never allocates outside the std-only Tracker.

§Example

use remoteid::{ble, Frame, Message, UasData};

// Bluetooth advertising data from a scanner (one AD structure, BT4 legacy).
let adv = [
    0x1e, 0x16, 0xfa, 0xff, 0x0d, 0x07, // length, service data, UUID 0xFFFA, app code, counter
    0x02, 0x12, b'1', b'5', b'9', b'6', b'F', b'3', b'5', b'0', b'7', b'4', b'5', b'2',
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
];
let rid = ble::find_in_advertising_data(&adv).expect("Remote ID service data");
let mut uas = UasData::default();
match rid.frame().unwrap() {
    Frame::Message(Message::BasicId(id)) => {
        assert_eq!(id.uas_id_str(), Some("1596F3507452"));
        uas.update(&Message::BasicId(id));
    }
    other => panic!("unexpected {other:?}"),
}
assert!(uas.basic_id[0].is_some());

§Accuracy and limits

Decoding follows the reference C library bit for bit; the test suite compares every message in the public Open Drone ID sample captures against that library’s output. Encoding quantizes the same way the C library does, so decode(encode(x)) is exact for values on the transmitted grid. Authentication pages are reassembled for every scheme; the drip module parses the DRIP formats of RFC 9575 and, with the verify feature, auth checks their Ed25519 signatures. Other schemes plug in through auth::AuthScheme.

§Trust

Remote ID has no authentication in most deployed aircraft, and spoofers are a few lines of Python. trust turns decoded frames into a graded Verdict (Authenticated, Plausible, Suspicious, Spoofed) with the reasons behind it: kinematic plausibility, timestamp and counter continuity, Wi-Fi TSF behaviour, agreement between transports and transmitters, fingerprints of public spoofing tools, and DRIP signatures. The verdict is advice for a detector, not a filter: nothing is dropped.

ridf defines RIDF v0, a small record format for raw frames with receiver time, signal strength and receiver position, and aircraft_json writes aircraft.json in the readsb schema so tar1090 can show drones next to aircraft.

Re-exports§

pub use trust::Assessment;
pub use trust::Observation;
pub use trust::Reason;
pub use trust::TrustConfig;
pub use trust::TrustState;
pub use trust::Verdict;

Modules§

aircraft_jsonstd
aircraft.json in the readsb schema, so tar1090 shows drones.
authverify
Signature checks for DRIP authentication (needs the verify feature).
ble
Remote ID over Bluetooth: Service Data with UUID 0xFFFA.
capturestd
Remote ID frames out of capture files: pcap, pcapng and RIDF in, CapturedFrames (and trust verdicts) out.
drip
DRIP authentication data: DRIP Entity Tags (RFC 9374) and the DRIP Authentication Formats carried in Remote ID Authentication messages (RFC 9575).
france
The French “signalement electronique” beacon (arrete of 27 December 2019).
geo
Small geodesy helpers that work without std and without dependencies.
replaystd
Scoring a Remote ID receiver against captures with known truth.
ridf
RIDF v0: a record format for raw Remote ID frames as a receiver saw them.
trust
Trust decisions: is this Remote ID broadcast plausible, authenticated, or spoofed?
wifi
Remote ID over Wi-Fi: Beacon vendor elements and NAN action frames.

Structs§

Auth
One page of an authentication message.
BasicId
Basic ID message: the aircraft’s identity.
CounterStatsstd
Counts derived from the one byte message counters.
HorizontalAccuracy
Horizontal accuracy code (0 to 15) from a Location message.
Location
Location and vector message.
MessagePack
A borrowed, structurally checked message pack.
MessagePackBuilder
Builds a message pack into a fixed buffer, without allocating.
OperatorId
Operator ID message: the operator’s registration number.
SelfId
Self ID message: free text from the operator.
SerialNumber
An ANSI/CTA-2063-A physical serial number: a 4 character manufacturer code, one length character (1 to 9, A to F) and the serial itself.
SpeedAccuracy
Speed accuracy code from a Location message.
System
System message: operator position and the operating area.
TimestampAccuracy
Timestamp accuracy code from a Location message, in tenths of a second.
TrackedUasstd
One tracked aircraft.
Trackerstd
Keeps one TrackedUas per transmitter, with a trust Assessment for each.
TrackerConfigstd
Tracker settings.
UasData
Everything known about one aircraft, built up from its messages.
VerticalAccuracy
Vertical (geodetic or barometric) accuracy code from a Location message.

Enums§

AuthType
Authentication scheme of an Auth message.
CategoryEu
EU operating category.
ClassEu
EU aircraft class.
ClassificationType
Classification scheme in a System message.
DescriptionType
Meaning of the text in a Self ID message.
Error
Everything that can go wrong while decoding or encoding Remote ID data.
Frame
A decoded Remote ID payload: either one message or a message pack.
HeightType
Reference of the Location message’s height field.
IdType
Kind of identifier in a Basic ID message.
LocationIssue
A plausibility problem found by Location::check.
Message
One decoded Remote ID message.
MessageType
Message type, the high nibble of every message’s first byte.
OperatorLocationType
Where the operator position in a System message comes from.
Status
Operational status in a Location message.
Transmitter
Who sent a frame. Receivers key aircraft by the radio address, because that is the only thing every frame of one transmitter shares before its Basic ID has been heard.
Transport
The radio link a Remote ID frame arrived on.
UaType
Aircraft type in a Basic ID message.

Constants§

EPOCH_2019_UNIX
Seconds from the Unix epoch to 2019-01-01 00:00:00 UTC, the epoch of the System and Auth timestamps.
MESSAGE_SIZE
Size in bytes of every single Remote ID message.
PACK_MAX_MESSAGES
Most messages one pack can hold.
PROTOCOL_VERSION
Protocol version this crate writes when encoding (2 = ASTM F3411-22a).