Skip to content

Thread leader, child and route change

Distinguish Leader, Router and child roles, record the child's parent and IPv6 reachability, then retest the path after a relay stops.

Radio Remi — trace the parent and probe the path again after the relay changes., your practice guide

Radio Remi — trace the parent and probe the path again after the relay changes.
Predict the reading, then compare it with the measurement.

OpenThread simulated CLI

Python

Distinguish Leader, Router and child roles, record the child's parent and IPv6 reachability, then retest the path after a relay stops.

Tier 2 · Python · install required · No account

Version tested: OpenThread thread-reference-20250612, commit 8a19434b8ae56ed5ffbc931d3f1aa212823633c6; POSIX simulation ot-cli-ftd. Date: 2026-10-08.

Download the three files, create a Python virtual environment, install requirements.txt, and run main.py.

Open the Python run guide (new tab)

Get the files

Download all three prepared files into one folder. No account or paid service is required.

main.py

11,059 bytes · Python program

Download

requirements.txt

59 bytes · Pinned dependencies

Download

README.md

2,042 bytes · Run guide

Download

  1. Put main.py, requirements.txt, and README.md in the same folder.
  2. Create and activate a Python virtual environment, then install requirements.txt.
  3. Run python3 main.py and compare its output with each observed result below.

Steps

Screens captured against OpenThread simulated CLI thread-reference-20250612 on 2026-10-08; the tool may have moved on — the text steps are the contract.

  1. 1 Step 1

    Do
    In the terminal panel, run main.py with the pinned ot-cli-ftd binary. Inspect the leader's active dataset, state and mesh-local IPv6 address in cli-transcript.txt.
    You will see
    The actual CLI reports Channel: 15, PAN ID: 0x1234, Mesh Local Prefix: fd12:3456:789a:1::/64 and Network Name: ThreadRouteLab. Node 1 reports leader and ML-EID fd12:3456:789a:1:9ea4:ab7d:b9c1:4f29.
    Why it matters
    The operational dataset and elected Leader establish this simulated Thread network. A Leader manages the mesh partition; it is not a Border Router or application controller.
    Captured OpenThread CLI dataset fields and leader state from the real simulation run.
    Step 1 · OpenThread simulated CLI; numbered callout added to a real capture. Enlarge screenshot (new tab)
  2. 2 Step 2

    Do
    In the terminal panel, inspect relay-a's state and the leader's first router table after relay-a starts.
    You will see
    Relay A reports router. The leader's table lists router ID 45, RLOC16 0xb400, Extended MAC 2222a43b60e577d7, Link 1 and LQ In/Out 3/3.
    Why it matters
    This is router-role and routing-table evidence from OpenThread. The row identifies a routing-capable relay; it does not show that a child has attached yet.
    Captured relay A router state and the leader router table with RLOC16 0xb400.
    Step 2 · OpenThread simulated CLI; numbered callout added to a real capture. Enlarge screenshot (new tab)
  3. 3 Step 3

    Do
    In the terminal panel, inspect the router-ineligible child's state and parent after its interface and Thread stack start; compare relay-a's child table.
    You will see
    Node 4 reports child. Its parent is Extended Address 2222a43b60e577d7 with Rloc b400 and Link Quality In/Out 3/3. Relay A's child table lists node 4 at RLOC16 0xb401 with timeout 20.
    Why it matters
    A child uses its parent for forwarding and is not a mesh router. The child's parent report and the relay's child table corroborate attachment from both sides.
    Captured child role and parent details showing relay A's extended address and RLOC.
    Step 3 · OpenThread simulated CLI; numbered callout added to a real capture. Enlarge screenshot (new tab)
  4. 4 Step 4

    Do
    In the terminal panel, inspect relay-b's router state and run the child's baseline ping to the leader's ML-EID before stopping relay-a.
    You will see
    Relay B reports router and the child still reports parent 2222a43b60e577d7. The actual ICMPv6 reply is 24 bytes, icmp_seq=1, hlim=64, time=56ms; 1 packet transmitted and received with 0.0% loss.
    Why it matters
    The alternate relay is available while the child still uses relay A. A single successful simulated ICMPv6 probe establishes this path's baseline reachability, not a latency guarantee.
    Captured relay B router state and a baseline ICMPv6 reply to the leader.
    Step 4 · OpenThread simulated CLI; numbered callout added to a real capture. Enlarge screenshot (new tab)
  5. 5 Step 5

    Do
    In the terminal panel, issue thread stop to relay-a, then compare its state with the child's new parent and relay-b's child table.
    You will see
    Relay A reports disabled. The child remains child but now reports parent Extended Address 966c3adb3700f518, Rloc c00 and Link Quality In/Out 3/3. Relay B lists the child at RLOC16 0x0c01.
    Why it matters
    The parent changed to the available relay after relay A stopped. The two CLI views support reattachment, while a reachability probe is still needed to verify traffic delivery.
    Captured relay A disabled state and the child's new parent address and RLOC.
    Step 5 · OpenThread simulated CLI; numbered callout added to a real capture. Enlarge screenshot (new tab)
  6. 6 Step 6

    Do
    In the terminal panel, repeat the child's ping to the same leader ML-EID and inspect the leader's router table after the fault.
    You will see
    The second actual reply is 24 bytes, icmp_seq=2, hlim=64, time=3ms; 1 packet transmitted and received with 0.0% loss. The leader's near-term router table still lists relay A at Age 23, so that row alone is stale route evidence.
    Why it matters
    A new parent plus a successful post-fault ping supports reachability through the alternate simulated path. One timing sample and an aging router row cannot prove convergence time or field reliability.
    Captured post-fault router table and ICMPv6 reply; the stopped relay's row is still aging.
    Step 6 · OpenThread simulated CLI; numbered callout added to a real capture. Enlarge screenshot (new tab)

Chapter checks

These questions refer to the chapter’s examples. Use the return links to review their answers.

  1. A sleepy sensor has a parent, while powered routers forward across the mesh. What proves each claim?

    Return to the chapter’s knowledge check
  2. A design review says a battery-powered sensor improves Thread mesh coverage because it is part of the network. What correction should the reviewer make?

    Return to the chapter’s knowledge check

Caution

This is the real OpenThread stack using a simulated radio network and a local example Network Key. The four-node topology and two ICMPv6 samples do not measure physical radio performance, Border Router forwarding, Matter commissioning or application delivery. Router table entries can remain while aging after a node stops.

Return to Thread Network Architecture · Browse Labs