-
Notifications
You must be signed in to change notification settings - Fork 0
21 Testing Fuzzing and Network Diagnostics
Corresponding Specifications:
sys-arch/10-fuzzing-protocol-test-suite-architecture.md,sys-arch/18-network-diagnostics-path-visualization-architecture.md,sys-arch/ui-ux-20-diagnostics-network-paths-advanced-developer-architecture.md
Key Crates & Directories:crates/siar-testkit,fuzz
Testing distributed mesh networks with physical hardware is slow and non-deterministic. The siar-testkit crate provides a fully simulated, in-memory virtual radio mesh:
#[tokio::test]
async fn test_5_hop_mesh_spray_delivery() {
let mut network = VirtualMeshNetwork::new();
// Spawn 5 virtual nodes with simulated physical coordinates
let node1 = network.spawn_node(GeoPoint::new(0.0, 0.0)).await;
let node2 = network.spawn_node(GeoPoint::new(0.0, 1.0)).await; // In range of 1 & 3
let node3 = network.spawn_node(GeoPoint::new(0.0, 2.0)).await;
let node4 = network.spawn_node(GeoPoint::new(0.0, 3.0)).await;
let node5 = network.spawn_node(GeoPoint::new(0.0, 4.0)).await; // 4 km away from Node 1
// Inject packet loss and random latency
network.set_packet_loss_rate(0.15); // 15% packet drop
network.set_link_jitter_ms(20, 100);
// Node 1 sends message to Node 5
let msg_id = node1.send_message(node5.account_id(), "Disaster check").await.unwrap();
// Wait for multi-hop DTN spray propagation
network.run_simulation_steps(50).await;
// Verify Node 5 received and decrypted the payload
assert!(node5.inbox_contains(msg_id));
}While siar-testkit simulates virtual physical layers, SIAR features a dedicated full-stack integration test harness in crates/siar-messaging/tests/end_to_end.rs. This test suite exercises the complete live stack between distinct nodes:
-
Full Node Instantiation: Automatically initializes sovereign cryptographic keypairs, Stoolap SQL storage engines, transport managers, and
MessageServiceinstances. -
Out-of-Band Ticket Exchange: Simulates real-world
PeerTicketexport, Base64 transmission, and contact resolution. -
Bi-Directional Messaging & ACKs: Transmits encrypted messages across loopback sockets, verifying end-to-end delivery state transitions (
Pending->Sending->Delivered). - Connection Recycling & Stream Multiplexing: Validates that pooled transport connections sustain continuous, multi-message traffic without connection stalls or stream drops.
Run the end-to-end test suite:
cargo test -p siar-messaging --test end_to_endAll untrusted wire deserializers, frame decoders, and manifest parsers undergo continuous mutation fuzzing via cargo-fuzz (LLVM libFuzzer):
[Random Byte Generator / Mutator]
|
v
+---------------------------------------------------------------+
| Fuzzing Target Harness |
| - fuzz_protocol_decode: Tests siar-protocol envelope parsing |
| - fuzz_blob_manifest: Tests BLAKE3 Merkle tree verification |
| - fuzz_dtn_bundle: Tests malformed bundle header handling |
+-------------------------------+-------------------------------+
|
+----------------+----------------+
| (Valid Input) | (Malformed Input)
v v
[Normal Execution Path] [Graceful Parse Error]
(ZERO Panics / ZERO Memory Faults)
The diagnostics view provides real-time visibility into local and mesh networking health:
+-------------------------------------------------------------------------------+
| SIAR Mesh Network Visualizer |
+-------------------------------------------------------------------------------+
| Topology: 8 Nodes Online • Active Route to Basecamp: 3 Hops |
| |
| [You: Node-A] ===(BLE: -64dBm)===> [Node-B: Phone] ===(Wi-Fi Direct)===> ... |
| | |
| +========(Wi-Fi Aware)========> [Node-C: Repeater 1] ===(LoRa)===> ... |
| |
| Real-time Telemetry: |
| • Average RTT: 42 ms • Loss Rate: 1.2% |
| • Outbox Queue: 0 Pending • Battery Drain: 14 mW (Eco Mode) |
+-------------------------------------------------------------------------------+
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