717  RPL DODAG Worked Example: Smart Lighting Network

717.1 Learning Objectives

After completing this chapter, you will be able to:

  • Calculate RANK values step-by-step for a real network topology
  • Apply the ETX-based objective function formula
  • Make parent selection decisions when multiple options exist
  • Interpret the final DODAG structure for routing decisions

717.2 Worked Example: DODAG Construction Step-by-Step

Note10-Node Smart Lighting Network

This worked example walks through the complete DODAG construction process for a realistic smart lighting deployment. We will calculate RANK values using actual RPL parameters and show how parent selection works with varying link qualities.

717.2.1 Problem Context

Scenario: You are deploying a smart lighting mesh network in a commercial building lobby. The network consists of:

  • 1 Border Router (Root): Connected to the building management system
  • 9 Smart Light Controllers: Need to report status and receive dimming commands
  • Goal: Build an RPL DODAG for reliable many-to-one (sensor data) and one-to-many (commands) communication

717.2.2 Given Parameters

RPL Configuration (RFC 6550 defaults):

Parameter Value Description
MinHopRankIncrease 256 Minimum RANK increase per hop
Objective Function OF0 with ETX Minimize Expected Transmission Count
ETX Calculation ETX = 1 / (delivery_ratio) Higher ETX = worse link
RANK Formula RANK = Parent_RANK + (MinHopRankIncrease x ETX) Cumulative path cost

Network Topology and Link Quality:

Graph diagram

Graph diagram
Figure 717.1: 9-node DODAG showing RANK hierarchy and parent selection

{fig-alt=“10-node smart lighting network topology showing border router ROOT at top connected to first-hop nodes A B C, which connect to second-hop nodes D E F, which connect to third-hop leaf nodes G H I. Links labeled with ETX values ranging from 1.0 for good links to 2.0 for poor links, demonstrating varying wireless link quality in building environment”}

717.2.3 Solution: Step-by-Step DODAG Construction

717.2.3.1 Step 1: Root Advertisement (t = 0s)

Root Action: Border router initializes DODAG and broadcasts first DIO message.

DIO Message Contents:

DIO {
  DODAG_ID: fd00::1
  RANK: 0
  Version: 1
  MinHopRankIncrease: 256
  Objective Function: OF0 (ETX)
}

Result: Root has RANK = 0. All nodes within radio range receive this DIO.


717.2.3.2 Step 2: First-Hop Nodes Calculate RANK (t = 2-5s)

Nodes A, B, and C receive the root’s DIO and calculate their RANK values:

Node A Calculation: \[\text{RANK}_A = \text{Parent\_RANK} + (\text{MinHopRankIncrease} \times \text{ETX})\] \[\text{RANK}_A = 0 + (256 \times 1.0) = \mathbf{256}\]

Node B Calculation: \[\text{RANK}_B = 0 + (256 \times 1.0) = \mathbf{256}\]

Node C Calculation: \[\text{RANK}_C = 0 + (256 \times 1.5) = \mathbf{384}\]

Parent Selection: All three nodes select ROOT as parent (only option).

Node Parent ETX to Parent Calculated RANK
A ROOT 1.0 256
B ROOT 1.0 256
C ROOT 1.5 384

Actions: 1. Each node sends DAO to ROOT announcing reachability 2. Each node broadcasts DIO with its new RANK to neighbors


717.2.3.3 Step 3: Second-Hop Nodes - Parent Selection Decision (t = 5-10s)

This is where RPL’s intelligence shines. Second-hop nodes may hear DIOs from multiple parents and must choose the best one.

Node D: Receives DIO only from Node A \[\text{RANK}_D = 256 + (256 \times 1.0) = \mathbf{512}\] - Parent: A (only option)

Node E: Receives DIOs from both A and B (key decision point!)

Option 1: Via Node A (ETX 1.5) \[\text{RANK}_E^{(A)} = 256 + (256 \times 1.5) = 640\]

Option 2: Via Node B (ETX 1.0) \[\text{RANK}_E^{(B)} = 256 + (256 \times 1.0) = \mathbf{512}\]

Decision: Node E selects B as primary parent (lower RANK = better path) - Node E also stores A as backup parent (RANK 640, valid alternate)

Node F: Receives DIOs from B and C

Option 1: Via Node B (ETX 1.0) \[\text{RANK}_F^{(B)} = 256 + (256 \times 1.0) = \mathbf{512}\]

Option 2: Via Node C (ETX 1.5) \[\text{RANK}_F^{(C)} = 384 + (256 \times 1.5) = 768\]

Decision: Node F selects B as primary parent (RANK 512 < 768)

Node Candidate Parents Calculated RANKs Selected Parent Final RANK
D A only 512 A 512
E A (640), B (512) 640, 512 B 512
F B (512), C (768) 512, 768 B 512
TipKey Insight: Link Quality Trumps Hop Count

Notice that Node F could reach ROOT via C in just 2 hops (F->C->ROOT), but the poor link quality (ETX 1.5 + 1.5) makes this path worse than going through B (ETX 1.0 + 1.0), even though both are 2 hops. RANK incorporates link quality, not just hop count.


717.2.3.4 Step 4: Third-Hop Nodes - Final RANK Calculation (t = 10-15s)

Node G: Receives DIOs from D and E

Option 1: Via Node D (ETX 1.0) \[\text{RANK}_G^{(D)} = 512 + (256 \times 1.0) = \mathbf{768}\]

Option 2: Via Node E (ETX 2.0 - poor link!) \[\text{RANK}_G^{(E)} = 512 + (256 \times 2.0) = 1024\]

Decision: Node G selects D as parent (768 < 1024)

Node H: Receives DIOs from E and F

Option 1: Via Node E (ETX 1.0) \[\text{RANK}_H^{(E)} = 512 + (256 \times 1.0) = \mathbf{768}\]

Option 2: Via Node F (ETX 1.5) \[\text{RANK}_H^{(F)} = 512 + (256 \times 1.5) = 896\]

Decision: Node H selects E as parent (768 < 896)

Node I: Receives DIO only from F \[\text{RANK}_I = 512 + (256 \times 1.0) = \mathbf{768}\] - Parent: F (only option)

Node Candidate Parents Calculated RANKs Selected Parent Final RANK
G D (768), E (1024) 768, 1024 D 768
H E (768), F (896) 768, 896 E 768
I F only 768 F 768

717.2.3.5 Step 5: DAO Propagation - Building Downward Routes (t = 15-25s)

After DODAG formation, DAO messages flow upward to build downward routing tables:

Mermaid diagram

Mermaid diagram
Figure 717.2: DAO upward propagation and aggregation sequence

{fig-alt=“DAO message propagation sequence showing Node G sending DAO to parent D announcing reachability, D aggregating and sending to A, A aggregating and sending to ROOT. Each intermediate node stores routing entries. ROOT confirms with DAO-ACK flowing back down through D and A to G, completing downward route establishment”}


717.2.3.6 Step 6: Final DODAG Structure (t = 25-30s)

Graph diagram

Graph diagram
Figure 717.3: Final DODAG structure with RANK values and backup parents

{fig-alt=“Final DODAG structure for 10-node smart lighting network showing hierarchical tree rooted at border router with Rank 0. First hop has nodes A B C with Ranks 256 256 384. Second hop has D E F all with Rank 512, where B serves as parent for both E and F. Third hop has leaf nodes G H I all with Rank 768. Dotted lines show backup parent relationships from A to E and F to H for fault tolerance”}

717.2.4 Final Answer: Complete RANK Summary

Node Layer Parent ETX to Parent RANK Calculation Final RANK
ROOT 0 - - Root node 0
A 1 ROOT 1.0 0 + 256x1.0 256
B 1 ROOT 1.0 0 + 256x1.0 256
C 1 ROOT 1.5 0 + 256x1.5 384
D 2 A 1.0 256 + 256x1.0 512
E 2 B 1.0 256 + 256x1.0 512
F 2 B 1.0 256 + 256x1.0 512
G 3 D 1.0 512 + 256x1.0 768
H 3 E 1.0 512 + 256x1.0 768
I 3 F 1.0 512 + 256x1.0 768

717.3 Interpretation: How RANK Determines Routing

717.3.1 Upward Routing (Sensor Data -> Cloud)

  • Each node simply forwards to its parent (follows decreasing RANK)
  • Example: Light #9 (Node I) sends status -> F (512) -> B (256) -> ROOT (0) -> Cloud
  • Total path cost: 768 (Node I’s RANK represents cumulative ETX)

717.3.2 Downward Routing (Commands -> Lights)

  • ROOT uses stored routing table from DAO messages
  • Example: Dim command to Light #7 (Node G): ROOT -> A -> D -> G
  • Source routing header (Non-Storing) or hop-by-hop lookup (Storing)

717.3.3 Loop Prevention

  • Data only flows toward lower RANK (upward) or via explicit routes (downward)
  • Node E (RANK 512) cannot send to Node F (RANK 512) directly
  • Point-to-point: E -> B (256) -> F (512) via common ancestor

717.3.4 Fault Tolerance

  • If Node B fails, E has backup parent A (RANK 640 > 512, but functional)
  • E would recalculate: RANK_E = 256 + 384 = 640, network continues operating
  • Trickle timer detects failure within 3-4 DIO intervals
ImportantKey Takeaways from This Example
  1. RANK is cumulative: Each hop adds MinHopRankIncrease x ETX, not just +1
  2. Link quality matters: Node F chose B over C despite C being available, because B offered better cumulative path quality
  3. Multiple parents: Nodes can maintain backup parents for resilience (A as backup for E)
  4. Unbalanced trees are OK: Node B has 3 descendants (E, F, H, I indirectly), while C has none - this is optimal given link quality
  5. RANK inversion = loop: If Node H somehow got RANK < 512, it would create a loop with E - RPL prevents this
  6. MinHopRankIncrease = 256: This standard value allows for 16 sub-levels (256/16=16) of rank differentiation per hop for fine-grained path selection

717.4 Practice Problems

717.4.1 Problem 1: Calculate New Node RANK

A new node J is added to the network with these link qualities: - J to G: ETX = 1.2 - J to H: ETX = 1.8

Question: What RANK will node J have, and which parent will it select?

Via G (ETX 1.2): \[\text{RANK}_J^{(G)} = 768 + (256 \times 1.2) = 768 + 307 = 1075\]

Via H (ETX 1.8): \[\text{RANK}_J^{(H)} = 768 + (256 \times 1.8) = 768 + 461 = 1229\]

Answer: Node J selects G as parent with RANK = 1075

717.4.2 Problem 2: Parent Failure Recovery

Node B fails. What happens to nodes E, F, H, and I?

Node E: Has backup parent A - New RANK: 256 + (256 x 1.5) = 640 - Children (H) must also update

Node F: Must find new parent - Only option: C (ETX 1.5) - New RANK: 384 + (256 x 1.5) = 768 - Children (I) must also update

Node H: Updates due to E’s change - New RANK via E: 640 + (256 x 1.0) = 896

Node I: Updates due to F’s change - New RANK via F: 768 + (256 x 1.0) = 1024

Key insight: Network self-heals but path quality degrades (RANKs increase)

717.5 Summary

This worked example demonstrated:

  • RANK Calculation: Using MinHopRankIncrease x ETX formula
  • Parent Selection: Choosing lowest cumulative path cost
  • Multi-Option Decisions: Comparing candidates when multiple parents available
  • Final Structure: Hierarchical tree with RANK-based routing
  • Routing Implications: Upward via parent pointers, downward via DAO tables
  • Fault Tolerance: Backup parents enable automatic recovery

717.6 What’s Next

Continue learning about DODAG construction details: