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

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

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
    Open the CSC. The GUI pauses at about 89 s. Trace target mote 5’s current arrows toward root 1.
    You will see
    Before the fault, target 5 uses parent 3, then root 1.
    Why it matters
    Keep a before-state record; a final successful path alone cannot establish what changed or how long recovery took.
    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
    At 85.065 s, target 5 reports parent fe80::203:3:3:3 and Rank 422.
    Why it matters
    The baseline names the actual parent and metric state before the ScriptRunner chooses which relay to remove.
    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
    The script moves the actual preferred relay 3 to (300,300) at 90.065 s. Target 5 now reaches the root through relay 2. Relay 3 is outside the shown viewport.
    Why it matters
    The intervention removes a real radio path. The new arrow is a real default-route annotation, not a drawn replacement.
    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
    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
    The 140.065 s snapshot reports parent 2 and Rank 420. The first new-parent annotation occurs at 100.760728 s, 10.695728 s after removal.
    Why it matters
    Route-state recovery and packet recovery are different events. Record both rather than calling the whole interval instantaneous convergence.
    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
    Filter for Received ping reply. Check the root-initiated test after the parent change.
    You will see
    The root receives a reply from target 5 with ttl 63 and delay 71 ms. During the fault window, the log records 12 target requests sent, 10 received, and 10 replies received by the target.
    Why it matters
    The first recovered uplink appears at 110.644856 s and reply at 110.711112 s. Those bound application recovery later than the parent change.
    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
    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
    At 260.065 s, target 5 still prefers relay 2, with Rank 395. It does not return to relay 3 during this observation window.
    Why it matters
    Restoring physical reachability does not force the original parent back. Retention, link freshness and hysteresis must be observed, not assumed.
    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
    Filter for Received ping reply and check the second reply. Complete the README forwarding worksheet and six-part recovery record.
    You will see
    The final root-to-target ping has ttl 63 and delay 101 ms. The script passes only after a parent change, repeated target uplink/reply successes, and both downward pings.
    Why it matters
    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.
    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