# Measure an RPL sink restart and sequence recovery

Four Contiki-NG motes form a simulated three-link UDGM chain: sink 1,
relays 2 and 3, sender 4. Adjacent motes are 40 m apart and radio range
is 50 m. Seed 1 and fixed `SEQ:<number>` payloads make this a repeatable
synthetic experiment, not field sensor data.

The ScriptRunner removes **only sink mote 1** at 95.549 s. It creates a
fresh mote instance from the same type, ID, and position at 125.549 s.
The 30 s absence represents a delayed sink reboot. Sender 4 continues
one sequence every five seconds using the root address learned before
the outage. No relay or sender is rebooted or manually repaired.

## 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-rpl-sink-reboot/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. In
the GUI, click **Start/Pause** at the scripted stops at 75, 100, 120,
200, 470, and 490 simulated seconds. **Network** shows whether sink 1 is
present. **Radio messages** and **Mote output** show DIO/DIS/DAO control
traffic, sends, and sink receipts. Minimize Radio messages to see the
**Simulation script editor** log with the `SINK_REBOOT` marker; restore
the radio window afterward. The raw headless output finishes at 500 s.

## Observed seed-1 run

Sink 1 received sequence 7 at 91.030792 s, then was removed at
95.549 s and restarted at 125.549 s. Sender 4 emitted sequences 8
through 81 without a sink receipt. The first recovered sink receipt
was sequence 82 at 466.071824 s. The sequence gap is 74 samples and
the measured interval from removal to first delivery is 370.522824 s;
from restart to first delivery it is 340.522824 s. By the 500 s stop,
the sender had emitted 89 numbered samples and the sink had logged 15
receipts. Control traffic continued during route recovery. The long
recovery is an observation of this seed and topology, not a configured
RPL recovery timer or a general prediction.

This simulated result does not establish production failover time,
field RF performance, or root-to-node command delivery.
