Distributed Sensing¶
Research question¶
Where should object detection run when N sensors stream into a contested-access network? Running the detector on each sensor avoids shipping frames but pays a higher per-frame compute cost on constrained hardware. Running it on a gateway or cloud node pays the bandwidth cost of shipping frames but shares one compute budget across N sensors. The trade-off is measured across three placements, three sensor counts, and three access qualities.
Layers involved¶
Data Source — synthetic or replay source per sensor
Processing Core — fan-in at the server; one detector queue shared by all sensors
NetWaggle — per-sensor access link; quality swept over good, contested, and severe profiles
Analysis — end-to-end latency, age of information, detection rate, bytes per link
What to configure¶
Declare one client node per sensor and one server node as the processing point.
Each sensor gets its own link to the server with direction: both (the result
travels back on the same path). The quick config shows the minimal two-sensor
topology:
examples/distributed_sensing/quick.yaml¶# The quick config: two sensors, a generated source, the in-process delay
# backend, and the detector on the gateway. No simulator, no download and no
# GPU, so this is the config the unit test and CI run.
extends: _base.yaml
experiment: {name: sensing_quick, max_active_s: 120.0}
links:
- name: uplink_sensor_1
from: sensor_1
to: gateway
direction: both
network: &access
mode: delay
distribution: {kind: lognormal, p50_ms: 8.0, p99_ms: 25.0}
loss: 0.0
bandwidth_mbps: 24.0
- {name: uplink_sensor_2, from: sensor_2, to: gateway, direction: both, network: *access}
The edge sweep shows how the placement and access quality axes are declared:
examples/distributed_sensing/edge_5.yaml¶# Detector placement at the edge of a 5-sensor cell: the detector runs on every
# sensor, or on the gateway the sensors associate with. The sweep crosses those
# two placements with three access-link qualities, so each run differs from its
# neighbours along one axis and nothing else.
#
# The access links are declared one per sensor with identical parameters. The
# cell is one access network, and the server runtime applies the path into the
# gateway to every inbound connection, so a per-sensor parameter would not be
# read. The swept value is therefore the whole `links` list: sweeping one link's
# fields would leave the other entries stating a quality no run measured.
extends: _base.yaml
experiment: {name: sensing_edge_5, max_active_s: 600.0}
nodes:
- {name: sensor_1, host: localhost, role: client, device: cpu}
- {name: sensor_2, host: localhost, role: client, device: cpu}
- {name: sensor_3, host: localhost, role: client, device: cpu}
- {name: sensor_4, host: localhost, role: client, device: cpu}
- {name: sensor_5, host: localhost, role: client, device: cpu}
- {name: gateway, host: 127.0.0.1, port: 15110, role: server, device: cpu}
# The access quality a plain run uses; the sweep below replaces the whole list.
links:
- name: uplink_sensor_1
from: sensor_1
to: gateway
direction: both
network: &good
mode: delay
distribution: {kind: lognormal, p50_ms: 8.0, p99_ms: 25.0}
loss: 0.0
bandwidth_mbps: 24.0
- {name: uplink_sensor_2, from: sensor_2, to: gateway, direction: both, network: *good}
- {name: uplink_sensor_3, from: sensor_3, to: gateway, direction: both, network: *good}
- {name: uplink_sensor_4, from: sensor_4, to: gateway, direction: both, network: *good}
- {name: uplink_sensor_5, from: sensor_5, to: gateway, direction: both, network: *good}
sweep:
axes:
app.params.placement: [sensor, gateway]
links:
- - {name: uplink_sensor_1, from: sensor_1, to: gateway, direction: both, network: *good}
- {name: uplink_sensor_2, from: sensor_2, to: gateway, direction: both, network: *good}
- {name: uplink_sensor_3, from: sensor_3, to: gateway, direction: both, network: *good}
- {name: uplink_sensor_4, from: sensor_4, to: gateway, direction: both, network: *good}
- {name: uplink_sensor_5, from: sensor_5, to: gateway, direction: both, network: *good}
- - name: uplink_sensor_1
from: sensor_1
to: gateway
direction: both
network: &contested
mode: delay
distribution: {kind: lognormal, p50_ms: 35.0, p99_ms: 160.0}
loss: 0.02
bandwidth_mbps: 6.0
- {name: uplink_sensor_2, from: sensor_2, to: gateway, direction: both, network: *contested}
- {name: uplink_sensor_3, from: sensor_3, to: gateway, direction: both, network: *contested}
- {name: uplink_sensor_4, from: sensor_4, to: gateway, direction: both, network: *contested}
- {name: uplink_sensor_5, from: sensor_5, to: gateway, direction: both, network: *contested}
- - name: uplink_sensor_1
from: sensor_1
to: gateway
direction: both
network: &severe
mode: delay
distribution: {kind: lognormal, p50_ms: 90.0, p99_ms: 500.0}
loss: 0.08
bandwidth_mbps: 1.5
- {name: uplink_sensor_2, from: sensor_2, to: gateway, direction: both, network: *severe}
- {name: uplink_sensor_3, from: sensor_3, to: gateway, direction: both, network: *severe}
- {name: uplink_sensor_4, from: sensor_4, to: gateway, direction: both, network: *severe}
- {name: uplink_sensor_5, from: sensor_5, to: gateway, direction: both, network: *severe}
Key fields:
nodes[*].role: clienton each sensor node (multiple clients, one server)app.params.placement—sensor,gateway, orcloud; the sweep axis in the edge configsapp.params.detect_ms— per-node-class detector cost in milliseconds (config input, not a measurement)links[*].direction: both— the reply path uses the same link
How to run¶
Validate and run the quick config:
./scripts/cadet validate examples/distributed_sensing/quick.yaml --app-module examples.distributed_sensing.app
./scripts/cadet run examples/distributed_sensing/quick.yaml --app-module examples.distributed_sensing.app
Run the placement sweep over 5 sensors:
./scripts/cadet sweep examples/distributed_sensing/edge_5.yaml --app-module examples.distributed_sensing.app
Results headline¶
From the sweep over five sensors and three access qualities (source:
examples/distributed_sensing/README.md):
The sensor placement is flat across N: each sensor runs its own detector and its own source loop, so adding sensors adds independent workers rather than queue depth.
The gateway saturates at N > 2: five sensors at 10 fps offer 50 frames per second; the gateway detector at 40 ms per frame handles 25. Median end-to-end latency jumps from 69.0 ms (N=2) to 1097.8 ms (N=5) at good access quality.
The cloud wins at N=5 at good access quality (96.5 ms) and degrades more slowly than the gateway as access quality worsens.
Full results tables are in Distributed Sensing.
How to extend¶
Add more sensors: add
clientnodes and links inedge_5.yamland adjustexperiment.max_active_sif the run is long.Sweep access quality independently: the swept
linkslist inedge_5.yamlcan be extended with additional quality profiles.Try the emulated network: run
wifi_5.yamloremulated_5.yamlviacadet emulateto add topology-level link shaping.
See also¶
Distributed Sensing — full results, config listing, output format
Tutorial 6: Write an App Plugin — writing an app plugin
NetWaggle Layer — network backend reference
Configure link distributions — loss and delay parameters