# Thread leader, child and route change

This lab runs the real OpenThread `ot-cli-ftd` implementation on its POSIX simulation platform. Radio links are simulated. The role, parent, router-table and ICMPv6 output comes from OpenThread itself; it does not prove field radio performance, Border Router access or Matter fabric membership.

## Build the pinned CLI

OpenThread release: `thread-reference-20250612`, commit `8a19434b8ae56ed5ffbc931d3f1aa212823633c6`. A C/C++ compiler, CMake 3.16 or newer, Ninja and Python 3 are needed. Build only the full Thread device CLI target:

```sh
git clone --depth 1 --branch thread-reference-20250612 https://github.com/openthread/openthread.git openthread-thread-reference-20250612
cd openthread-thread-reference-20250612
cmake -S . -B build/simulation -G Ninja -DOT_PLATFORM=simulation -DOT_APP_NCP=OFF -DOT_APP_RCP=OFF -DOT_PING_SENDER=ON -DOT_MAC_FILTER=ON
cmake --build build/simulation --target ot-cli-ftd --parallel 4
cd ..
```

Run the experiment from this folder:

```sh
python3 main.py --binary openthread-thread-reference-20250612/build/simulation/examples/apps/cli/ot-cli-ftd --output-dir thread-route-output
```

`requirements.txt` is intentionally empty: `main.py` uses only the Python standard library. The driver starts four genuine CLI processes (`1` leader, `2` first relay, `3` alternate relay, `4` router-ineligible child) and records every command and response in `cli-transcript.txt`. It uses a local example Network Key and a MAC address allowlist to constrain simulated links. Do not use that key on a deployed network.

Follow the six practice steps with the transcript. Compare the child's `parent` output and the leader's `router table` before and after `relay-a` receives `thread stop`. Verify a ping reply before and after the change. If the new parent or a reply is absent, record the failed observation instead of claiming recovery. This is a four-node teaching topology with a reachable alternate relay; a real installation needs its own link, latency and service tests.
