-
Notifications
You must be signed in to change notification settings - Fork 0
05 Proximity and Hardware Transports
Corresponding Specifications:
sys-arch/14-proximity-abstraction-architecture.md,sys-arch/15-qr-nfc-bootstrap-pairing-architecture.md
Key Crates:crates/siar-transport-ble,crates/siar-transport-bluetooth-classic,crates/siar-transport-wifi-direct,crates/siar-transport-wifi-aware,crates/siar-transport
SIAR isolates hardware-specific radio APIs behind a uniform, asynchronous Rust driver trait:
#[async_trait]
pub trait TransportDriver: Send + Sync {
fn transport_kind(&self) -> TransportLinkKind;
async fn start_advertising(&self, beacon: DiscoveryBeacon) -> Result<(), TransportError>;
async fn stop_advertising(&self) -> Result<(), TransportError>;
async fn start_discovery(&self) -> Result<Receiver<DiscoveredPeer>, TransportError>;
async fn connect(&self, endpoint: &TransportEndpoint) -> Result<Box<dyn StreamChannel>, TransportError>;
async fn listen(&self) -> Result<Receiver<Box<dyn StreamChannel>>, TransportError>;
}+-------------------------------------------------------------------------------+
| Transport | Range | Throughput | Energy Drain | Setup Latency |
+---------------------+----------+--------------+--------------+----------------+
| BLE GATT / L2CAP | 10–50 m | 50–500 Kbps | Very Low | < 200 ms |
| Bluetooth Classic | 10–30 m | 1–2 Mbps | Low-Medium | ~ 1.5 s |
| Wi-Fi Aware (NAN) | 30–100 m | 5–50 Mbps | Low-Medium | < 500 ms |
| Wi-Fi Direct (P2P) | 50–150 m | 50–300 Mbps | Medium-High | 2–5 s |
| Local Subnet (LAN) | Subnet | 100–1000 Mbps| Very Low | < 50 ms |
| Iroh / QUIC Relay | Global | 10–500 Mbps | Variable | 100–500 ms |
+-------------------------------------------------------------------------------+
Implemented in siar-transport-ble:
sequenceDiagram
participant NodeA as Node A (Scanner)
participant NodeB as Node B (Advertiser)
NodeB->>NodeB: Rotate Ephemeral BLE MAC Address
NodeB->>NodeB: Construct Service Data (16-bit UUID + Truncated NodeID + CapMask)
NodeB-->>NodeA: BLE Extended Advertisement Frame (31 bytes)
NodeA->>NodeA: Match SIAR Service UUID (0x5349 / 'SI')
NodeA->>NodeB: Connect GATT / L2CAP CoC Channel
NodeA->>NodeB: Negotiate MTU (23 -> 512 bytes)
NodeA->>NodeB: Stream Encrypted Wire Frames (Chunked)
Because raw BLE GATT packets are constrained by the negotiated MTU (typically 23–512 bytes), siar-transport-ble encapsulates higher-level protocol frames in a 4-byte fragmentation header:
-
SeqNo(u16): Fragment sequence index. -
TotalFragments(u8): Total chunks in envelope. -
Flags(u8):0x01(First),0x02(Last),0x04(Emergency Priority).
- Zero Group Owner Dependency: Clusters form autonomously without a single device bearing all the routing burden.
- Service Discovery: Nodes discover each other's capability bitmasks before establishing an active data connection.
- Datapath: Operates on synchronized channel schedules (100ms discovery windows) to conserve battery during background operation.
- Autonomous GO Negotiation: When transmitting large media blobs or sync batches (>5 MB), nodes establish an ad-hoc Wi-Fi Direct group.
- Auto-DHCP & Socket Rendezvous: Assigns private RFC 1918 link-local IPs and spins up a dedicated TCP/QUIC stream.
- Auto-Teardown: The link automatically dissolves after 30 seconds of inactivity to eliminate unnecessary battery drain.
SIAR — Survivable Identity & Autonomous Routing
Open Source Mesh & DTN Communications Platform | Dual Licensed under MIT / Apache-2.0 / Commercial
Documentation Index • GitHub Repository • System Specifications
- 04-Autonomous-Routing-and-Policy-Engine
- 05-Proximity-and-Hardware-Transports
- 06-Delay-Tolerant-Networking-and-Bundle-Forwarding
- 07-Battery-Aware-Scheduling-and-Emergency-Mesh
- 08-Offline-Event-Log-and-Outbox-Engine
- 09-Robust-Blob-Storage-and-Chunk-Transfers
- 10-Crash-Recovery-and-Data-Portability
- 11-Realtime-Audio-Video-Calling-Architecture
- 12-Cross-Platform-Client-Architecture
- 13-Messaging-Timeline-Composer-and-Inbox
- 14-Contacts-Groups-and-Security-Center
- 15-Nearby-Discovery-and-Out-of-Band-Pairing
- 16-Notifications-Presence-and-Background-Lifecycle
- 17-Local-Knowledge-Retrieval-and-Search
- 25-Design-System-Tokens-and-Responsive-Layouts
- 26-UI-UX-Performance-Testing-and-Quality-Gates
- 18-Protocol-Extensions-and-WASM-Plugins
- 19-Headless-Daemons-and-Embedded-Nodes
- 20-C-ABI-FFI-and-Native-Language-Bindings
- 21-Testing-Fuzzing-and-Network-Diagnostics
- 22-Getting-Started-and-Developer-Guide
- 23-Off-Grid-Survival-and-Field-Operations-Guide
- 24-System-Comparison-and-Benchmarking