# Compare WSN delivery and simulated radio transmissions

Four Contiki-NG motes form a simulated directed star: sink 1 and senders
2, 3, and 4. Random seed 1 and fixed `BASE`, `FAST`, `LOSS`, and `RESTORE`
payload labels make this a repeatable exercise, not sensor or field data.
Only the directed 4-to-1 reception ratio changes: 1.0, then 0.5 from
90.549 to 120.549 simulated seconds, then 1.0 again.

## Run

On Linux x86-64 with Docker and X11, extract `lab-files.tar.gz` in a new
directory and run:

```bash
tar -xzf lab-files.tar.gz
git clone --depth 1 --branch release/v4.9 https://github.com/contiki-ng/contiki-ng.git contiki-ng
test "$(git -C contiki-ng rev-parse HEAD)" = c20b12cd2db707d6c07918f8b26cfeb52cf298ca
git -C contiki-ng submodule update --init --depth 1 tools/cooja
test "$(git -C contiki-ng/tools/cooja rev-parse HEAD)" = 33d41ae9f8acd6075fb903b0bcd5b4122bad8d8f
mkdir -p jdk17 home/contiki-ng
curl -fL 'https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.20.1%2B1/OpenJDK17U-jdk_x64_linux_hotspot_17.0.20.1_1.tar.gz' -o jdk17.tar.gz
echo '3808d1d15e3ec6bd5b84057fb5d84c33d8a1536a258146bcea2e603fc726e08e  jdk17.tar.gz' | sha256sum -c -
tar -xzf jdk17.tar.gz --strip-components=1 -C jdk17
xhost +si:localuser:$(id -un)
bash cooja-wsn-delivery-radio-ledger/docker-launch.sh
```

Close Cooja and revoke X11 access with `xhost -si:localuser:$(id -un)`.
The evidence run used Apptainer and Xvfb `:98` with the same pins. Click
**Start/Pause** at the CSC stops at 35, 50, 75, 95, 125, and 150 seconds.
View **Network**, **Radio messages**, and **Mote output**. The headless run
in `expected-output.txt` finishes at 155 seconds with `TEST OK`.

## Observed seed-1 run

Three baseline samples arrived, then 18 of 18 samples arrived in each
30-second `FAST`, `LOSS`, and `RESTORE` phase. The measured distinct radio
transmissions were 75, 93, and 74 respectively. Thus deliveries per
radio transmission were 18/75 = 0.240, 18/93 = 0.194, and 18/74 =
0.243. Mote 4's send status showed two MAC transmissions for some
packets in the loss phase. All six of its loss-phase application payloads
arrived; this run observed retry cost, not missed application delivery.

`radio_tx` counts all simulated radio transmissions in each phase,
including routing control and application replies. It is a network-wide
radio-activity proxy, not energy or battery-life measurement. The radio
message window shows cumulative traffic since startup, so compare the
ScriptRunner phase counts for equal 30-second windows.

This simulated comparison does not establish battery life, field RF
performance, or an application delivery guarantee.
