# Test IPv6 Hop Limit over a three-link RPL path

This lab uses four Contiki-NG motes in a straight simulated UDGM radio
chain: root 1 at x=0, relays 2 and 3 at x=40 and x=80, sender 4 at x=120.
The radio range is 50 m per link and the random seed is 1. The fixed
payloads `HOP8`, `HOP1`, and `HOP3` are synthetic labels, not sensor data.
This is simulated radio, not field data.

## 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-ipv6-hop-limit/docker-launch.sh
```

The launcher loads `cooja-ipv6-hop-limit.csc` with the pinned Cooja image.
Close Cooja and revoke X11 access with `xhost -si:localuser:$(id -un)`.
The host evidence run used Apptainer and Xvfb `:98` with the same pins.

In the GUI, click **Start/Pause** at the scripted stops at 20, 55, 70, 85,
100, and 110 simulated seconds. View **Network** for the chain, **Mote
output** for sender limits, relay forwarding, ICMPv6 error, and root
receipts, and **Radio messages** for radio traffic. The raw headless run in
`expected-output.txt` finishes at 120 s with `TEST OK`.

## Observed seed-1 run

The client code sets the UDP connection's IPv6 `ttl` before each send;
Contiki-NG's `uip6.c` copies that value into the IPv6 header's Hop Limit.
The sender emitted `HOP8` with limit 8 at 50.972 s; relay 3 and relay 2
logged forwarding at 51.000 and 51.013 s; root 1 received it at 51.047 s.
The same sender emitted `HOP1` with limit 1 at 65.973 s. Relay 3 logged
ICMPv6 Time Exceeded type 3/code 0 at 66.007 s and the root logged no
`HOP1` receipt. It then emitted `HOP3` with limit 3 at 80.974 s; relay 3
and relay 2 forwarded it at 81.000 and 81.023 s, and root 1 received it
at 81.028 s. The ScriptRunner summary is
`sent={"HOP8":8,"HOP1":1,"HOP3":3} received={"HOP8":1,"HOP3":1}`.

Only these three fixed test packets are compared. The summary's total
`forwarded=18` includes unrelated control and reply traffic, so it must not
be treated as the hop count of one payload. The **Radio messages** window
also includes RPL control frames. The tested path and sink receipt are the
delivery evidence.

This simulated result does not prove field RF stability, route-loop freedom,
or a general minimum Hop Limit for a changing network.
