19  RPL Fundamentals and Construction

In 60 Seconds

RPL (RFC 6550) is a distance-vector routing protocol designed for IoT networks with high packet loss (10-40%), constrained resources (8-32 MHz CPU, 10-128 KB RAM), and battery power. It builds a DODAG (Destination Oriented Directed Acyclic Graph) topology where RANK represents path quality – not hop count – enabling energy-efficient, loop-free routing through Storing or Non-Storing modes.

19.1 IPv6 Routing Protocol for Low-Power and Lossy Networks (RPL)

Learning Objectives

By the end of this section, you will be able to:

  • Analyze why traditional routing protocols fail for Low-Power and Lossy Networks (LLNs)
  • Classify RPL as a distance-vector routing protocol and contrast it with link-state alternatives
  • Describe DODAG (Destination Oriented Directed Acyclic Graph) topology and its loop-free guarantee
  • Demonstrate the RANK mechanism for loop prevention using objective function calculations
  • Compare Storing mode and Non-Storing mode trade-offs for memory, latency, and scalability
  • Trace upward, downward, and point-to-point routing paths through a DODAG
  • Select appropriate RPL configurations for different IoT deployment scenarios
  • Evaluate RPL performance trade-offs across energy, convergence, and reliability

RPL (Routing Protocol for Low-Power and Lossy Networks) is a routing protocol designed specifically for IoT devices that have limited battery and unreliable connections. Think of it as a trail-marking system for hikers in a foggy forest – it helps devices find paths to the destination even when conditions keep changing.

“RPL is like a trail-marking system in a foggy forest,” said Sammy the Sensor. “We need to find our way to the ranger station – the root – even though visibility keeps changing and some trails wash out in the rain.”

“Traditional trail maps would not work for us,” explained Max the Microcontroller. “They assume perfect conditions and require a complete map of every trail – way too much for our tiny brains to store. RPL gives each of us just one piece of information: which neighbor is closest to the ranger station. That is our preferred parent.”

“The RANK is like altitude markers on the trail,” added Lila the LED. “The ranger station is at sea level – RANK zero. As you climb higher, your RANK increases. Data always flows downhill toward the station, and you can never forward to someone at a higher altitude. That prevents going in circles!”

“And we have two modes,” said Bella the Battery. “In Storing mode, each trail junction remembers where hikers behind it are heading – useful for sending messages back. In Non-Storing mode, only the ranger station keeps the full map, and it writes the complete route on each message. Each mode has trade-offs between memory use and efficiency!”

19.2 Overview

RPL (IPv6 Routing Protocol for Low-Power and Lossy Networks) is a distance-vector routing protocol specifically designed for resource-constrained IoT devices operating in challenging network conditions. Unlike traditional routing protocols like OSPF and RIP, RPL is optimized for networks with:

  • High packet loss (10-40%)
  • Constrained resources (8-32 MHz CPU, 10-128 KB RAM)
  • Battery-powered devices (milliwatt power consumption)
  • Many-to-one traffic patterns (sensors reporting to gateway)

RPL builds a DODAG (Destination Oriented Directed Acyclic Graph)—a tree-like structure that naturally routes data upward to a central collection point while supporting downward and peer-to-peer traffic when needed.

Quantifying DODAG Memory Efficiency vs Flat Mesh Routing

Consider a network with typical IoT constraints (32 KB RAM, 128 KB flash). Flat mesh routing requires one entry per destination (16-byte IPv6 address + 2-byte next-hop index = 18 bytes each), while RPL stores only a small parent set (preferred parent + backups).

Use the calculator below to explore how routing memory scales with network size:

For a 500-node industrial deployment with 4 RPL parents: flat mesh requires 8.8 KB per node vs RPL’s 80 bytes – a 110x reduction.

19.3 Chapter Contents

This comprehensive guide to RPL is organized into four focused chapters:

19.3.1 1. RPL Introduction and Core Concepts

Covers: Why traditional routing fails for IoT, DODAG topology, RANK mechanism, control messages (DIO, DIS, DAO), and core concepts.

Key topics:

  • The challenge of routing in lossy, low-power networks
  • DAG vs DODAG structures
  • RANK as distance to root (not hop count!)
  • RPL message types and their purposes
  • Smart building example with 100 sensors

Best for: Beginners starting with RPL or reviewing fundamentals


19.3.2 2. RPL DODAG Construction Process

Covers: Step-by-step DODAG construction algorithm, visual guides, message flows, and timing.

Key topics:

  • 5-phase construction algorithm
  • 7-step DODAG formation with timing
  • Message flow sequence diagrams
  • RANK calculation during formation
  • Convergence timing for 50-node networks

Best for: Understanding how RPL networks self-organize


19.3.3 3. RPL Worked Example: Smart Lighting Network

Covers: Complete step-by-step RANK calculation for a 10-node smart lighting deployment.

Key topics:

  • RANK calculation with MinHopRankIncrease and ETX
  • Parent selection with multiple candidates
  • Link quality impact on path selection
  • DAO propagation for downward routes
  • Interpreting final DODAG structure

Best for: Applying concepts through concrete calculations


19.3.4 4. RPL Trickle Algorithm and Routing Modes

Covers: Trickle timer for adaptive control messages, Storing vs Non-Storing modes, traffic patterns, and common pitfalls.

Key topics:

  • Trickle “polite gossip” algorithm
  • Energy savings (99.7% reduction in control overhead)
  • Storing mode vs Non-Storing mode trade-offs
  • Many-to-one, one-to-many, and P2P traffic
  • Interactive DODAG Builder (OJS simulation)

Best for: Optimizing RPL deployments and troubleshooting


19.4 Quick Reference

Concept Description Chapter
DODAG Destination Oriented Directed Acyclic Graph Introduction
RANK Node’s distance to root (lower = closer) Introduction
DIO DODAG Information Object (advertises network) Introduction
DIS DODAG Information Solicitation (requests info) Introduction
DAO Destination Advertisement Object (builds routes) Construction
ETX Expected Transmission Count (link quality metric) Worked Example
Trickle Adaptive timer for control messages Trickle & Modes
Storing Mode Distributed routing tables Trickle & Modes
Non-Storing Mode Centralized routing at root Trickle & Modes

19.5 Prerequisites

Before diving into RPL, you should be familiar with:

Key Concepts

  • RPL Overview: RPL (RFC 6550) builds DODAGs over LLNs, supporting MP2P (sensor-to-cloud), P2MP (cloud-to-device), and P2P (device-to-device) traffic patterns.
  • DODAG Construction Process: Root broadcasts DIO → neighbors join and rebroadcast → DODAG grows outward level by level → nodes compute RANK using Objective Function → DAOs register routes upward.
  • Objective Function: The RPL algorithm component computing RANK and selecting parents; OF0 uses hop count, MRHOF uses ETX for link-quality-aware routing.
  • RPL Instance: A single RPL deployment identified by an RPLInstanceID; multiple instances can coexist on the same physical network for different traffic classes.

19.7 Knowledge Check

Common Mistake: Deploying RPL Without Objective Function Planning

The Error: Using the default RPL objective function (OF0 - hop count minimization) for all deployments without considering application-specific requirements.

Why It’s Problematic:

RPL supports multiple objective functions (OFs) that optimize for different metrics. Choosing the wrong OF leads to poor network performance, wasted battery, or unmet application requirements.

Real-World Example - Cold Chain Logistics (2022):

A pharmaceutical distributor deployed 200 temperature sensors across refrigerated warehouses to monitor vaccine storage: - Initial deployment: OF0 (RFC 6552 - hop count minimization) - Result: 40% of sensors reported > 2 second data latency (unacceptable for real-time alerts) - Root cause: OF0 selected shortest hop paths, but some 2-hop paths had 800ms latency per hop (congested nodes handling many children)

The Fix:

Switched to latency-aware objective function:

Custom OF based on MRHOF (RFC 6719):
- Primary metric: End-to-end latency
- Secondary metric: ETX (tie-breaker)

Results:

  • Average latency: 2.1 seconds → 420 ms (80% reduction)
  • 98% of alerts delivered within 500ms SLA
  • Battery life only reduced by 8% (acceptable trade-off for critical application)

Objective Function Comparison:

Objective Function Optimizes For Best Use Case Trade-offs
OF0 (RFC 6552) Hop count Low-latency, simple networks Ignores link quality, may choose lossy paths
MRHOF (RFC 6719) ETX (link quality) Reliable data delivery Higher control overhead (ETX probing)
Energy-OF Residual energy Balanced battery drain Complex computation on nodes
Latency-OF End-to-end delay Time-critical applications May choose longer paths
Composite-OF Multi-metric Complex requirements Difficult to tune weights

How to Choose the Right Objective Function:

Step 1: Define Application Requirements

  • Reliability priority: Use MRHOF (ETX-based)
  • Speed priority: Use OF0 or Latency-OF
  • Battery priority: Use Energy-OF
  • Cost priority: Use OF0 (simplest)

Step 2: Evaluate Network Characteristics

  • Stable links (ETX < 1.5): OF0 works fine
  • Lossy links (ETX > 2.0): MUST use MRHOF
  • Mixed node types (mains + battery): Use Energy-OF to avoid draining battery nodes
  • Deep networks (> 10 hops): OF0 for simplicity

Step 3: Validate in Field Trial

Deploy 5-10 nodes with each candidate OF, measure for 7 days: - Packet delivery rate (target > 95%) - Average latency (compare to SLA) - Battery drain (mAh per day) - Parent switching frequency (target < 3 per day)

Practical Implementation:

Most RPL stacks (Contiki-NG, RIOT, OpenWSN) support multiple OFs via configuration:

// Contiki-NG example
#define RPL_CONF_OF rpl_mrhof  // Options: rpl_of0, rpl_mrhof
#define RPL_MRHOF_CONF_SQUARED_ETX 1  // Use ETX² for better differentiation

Best Practice: Start with MRHOF as baseline (most versatile), then optimize if needed. OF0 is only appropriate for controlled environments with reliable links (indoor enterprise Wi-Fi, wired Ethernet backhaul).

19.8 Concept Relationships

This overview page connects to the complete RPL learning path:

Foundation Concepts:

This Series Covers:

Leads To:

Related Protocols:

19.9 See Also

Official Specifications:

  • RFC 6550: “RPL: IPv6 Routing Protocol for Low-Power and Lossy Networks” - Core standard
  • RFC 6552: “Objective Function Zero for RPL” - OF0 specification
  • RFC 6719: “MRHOF for RPL” - Minimum Rank with Hysteresis Objective Function
  • RFC 6206: “Trickle Algorithm” - Adaptive timer specification

Books and Comprehensive Guides:

  • Vasseur & Dunkels “Interconnecting Smart Objects with IP” (2010) - Chapter 5-6 cover RPL in depth
  • Shelby & Bormann “6LoWPAN: The Wireless Embedded Internet” (2009) - RPL integration with 6LoWPAN
  • Dunkels, Eriksson & Finne “Run-Time Dynamic Linking for Reprogramming Wireless Sensor Networks” - Contiki OS context

Implementation Resources:

  • Contiki-NG RPL Documentation - Open-source RPL stack
  • RIOT OS RPL Module - Alternative implementation
  • OpenWSN RPL Implementation - Standards-compliant reference

Comparison and Analysis:

Hands-On Learning:

Real-World Deployments:

  • Itron OpenWay Riva - 35 million smart meters using RPL
  • Philips Hue Smart Lighting - Thread-based (RPL variant)
  • Emerson SmartMesh IP - Industrial WSN with RPL

19.10 What’s Next

Next Chapter
Start here RPL Introduction and Core Concepts
Construction RPL DODAG Construction Process
Calculate RPL Worked Example
Optimize RPL Trickle and Modes