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), - DJI DroneID, from OcuSync payloads demodulated by an SDR, AntSDR
reports, and the DJI Wi-Fi beacon element (
dji).
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.
§Operator readouts
Decoding gives fields; an operator needs answers. System::takeoff_position
surfaces where a drone launched from, apart from where the pilot is now;
operator resolves the Operator ID into the registering country and a
clean registration string; and track turns consecutive Location fixes
into a heading and a closing/opening trend toward a point you are guarding.
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 operator::OperatorIdentity;pub use track::RangeTrend;pub use track::Trajectory;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_
json std aircraft.jsonin the readsb schema, so tar1090 shows drones.- auth
verify - Signature checks for DRIP authentication (needs the
verifyfeature). - ble
- Remote ID over Bluetooth: Service Data with UUID 0xFFFA.
- capture
std - Remote ID frames out of capture files: pcap, pcapng and RIDF in,
CapturedFrames (and trust verdicts) out. - dji
- DJI DroneID: the telemetry DJI aircraft broadcast besides (and before) ASTM Remote ID.
- 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
stdand without dependencies. - operator
- Resolving a broadcast Operator ID into a displayable operator identity.
- replay
std - 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.
- track
- Heading and range trend from consecutive position fixes (works in
no_std). - 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.
- Counter
Stats std - Counts derived from the one byte message counters.
- Horizontal
Accuracy - Horizontal accuracy code (0 to 15) from a Location message.
- Location
- Location and vector message.
- Message
Pack - A borrowed, structurally checked message pack.
- Message
Pack Builder - Builds a message pack into a fixed buffer, without allocating.
- Operator
Id - Operator ID message: the operator’s registration number.
- SelfId
- Self ID message: free text from the operator.
- Serial
Number - 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.
- Speed
Accuracy - Speed accuracy code from a Location message.
- System
- System message: operator position and the operating area.
- Timestamp
Accuracy - Timestamp accuracy code from a Location message, in tenths of a second.
- Tracked
Uas std - One tracked aircraft.
- Tracker
std - Keeps one
TrackedUasper transmitter, with a trustAssessmentfor each. - Tracker
Config std - Tracker settings.
- UasData
- Everything known about one aircraft, built up from its messages.
- Vertical
Accuracy - Vertical (geodetic or barometric) accuracy code from a Location message.
Enums§
- Auth
Type - Authentication scheme of an Auth message.
- Category
Eu - EU operating category.
- ClassEu
- EU aircraft class.
- Classification
Type - Classification scheme in a System message.
- Description
Type - 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.
- Height
Type - Reference of the Location message’s
heightfield. - IdType
- Kind of identifier in a Basic ID message.
- Location
Issue - A plausibility problem found by
Location::check. - Message
- One decoded Remote ID message.
- Message
Type - Message type, the high nibble of every message’s first byte.
- Operator
Location Type - 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).