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.
Predict the reading, then compare it with the measurement.
Contiki-NG Cooja
Third party ToolDownload the complete lab packet and follow README.md to run it in the free simulator.
Download the setup and run guideGet 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.
Steps
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 · Contiki-NG Cooja; numbered callout added to a real capture. Enlarge screenshot (new tab) 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 · Contiki-NG Cooja; numbered callout added to a real capture. Enlarge screenshot (new tab) 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: 469Expected: 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 · Contiki-NG Cooja; numbered callout added to a real capture. Enlarge screenshot (new tab) 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 · Contiki-NG Cooja; numbered callout added to a real capture. Enlarge screenshot (new tab) 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: 1024Expected: 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 · Contiki-NG Cooja; numbered callout added to a real capture. Enlarge screenshot (new tab) 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 msExpected: 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 · 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.
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 checkA 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