Skip to content

Compare RPL objective functions and candidate paths

Compare real MRHOF and OF0 parent records, then explain how their state differs from longest-prefix, Dijkstra and distance-vector worksheets.

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

Compare real MRHOF and OF0 parent records, then explain how their state differs from longest-prefix, Dijkstra and distance-vector worksheets.

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-objective-functions.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
    Run the primary MRHOF CSC to 180 s. Trace mote 5’s arrows in Network; predict whether it will choose relay 2 or 3.
    You will see
    Mote 5 uses 2 → 1 in this seed-1 run. Both candidate relays are within its 50 m range.
    Why it matters
    A visible path is an output; the candidate records explain why this output is defensible.
    Step 1: The six-mote MRHOF network shows the selected paths. 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
    Filter Mote output for ^fe80::20[23].*=> and compare the rpl-nbr snapshot at 140.065 s.
    You will see
    For mote 5, relay 2 shows 310, 159 => 469; relay 3 shows 286, 249 => 535.
    Why it matters
    The columns are neighbor Rank, link metric and resulting Rank. MRHOF uses accumulated link cost plus eligibility, freshness and hysteresis rules.
    Step 2: The two MRHOF candidate rows show the selected and rejected costs. 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
    Filter for ^-- OF:|^-- Preferred parent|^-- Rank:|^-- Hop rank increment. Check the chosen function and state at 141.065 s.
    You will see
    MRHOF reports hop-rank increment 128, parent fe80::202:2:2:2 and Rank 469.
    Why it matters
    A claimed objective function must match the running firmware. The project header compiles both supported functions and explicitly selects MRHOF.
    Step 3: The MRHOF name, increment, parent and Rank are shown. 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
    Open cooja-rpl-objective-functions-of0.csc. After it stops, use the candidate filter from step 2.
    You will see
    OF0 shows relay 2: 512, 187 => 1024; relay 3: 768, 181 => 1280.
    Why it matters
    The topology, seed and 0.80 receive-success setting are held fixed. Different control behavior changes the observed link samples; this is not a promise of identical packet histories.
    Step 4: The OF0 candidate rows give their distinct Rank calculations. 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
    Use the state filter from step 3 in the OF0 run. Compare the selected parent and Rank with MRHOF.
    You will see
    OF0 reports increment 256 and Rank 1024, also through parent 2. Both headless runs deliver 78 requests and receive replies at all five clients.
    Why it matters
    Do not compare raw Rank numbers as a universal score across objective functions. These functions agree on the parent here; the measurements do not show a delivery winner.
    Step 5: The OF0 configuration and selected parent are 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
    Filter for Received ping reply, then complete the README’s prefix, Dijkstra and distance-vector trace tables, including their link-removal cases.
    You will see
    OF0’s root ping returns ttl 63 and delay 94 ms; MRHOF’s log reports 100 ms. In the separate worksheet, Dijkstra improves R3 from cost 5 to 4 via R2/R4.
    Why it matters
    Packet success checks the selected RPL path. The paper traces preserve the original algorithm exercises without pretending that this firmware runs OSPF, RIP or DSDV.
    Step 6: The actual OF0 two-hop ping reply is visible. 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)

Chapter checks

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

  1. A constrained mesh sends most readings upward to one gateway. Several leaf nodes can hear two relays, but one relay has a much weaker wireless link even though it is one hop closer to the root. Which design record is strongest?

    Return to the chapter’s knowledge check
  2. 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

Caution

The 0.80 receive-success setting is a radio-model probability, not measured delivery ratio. Retries can hide that loss at application level. Rank scales and control histories differ between functions; do not rank their quality by raw Rank alone.

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