34 RPL Routing
Learning Objectives
By completing this series, 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 justify its design for IoT
- Diagram DODAG (Destination Oriented Directed Acyclic Graph) topology and its formation process
- Calculate RANK values and demonstrate loop prevention through hierarchical ordering
- Compare Storing mode vs Non-Storing mode trade-offs for memory, latency, and scalability
- Differentiate upward, downward, and point-to-point routing paths in RPL
- Design RPL networks optimized for specific IoT application requirements
- Evaluate RPL performance trade-offs for production deployment decisions
For Beginners: RPL Routing Overview
RPL (Routing Protocol for Low-Power and Lossy Networks) helps tiny, battery-powered IoT devices figure out how to send their data to a central collection point. It is like a trail system in a park where every path eventually leads to the visitor center – no matter which trail you start on, you will find your way.
Sensor Squad: The Complete RPL Adventure!
“RPL is the most important routing protocol for IoT, and this series covers everything,” said Max the Microcontroller. “Think of it like a park trail system where every path leads to the visitor center. No matter where you start, you will find your way.”
“First we learn WHY we need RPL – regular routing protocols are too heavy for tiny devices like us,” said Sammy the Sensor. “Then we learn HOW RPL builds its tree structure with DODAG construction and those four control messages: DIO, DIS, DAO, and DAO-ACK.”
“Then comes the fun part – traffic patterns,” added Lila the LED. “Upward traffic is sensors sending data to the root. Downward traffic is the root sending commands back to specific sensors. And point-to-point is two sensors talking to each other through the tree.”
“Finally, we learn about deploying RPL in the real world,” concluded Bella the Battery. “Which mode to use – Storing or Non-Storing – how to handle security, what happens when devices move around, and how to tune the network for different applications. By the end, you will be an RPL expert!”
34.1 Chapter Overview
RPL (IPv6 Routing Protocol for Low-Power and Lossy Networks) is the IETF standard routing protocol designed specifically for IPv6-based IoT networks with resource-constrained devices, lossy wireless links, and convergent traffic patterns.
This comprehensive guide to RPL is organized into four focused chapters:
34.2 Chapter Series
34.2.1 1. RPL Introduction and Core Concepts
Estimated time: 15-20 minutes
Learn the fundamentals of RPL and why it’s essential for IoT:
- Why traditional routing protocols (OSPF, RIP) don’t work for IoT
- Introduction to Low-Power and Lossy Networks (LLNs)
- DODAG (Destination Oriented Directed Acyclic Graph) topology
- RANK mechanism for loop prevention
- Distance-vector routing principles in RPL
Putting Numbers to It
Consider an RPL network with MRHOF (Minimum Rank with Hysteresis Objective Function) using ETX (Expected Transmission Count) as the routing metric. If Node A has RANK 256 with an ETX of 1.5 to Node B, what is Node B’s RANK?
\[ \text{RANK}_B = \text{RANK}_A + (\text{ETX}_{A \to B} \times \text{MinHopRankIncrease}) \]
With standard MinHopRankIncrease = 256:
\[ \text{RANK}_B = 256 + (1.5 \times 256) = 256 + 384 = 640 \]
For a 4-hop path with average ETX = 1.3 per hop:
\[ \text{Total Path ETX} = \sum_{i=1}^{4} \text{ETX}_i = 4 \times 1.3 = 5.2 \text{ transmissions} \]
\[ \text{RANK}_{\text{leaf}} = 0 + (5.2 \times 256) = 1{,}331 \]
The ETX-based RANK allows RPL to select paths with better link quality even if they have more hops. A 3-hop path with ETX = 2.0 per hop (RANK = 1,536) is worse than a 4-hop path with ETX = 1.3 per hop (RANK = 1,331). This quantifies RPL’s intelligence: lower RANK always means better path quality, combining both distance and link reliability into a single metric.
34.2.2 2. RPL DODAG Construction and Routing Modes
Estimated time: 20-25 minutes
Understand how RPL builds and maintains network topology:
- Step-by-step DODAG construction process
- RPL control messages (DIO, DIS, DAO, DAO-ACK)
- Storing mode: distributed routing tables
- Non-Storing mode: centralized routing at root
- Memory and performance trade-offs between modes
- Mode selection decision framework
34.2.3 3. RPL Traffic Patterns and Network Design
Estimated time: 25-30 minutes
Apply RPL concepts to real-world network design:
- Many-to-one (upward) routing patterns
- One-to-many (downward) routing patterns
- Point-to-point routing strategies
- Hands-on lab: Designing RPL network for smart building
- Memory requirements calculation
- Traffic pattern analysis and optimization
34.2.4 4. RPL Production Framework and Summary
Estimated time: 15-20 minutes
Production deployment considerations and comprehensive review:
- Production RPL framework architecture
- Large-scale deployment analysis (800+ nodes)
- Key concepts summary
- Visual reference gallery
- Comprehensive review quiz
- RFC standards references (6550, 6552, 6719)
34.3 Prerequisites
Before starting this series, you should be familiar with:
- Routing Fundamentals: Basic routing concepts and distance-vector protocols
- 6LoWPAN Fundamentals: IPv6 header compression for constrained devices
- Wireless Sensor Networks: WSN energy constraints and multi-hop patterns
34.4 Quick Reference
| Concept | Description |
|---|---|
| RPL | IPv6 Routing Protocol for Low-Power and Lossy Networks |
| DODAG | Destination Oriented Directed Acyclic Graph (tree topology) |
| RANK | Hierarchical position preventing routing loops |
| DIO | DODAG Information Object (advertises DODAG) |
| DIS | DODAG Information Solicitation (requests DODAG info) |
| DAO | Destination Advertisement Object (builds downward routes) |
| Storing Mode | Distributed routing tables at each node |
| Non-Storing Mode | Centralized routing at root with source routing |
| Trickle Timer | Adaptive control message frequency algorithm |
| Objective Function | Algorithm for parent selection (OF0, MRHOF) |
34.5 Standards
- RFC 6550: RPL Specification (IETF, March 2012)
- RFC 6552: Objective Function Zero (OF0)
- RFC 6719: Minimum Rank with Hysteresis Objective Function (MRHOF)
- RFC 6206: Trickle Timer Algorithm
34.7 Interactive: RANK Calculator
Calculate how RANK propagates through a multi-hop RPL network under different objective functions.
34.8 Knowledge Check
Worked Example: RPL RANK Calculation for Multi-Path Scenario
Scenario: Node C is joining an existing RPL DODAG. It receives DIO messages from three potential parents during DODAG discovery. The network uses MRHOF with ETX metric.
Given DIO Information:
| Parent Candidate | RANK | ETX to Node C | RSSI | Hop Count to Root |
|---|---|---|---|---|
| Node A | 768 | 1.25 (20% loss) | -72 dBm | 3 hops |
| Node B | 1024 | 1.11 (10% loss) | -68 dBm | 4 hops |
| Node D | 512 | 1.67 (40% loss) | -78 dBm | 2 hops |
RPL Configuration:
- MinHopRankIncrease = 256 (standard value)
- MRHOF uses ETX as primary metric
- Hysteresis threshold = 10% (new parent must be 10% better)
Question 1: Calculate Node C’s RANK for each parent option
Solution: RANK = Parent_RANK + (ETX × MinHopRankIncrease)
Option A (via Node A):
- RANK_C = 768 + (1.25 × 256) = 768 + 320 = 1,088
Option B (via Node B):
- RANK_C = 1,024 + (1.11 × 256) = 1,024 + 284 = 1,308
Option D (via Node D):
- RANK_C = 512 + (1.67 × 256) = 512 + 428 = 940
Question 2: Which parent should Node C select initially?
Answer: Node D provides the lowest RANK (940), making it the preferred parent initially.
Question 3: Two weeks later, Node D’s link degrades (ETX increases to 2.0). Should Node C switch?
New Calculation for Node D:
- RANK_C = 512 + (2.0 × 256) = 512 + 512 = 1,024
Comparison:
- Node D (current parent): RANK 1,024
- Node A (alternative): RANK 1,088
- Node B (alternative): RANK 1,308
Apply Hysteresis: Node A must be 10% better than current: - Required improvement: 1,024 × 0.90 = 922 - Node A provides RANK 1,088 (worse than current, not better) - Decision: Stay with Node D despite degradation
Question 4: What if Node D’s ETX reaches 2.5 (60% packet loss)?
New Calculation for Node D:
- RANK_C = 512 + (2.5 × 256) = 512 + 640 = 1,152
Comparison with Node A:
- Node A: RANK 1,088
- Node D: RANK 1,152
- Improvement: (1,152 - 1,088) / 1,152 = 5.6% better
Node A is only 5.6% better, below the 10% hysteresis threshold. Decision: Still stay with Node D
Question 5: At what ETX does Node D trigger a switch to Node A?
Solution: Set Node D’s RANK equal to Node A’s required threshold: - Node A provides RANK 1,088 - For switch, current parent must be 10% worse: 1,088 / 0.90 = 1,209 - 512 + (ETX × 256) = 1,209 - ETX × 256 = 697 - ETX = 2.72 (73% packet loss)
Only when Node D’s link degrades beyond 73% packet loss will Node C switch to Node A.
Key Insights:
- RANK encodes path quality: Lower RANK = better cumulative path to root
- ETX directly impacts RANK: Poor links add significant RANK increase
- Hysteresis prevents flapping: 10% threshold means Node C tolerates significant link degradation before switching
- Hop count vs link quality: Node D has fewer hops (2) but its moderate ETX (1.67) makes it competitive with Node A’s 3 hops and better ETX (1.25)
- Gradual degradation tolerance: Hysteresis means networks adapt slowly to changing conditions, prioritizing stability over optimal routing
Common Pitfalls
1. Starting RPL Study With Production Configuration
RPL production configuration involves many tunable parameters. Without foundational understanding of DODAG construction, RANK calculation, and message flow, production configuration choices are arbitrary. Complete foundational chapters before production topics.
2. Not Reading the RFC Alongside Course Materials
RPL course materials simplify RFC 6550 for learning. But RFC 6550 contains normative behaviors (RANK feasibility condition, DAO loop detection) that simplified materials may omit. Cross-reference with the RFC for any behavior you plan to implement.
34.9 What’s Next
| If you want to… | Read this |
|---|---|
| Start with RPL fundamentals introduction | RPL Introduction |
| Learn DODAG construction step by step | RPL DODAG Construction |
| Study routing modes in detail | RPL Routing Modes |
| Apply RPL in production context | RPL Production |