Skip to content

Measure a parent-switch recovery window

Remove the selected RPL relay, measure target-node packet loss and recovery, then restore the link and test the return path again.

Packet Pete — I check the next hop and the reply before trusting a route., your practice guide

Packet Pete — I check the next hop and the reply before trusting a route.
Predict the reading, then compare it with the measurement.

Contiki-NG Cooja

Third party Tool

Tier 2 · Free simulator · install required · No account

Version tested: Contiki-NG release/v4.9 c20b12cd, Cooja 4.8 (2022071901), Temurin 17.0.20.1, image sha256:b14d5afb0a2a852d9e72bbed607ead03f6ccc5f4d4dee44f0799110be2f4b609. Date: 2026-09-10.

Download the complete lab packet and follow README.md to run it in the free simulator.

Download the setup and run guide

Get the lab files

Download the complete packet for the simulation and its firmware, or download individual files for inspection. README.md gives the setup and run commands.

  • cooja-rpl-parent-switch.csc
  • README.md
  • expected-output.txt
  • lab-files.tar.gz

Steps

Screens captured against Contiki-NG Cooja Contiki-NG release/v4.9 c20b12cd, Cooja 4.8 (2022071901), Temurin 17.0.20.1, image sha256:b14d5afb0a2a852d9e72bbed607ead03f6ccc5f4d4dee44f0799110be2f4b609 on 2026-09-10; the tool may have moved on — the text steps are the contract.

  1. 1 Step 1

    Do
    From Cooja's File menu, open the CSC. The GUI pauses at about 89 s. Trace target mote 5’s current arrows toward root 1.
    You will see
    Run: headless cooja-rpl-parent-switch.csc; use the step input or filter. Serial: 85065000 ID:5 -- Preferred parent: fe80::203:3:3:3 (last DTSN: 240) Expected: target 5 initially routes via relay 3 to root 1.
    Why it matters
    Meaning: Keep a before-state record; a final successful path alone cannot establish what changed or how long recovery took. Boundary: A parent change and successful ping bound this fault run; they do not prove every mesh node recovered.
    Step 1: The baseline Network pane shows the 5 → 3 → 1 path. The orange ring marks the evidence; the numbered badge is outside it.
    Step 1 · Contiki-NG Cooja; numbered callout added to a real capture. Enlarge screenshot (new tab)
  2. 2 Step 2

    Do
    At the first pause, filter Mote output for ^-- Preferred parent|^-- Rank:. Record the baseline snapshot.
    You will see
    Run: headless cooja-rpl-parent-switch.csc; use the step input or filter. Serial: 85065000 ID:5 -- Rank: 422 Expected: baseline target rank is 422 at 85.065 s.
    Why it matters
    Meaning: The baseline names the actual parent and metric state before the ScriptRunner chooses which relay to remove. Boundary: A parent change and successful ping bound this fault run; they do not prove every mesh node recovered.
    Step 2: The baseline parent and Rank rows are visible. The orange ring marks the evidence; the numbered badge is outside it.
    Step 2 · Contiki-NG Cooja; numbered callout added to a real capture. Enlarge screenshot (new tab)
  3. 3 Step 3

    Do
    Click Start/Pause once and let the GUI reach its second pause near 150 s. Inspect target 5 in Network.
    You will see
    Run: headless cooja-rpl-parent-switch.csc; use the step input or filter. Serial: FAULT removed_parent=3 at_us=90065000 Expected: relay 3 is removed at 90.065 s; target 5 must find another parent.
    Why it matters
    Meaning: The intervention removes a real radio path. The new arrow is a real default-route annotation, not a drawn replacement. Boundary: A parent change and successful ping bound this fault run; they do not prove every mesh node recovered.
    Step 3: The changed Network pane shows target 5 using relay 2 after the fault. The orange ring marks the evidence; the numbered badge is outside it.
    Step 3 · Contiki-NG Cooja; numbered callout added to a real capture. Enlarge screenshot (new tab)
  4. 4 Step 4

    Do
    In Cooja's Mote output window, at the second pause, use the parent/Rank filter again and compare both snapshots. Read the change timestamp in expected-output.txt.
    You will see
    Run: headless cooja-rpl-parent-switch.csc; use the step input or filter. Serial: 140065000 ID:5 -- Rank: 425 Expected: post-fault target rank is 425 at 140.065 s in the actual run and capture.
    Why it matters
    Meaning: Route-state recovery and packet recovery are different events. Record both rather than calling the whole interval instantaneous convergence. Boundary: A parent change and successful ping bound this fault run; they do not prove every mesh node recovered.
    Step 4: The before and changed parent/Rank rows are shown; the ring marks the changed state. The orange ring marks the evidence; the numbered badge is outside it.
    Step 4 · Contiki-NG Cooja; numbered callout added to a real capture. Enlarge screenshot (new tab)
  5. 5 Step 5

    Do
    In Cooja's Mote output window, filter for Received ping reply. Check the root-initiated test after the parent change.
    You will see
    Run: headless cooja-rpl-parent-switch.csc; use the step input or filter. Serial: 145136696 ID:1 Received ping reply from fd00::205:5:5:5, len 4, ttl 63, delay 71 ms Expected: the first post-fault root ping returns in 71 ms.
    Why it matters
    Meaning: The first recovered uplink appears at 110.644856 s and reply at 110.711112 s. Those bound application recovery later than the parent change. Boundary: A parent change and successful ping bound this fault run; they do not prove every mesh node recovered.
    Step 5: The actual post-change root-to-target ping reply is visible. The orange ring marks the evidence; the numbered badge is outside it.
    Step 5 · Contiki-NG Cooja; numbered callout added to a real capture. Enlarge screenshot (new tab)
  6. 6 Step 6

    Do
    On Cooja's simulation toolbar, click Start/Pause again. The relay returns at 210.065 s; the run stops at 300 s. Reapply the parent/Rank filter.
    You will see
    Run: headless cooja-rpl-parent-switch.csc; use the step input or filter. Serial: 260065000 ID:5 -- Preferred parent: fe80::202:2:2:2 (last DTSN: 240) Expected: target 5 still uses relay 2 after relay 3 returns.
    Why it matters
    Meaning: Restoring physical reachability does not force the original parent back. Retention, link freshness and hysteresis must be observed, not assumed. Boundary: A parent change and successful ping bound this fault run; they do not prove every mesh node recovered.
    Step 6: All three snapshots are visible; the ring marks the restored-link target state. The orange ring marks the evidence; the numbered badge is outside it.
    Step 6 · Contiki-NG Cooja; numbered callout added to a real capture. Enlarge screenshot (new tab)
  7. 7 Step 7

    Do
    In Cooja's Mote output window, filter for Received ping reply and check the second reply. Complete the README forwarding worksheet and six-part recovery record.
    You will see
    Run: headless cooja-rpl-parent-switch.csc; use the step input or filter. Serial: 270166696 ID:1 Received ping reply from fd00::205:5:5:5, len 4, ttl 63, delay 101 ms Expected: the final root ping returns in 101 ms.
    Why it matters
    Meaning: Accept the tested target path with its loss window and limits. Nodes 3 and 6 do not have active parent annotations at the end; this is not proof that the entire mesh recovered. Boundary: A parent change and successful ping bound this fault run; they do not prove every mesh node recovered.
    Step 7: The post-restoration ping reply is visible and ringed. The orange ring marks the evidence; the numbered badge is outside it.
    Step 7 · Contiki-NG Cooja; 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 node keeps switching between two parents with similar metrics, and telemetry still reaches the root most of the time. What is the strongest routing review response?

    Return to the chapter’s knowledge check
  2. A sensor can ping its gateway, but cloud replies never return. What does the evidence prove?

    Return to the chapter’s knowledge check

Caution

The GUI intentionally pauses twice. Continue each pause to complete the test. Recovery assertions apply to target 5; relay 3 and its subtree are not proven fully repaired by the 300-second deadline. Do not equate a first successful reply with zero loss during convergence.

Return to Routing in Low-Power IoT Networks · Browse Labs