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

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
    Run: headless cooja-rpl-objective-functions.csc; use the step input or filter. Serial: 141065000 ID:5 -- Preferred parent: fe80::202:2:2:2 (last DTSN: 240) Expected: MRHOF mote 5 selects relay 2.
    Why it matters
    Meaning: A visible path is an output; the candidate records explain why this output is defensible. Boundary: The two objective functions are compared in separate fixed-seed simulations.
    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
    Run: headless cooja-rpl-objective-functions.csc; use the step input or filter. Serial: 140065000 ID:5 fe80::202:2:2:2 310, 159 => 469 -- 16 bafp (last tx 0 min ago) Expected: MRHOF candidate 2 totals 469, below candidate 3 at 535.
    Why it matters
    Meaning: The columns are neighbor Rank, link metric and resulting Rank. MRHOF uses accumulated link cost plus eligibility, freshness and hysteresis rules. Boundary: The two objective functions are compared in separate fixed-seed simulations.
    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
    In Cooja's Mote output window, filter for ^-- OF:|^-- Preferred parent|^-- Rank:|^-- Hop rank increment. Check the chosen function and state at 141.065 s.
    You will see
    Run: headless cooja-rpl-objective-functions.csc; use the step input or filter. Serial: 141065000 ID:5 -- Rank: 469 Expected: MRHOF selected rank is 469 through relay 2.
    Why it matters
    Meaning: A claimed objective function must match the running firmware. The project header compiles both supported functions and explicitly selects MRHOF. Boundary: The two objective functions are compared in separate fixed-seed simulations.
    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
    From Cooja's File menu, open cooja-rpl-objective-functions-of0.csc. After it stops, use the candidate filter from step 2.
    You will see
    Run: headless cooja-rpl-objective-functions-of0.csc; use the step input or filter. Serial: 140065000 ID:5 fe80::202:2:2:2 512, 187 => 1024 -- 11 bafp (last tx 0 min ago) Expected: OF0 candidate 2 totals 1024, below candidate 3 at 1280.
    Why it matters
    Meaning: 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. Boundary: The two objective functions are compared in separate fixed-seed simulations.
    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
    In Cooja's Mote output window, use the state filter from step 3 in the OF0 run. Compare the selected parent and Rank with MRHOF.
    You will see
    Run: headless cooja-rpl-objective-functions-of0.csc; use the step input or filter. Serial: 141065000 ID:5 -- Rank: 1024 Expected: OF0 selects relay 2 at rank 1024.
    Why it matters
    Meaning: 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. Boundary: The two objective functions are compared in separate fixed-seed simulations.
    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
    In Cooja's Mote output window, 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
    Run: headless cooja-rpl-objective-functions-of0.csc; use the step input or filter. Serial: 150159952 ID:5 Received ping reply from fd00::201:1:1:1, len 4, ttl 63, delay 94 ms Expected: OF0 two-hop root ping returns in 94 ms; MRHOF returns in 100 ms.
    Why it matters
    Meaning: 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. Boundary: The two objective functions are compared in separate fixed-seed simulations.
    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