39 RPL Labs and Quiz
39.1 Learning Objectives
By the end of this series, you will be able to:
- Construct DODAG topologies for specific building layouts and justify Storing vs Non-Storing mode trade-offs
- Derive memory requirements for RPL routing tables at different network scales
- Apply RPL concepts to real-world scenarios through hands-on quizzes covering traffic patterns and mode selection
- Critique RPL production deployment decisions including Trickle timer configuration and root redundancy
Sensor Squad: Time to Practice!
“Theory is important, but nothing beats hands-on practice,” said Max the Microcontroller. “These labs let you design real DODAG topologies, calculate RANK values, and choose between Storing and Non-Storing modes for actual building layouts.”
“The quiz sections test your understanding with real-world scenarios,” added Sammy the Sensor. “Like: a factory has 200 sensors on three floors – which RPL mode should you use? What Trickle timer settings make sense? These are the questions you will face in real deployments.”
“I recommend doing the lab first, then the knowledge check, then the quiz questions,” said Lila the LED. “Each one builds on the previous. The lab gives you hands-on experience, the knowledge check tests your intuition, and the quiz questions go deep into the theory.”
“Set aside about two hours total,” advised Bella the Battery. “Take your time, try to answer each question before checking the solution, and study the explanations even for questions you get right. There are often extra insights in the answers!”
39.2 Overview
This hub provides hands-on labs and comprehensive quizzes for mastering RPL (Routing Protocol for Low-Power and Lossy Networks). The content has been organized into focused chapters for effective learning.
39.3 Learning Path
Complete these chapters in order for the best learning experience:
| Chapter | Focus | Time |
|---|---|---|
| RPL Lab: Network Design | Hands-on DODAG topology design and mode comparison | 45 min |
| RPL Knowledge Check | Scenario-based quizzes for real-world application | 30 min |
| RPL Quiz Questions | Detailed concept review with comprehensive explanations | 45 min |
Total Time: ~2 hours
39.4 Prerequisites
Required Chapters:
- RPL Fundamentals - Core RPL concepts and DODAG construction
- RPL Operation - Protocol mechanics and message types
- Routing Fundamentals - General routing background
Key RPL Concepts to Know:
| Concept | Definition |
|---|---|
| DODAG | Destination-Oriented Directed Acyclic Graph |
| Rank | Distance metric from root node |
| DIO | DODAG Information Object |
| DAO | Destination Advertisement Object |
| Trickle | Timer algorithm for adaptive DIO transmission |
Lab Requirements:
- Contiki-NG or RIOT OS environment
- 6LoWPAN capable hardware (or simulator like Cooja)
- Wireshark with RPL dissector for packet analysis
Key Concepts
- Cooja RPL Simulation: A Contiki network simulator configuration demonstrating RPL DODAG construction, parent selection, and traffic routing in a simulated LLN.
- RPL Observability: Tools for monitoring RPL network state:
rpl-dag-root,rpl-print-dagin Contiki, and Wireshark RPL dissector for packet analysis. - Route Table Inspection: Examining RPL routing tables at each node to verify DODAG construction correctness and identify routing anomalies.
- DIO/DAO Capture Analysis: Using a packet sniffer to capture and analyze RPL control message exchange, verifying DODAG construction timing and DAO propagation.
39.5 For Beginners: How to Use These Labs
What will you learn? Practical skills for designing, deploying, and troubleshooting RPL networks through hands-on exercises.
Recommended approach:
- Start with RPL Lab: Network Design for practical topology planning
- Test understanding with RPL Knowledge Check scenarios
- Deep dive into concepts with RPL Quiz Questions
Key skills you’ll develop:
| Skill | Lab Coverage |
|---|---|
| DODAG Design | Network Design Lab |
| Mode Selection | Knowledge Check |
| Control Messages | Quiz Questions |
| Troubleshooting | All chapters |
Related Chapters
Deep Dives:
- RPL Fundamentals - DODAG construction and RANK calculation
- RPL Operation - Control messages and Trickle timer
- RPL Routing - Routing modes and path selection algorithms
Comparisons:
- Routing Fundamentals - Traditional routing vs RPL distance-vector approach
- 6LoWPAN Hands-On - How RPL integrates with 6LoWPAN stack
- Cellular IoT Comprehensive Review - Alternative routing approaches in cellular networks
Hands-On:
- RPL Production and Review - Deployment patterns and real-world optimizations
- Simulations Hub - Network simulation tools for RPL testing
Learning:
39.6 Chapter Summaries
39.6.1 RPL Lab: Network Design
Design a complete RPL network for a smart building scenario:
- Task 1: DODAG topology design with 56 devices across 3 floors
- Task 2: Memory requirements comparison (Storing vs Non-Storing)
- Task 3: Traffic pattern analysis (many-to-one, one-to-many, point-to-point)
Key takeaway: Mains-powered devices should serve as routers; battery sensors as leaf nodes.
39.6.2 RPL Knowledge Check
Scenario-based quizzes testing real-world application:
- Hospital IoT deployment (1,200 sensors, nurse call latency requirements)
- Smart building mode selection (100 sensors, configuration updates)
- Trickle timer behavior (node joining, network stability)
Key takeaway: Traffic pattern analysis drives mode selection, not just memory constraints.
39.6.3 RPL Quiz Questions
Detailed concept review with comprehensive explanations:
- RANK purpose: Loop prevention through hierarchy enforcement
- Mode comparison: Identical many-to-one performance, differences in P2P
- Control messages: DIS/DIO/DAO/DAO-ACK message flows
- OSPF comparison: Why link-state routing fails for IoT
Key takeaway: RPL is specifically designed for IoT constraints that make traditional routing protocols unsuitable.
Worked Example: Calculating Trickle Timer Impact on Convergence
Scenario: You’re comparing two RPL configurations for a 100-node factory sensor network. You need to understand how Trickle timer settings affect initial convergence time versus long-term energy consumption.
Configuration A (Aggressive):
- Imin = 100 ms (minimum interval)
- Imax = 10 doublings (max interval = 100ms × 2^10 = 102,400 ms ≈ 102 seconds)
Configuration B (Conservative):
- Imin = 1 second (minimum interval)
- Imax = 16 doublings (max interval = 1s × 2^16 = 65,536 seconds ≈ 18 hours)
Step 1: Calculate Initial Convergence Time
DIO messages propagate hop-by-hop. For a 5-hop network depth:
Configuration A:
Each hop takes Imin for DIO propagation = 100ms
5 hops × 100ms = 500ms base propagation time
With 100 nodes generating DIOs in first few intervals:
- Collisions and retries add ~30% overhead
- Convergence time ≈ 500ms × 1.3 = 650ms
Configuration B:
Each hop takes Imin = 1 second
5 hops × 1s = 5 seconds base propagation time
Collisions and retries: ~30% overhead
Convergence time ≈ 5s × 1.3 = 6.5 seconds
Result: Config A converges 10× faster than Config B (650ms vs 6.5s)
Step 2: Calculate Long-Term Steady-State Overhead
After the network stabilizes (30+ days of operation):
Configuration A:
Trickle backs off to Imax ≈ 102 seconds
DIOs per node per day = 86,400s / 102s ≈ 847 DIOs/day
DIO TX energy per node per day:
TX time per DIO: 15ms at 20mA
Energy = 847 × 20mA × (15ms / 3,600,000 ms/h) = 847 × 0.0833 µAh ≈ 0.0705 mAh/day
Configuration B:
Trickle backs off to Imax = 65,536s ≈ 18 hours
DIOs per node per day = 86,400s / 65,536s ≈ 1.32 DIOs/day
Energy = 1.32 × 20mA × (15ms / 3,600,000 ms/h) ≈ 0.00011 mAh/day
Result: Config B uses approximately 640× less energy for DIOs in steady state.
Step 3: Battery Lifetime Impact
Assume a 2,000 mAh battery. Sensor transmits a 100-byte data packet every 10 minutes (144 transmissions/day). Sleep current is 5 µA.
Daily energy breakdown:
Data TX (both configs):
144 transmissions × 20mA × (30ms × 1.3 ETX) / 3,600,000 ms/h
= 144 × 0.000217 mAh = 0.031 mAh/day
DIO overhead:
Config A: 0.0705 mAh/day
Config B: 0.00011 mAh/day
Sleep (99.9% duty cycle, 5 µA):
0.005mA × 24h = 0.120 mAh/day
RX listening (brief wakeups):
≈ 0.020 mAh/day
Total daily energy:
Config A: 0.031 + 0.071 + 0.120 + 0.020 = 0.242 mAh/day
Config B: 0.031 + 0.000 + 0.120 + 0.020 = 0.171 mAh/day
Battery lifetime:
Config A: 2,000 mAh / 0.242 mAh/day ≈ 8,264 days ≈ 22.6 years
Config B: 2,000 mAh / 0.171 mAh/day ≈ 11,696 days ≈ 32.0 years
Difference: ~9.4 years extra battery life with Config B. In practice, other factors (self-discharge, electrode degradation) cap real-world lifetime to 5-10 years, but the relative advantage of Config B holds.
Decision Matrix:
| Requirement | Recommended Config |
|---|---|
| Fast deployment (converge < 1s) | Config A (aggressive) |
| Battery-critical (> 10 year lifetime) | Config B (conservative) |
| Frequent topology changes | Config A (adapts faster) |
| Stable network | Config B (minimal overhead) |
| Mobile nodes | Config A (quick re-join) |
| Static infrastructure | Config B (energy efficient) |
Best Practice: Start with Config A during commissioning (first 7 days) to ensure fast network formation and catch any topology issues. Then switch to Config B via remote configuration update for long-term operation. This gives you fast deployment without sacrificing battery life.
39.7 Interactive: Trickle Timer Energy Calculator
Explore how Trickle timer settings affect DIO overhead and battery lifetime.
39.8 Concept Relationships
This hub page connects three complementary learning resources:
- RPL Fundamentals provides the theoretical foundation (DODAG, RANK, control messages) that these labs and quizzes apply
- RPL Operation details the protocol mechanics (Trickle timer, parent selection) tested in the knowledge checks
- RPL Production and Review shows how the design decisions practiced here scale to real-world deployments
- Network Topologies explains how RPL’s tree-based DODAG relates to other IoT network patterns
- 6LoWPAN works with RPL to compress headers, affecting the overhead calculations in these exercises
39.9 See Also
Interactive Learning:
- Simulations Hub - Visualize DODAG formation and parent selection
- Tool Discovery - Interactive routing protocol comparisons
- Knowledge Map - See how RPL connects to IPv6, 6LoWPAN, and Thread
Assessment Resources:
- Quizzes Hub - Additional RPL questions across all difficulty levels
- Knowledge Gaps Hub - Common misconceptions about RANK and mode selection
Reference Material:
- RFC 6550 (RPL Specification) - Complete protocol definition
- RFC 6552 (OF0) and RFC 6719 (MRHOF) - Objective function implementations
- Thread Specification - Real-world RPL deployment example
Common Pitfalls
1. Not Capturing RPL Control Traffic During Labs
Running RPL labs without capturing DIO/DAO traffic misses the most important diagnostic information. Configure a sniffer or enable RPL debug logging before starting lab exercises.
2. Comparing Lab Results to Theoretical Expectations Without Accounting for Simulator Differences
Cooja’s radio model differs from real hardware behavior. Expected convergence times and RANK values may differ slightly from theoretical calculations due to simulator implementation details.
3. Not Testing with Multiple Objective Functions
Running labs with only the default OF0 misses the important differences between hop-count-based and ETX-based parent selection. Run labs with both OF0 and MRHOF to observe the difference in path selection.
39.10 What’s Next
Start with RPL Lab: Network Design for hands-on topology planning, or continue to RPL Production and Review for deployment patterns and real-world optimizations.
| Previous: RPL Fundamentals | Next: RPL Lab Network Design |