40 RPL Lab: Network Design
40.1 Learning Objectives
By the end of this chapter, you will be able to:
- Design DODAG Topologies: Construct RPL network structures with appropriate node placement and parent relationships
- Calculate RANK Values: Derive RANK assignments for nodes based on hop count and objective functions
- Evaluate Operating Modes: Justify Storing vs Non-Storing mode selection for different building and deployment scenarios
- Classify Routing Nodes: Differentiate which devices should serve as RPL routers versus leaf nodes
- Optimize for Power: Architect RPL networks that balance routing overhead with battery life requirements
40.2 Prerequisites
Required Chapters:
- RPL Fundamentals - Core RPL concepts and DODAG construction
- RPL Operation - Protocol mechanics and message types
- Routing Fundamentals - General routing background
Technical Background:
- IPv6 addressing basics
- Tree-based routing concepts
- Directed Acyclic Graphs (DAGs)
Lab Requirements:
- Contiki-NG or RIOT OS environment
- 6LoWPAN capable hardware (or simulator like Cooja)
- Wireshark with RPL dissector for packet analysis
Estimated Time: 45 minutes
For Beginners: How to Use This Lab
What is this lab? A practical design exercise for RPL (Routing Protocol for Low-Power and Lossy Networks) network planning.
When to use:
- After studying RPL fundamentals and DODAG construction
- When you want hands-on routing design experience
- Before implementing RPL in real networks
Key Concepts to Practice:
| Concept | Exercise Focus |
|---|---|
| DODAG Formation | Build routing trees |
| Rank Calculation | Understand path costs |
| Mode Selection | Storing vs Non-Storing |
| Memory Planning | Resource requirements |
Sensor Squad: Design Your Own Network!
“This lab lets you be the network architect,” said Max the Microcontroller. “You will design a DODAG for a real smart building – placing the root, assigning RANK values, and deciding which mode to use.”
“Start by figuring out where to put the border router,” suggested Sammy the Sensor. “The root should be in a central location where most devices can reach it within a few hops. Putting it in a corner means some devices need many more hops than others.”
“Then calculate RANK values for each node,” added Lila the LED. “Remember, RANK depends on the objective function. With hop count, a two-hop device has RANK 512 if MinHopRankIncrease is 256. With ETX, the same device might have RANK 640 if the link requires 1.5 transmissions on average.”
“Do not forget to compare Storing and Non-Storing modes for your design,” emphasized Bella the Battery. “Calculate how much memory each node would need in Storing mode. If it exceeds your device’s RAM, Non-Storing mode is your only option!”
40.3 Hands-On Lab: RPL Network Design
Decision Framework: Selecting RPL Routing Mode for Your Deployment
Use this framework to systematically choose between Storing and Non-Storing mode based on quantifiable network characteristics.
| Decision Factor | Choose Storing Mode | Choose Non-Storing Mode |
|---|---|---|
| Node RAM | Routers have > 64 KB RAM | Routers have < 32 KB RAM |
| Traffic Pattern | P2P traffic > 20% | P2P traffic < 5% |
| Network Size | < 100 nodes (routing tables fit) | > 200 nodes (centralized more scalable) |
| Border Router Capacity | Constrained (shared gateway) | Dedicated (powerful border router) |
| Latency Requirement | < 100ms P2P (avoid root relay) | > 500ms acceptable |
| Network Topology | Flat (2-4 hops, direct P2P) | Deep (5-10 hops, rare P2P) |
| Control Overhead | Can tolerate DAO propagation | Minimize DAO floods |
Quantitative Decision Model:
Step 1: Calculate Memory Requirements
Storing Mode Total Memory:
M_storing = (Avg_children_per_router × 18 bytes) × Num_routers
Non-Storing Mode Total Memory:
M_non_storing = ((Total_nodes - 1) × 18 bytes) + (Non_root_nodes × 2 bytes)
Step 2: Calculate P2P Routing Penalty
Non-Storing P2P penalty = 2 × (Avg_hops_to_root)
Example: Sensor A (4 hops) to Sensor B (4 hops)
Non-Storing: A → Root (4) → B (4) = 8 hops
Storing: A → Common ancestor (2 hops) → B (2 hops) = 4 hops
Step 3: Apply Decision Rule
IF (M_storing < Node_RAM × 0.3) AND (P2P_traffic > 15%):
→ Choose Storing Mode
ELSE IF (M_non_storing < Border_router_RAM × 0.5) AND (P2P_traffic < 10%):
→ Choose Non-Storing Mode
ELSE:
→ Run 7-day field trial with both modes, compare battery life and PDR
Example Decision - Smart Building Deployment:
Given:
- 120 sensors (90 battery, 30 mains-powered routers)
- Average 3 children per router
- Traffic: 85% upward (sensor data), 10% downward (commands), 5% P2P (motion → light)
- Node RAM: 256 KB (nRF52840)
- Border router RAM: 512 MB (Raspberry Pi 4)
Calculate Storing Mode Memory:
M_storing = 30 routers × 3 children × 18 bytes = 1,620 bytes
Per-router: 1,620 / 30 = 54 bytes (0.02% of 256 KB RAM) ✓ Fits easily
Calculate Non-Storing Mode Memory:
M_non_storing = (120 nodes × 18 bytes) + (119 non-root × 2 bytes) = 2,160 + 238 = 2,398 bytes
At border router: 2,398 bytes (0.0005% of 512 MB RAM) ✓ Trivial
Calculate P2P Penalty:
Non-Storing: Motion sensor (4 hops) → Root → Light (3 hops) = 7 hops
Storing: Motion sensor → Common ancestor (2 hops) → Light = 4 hops
P2P traffic: 5% × 120 sensors × 10 msgs/day = 60 P2P msgs/day
Extra hops = 60 × (7-4) = 180 extra hops/day (negligible)
Decision: Storing Mode - Reason: Memory is not constrained, P2P penalty is small but P2P latency requirement is < 200ms (motion → light must be instant) - Trade-off: Slightly higher DAO overhead (acceptable)
Alternative Decision - Parking Sensor Network:
Given:
- 500 sensors (all battery, 1 mains-powered gateway)
- Average 1 child per gateway (star topology)
- Traffic: 99% upward (occupancy status), 1% downward (config)
- Node RAM: 16 KB (ultra-low-cost MCU)
Decision: Non-Storing Mode - Reason: Nodes lack RAM for routing tables, zero P2P traffic, gateway has abundant resources - Trade-off: P2P not possible (not needed for this application)
Validation Checklist:
After choosing mode, validate decision during pilot deployment:
✓ Routing table memory < 30% node RAM (Storing) or < 50% border router RAM (Non-Storing) ✓ P2P latency meets SLA (if applicable) ✓ DAO message rate < 10 per hour per node (Storing) ✓ Packet delivery rate > 95% for all traffic types ✓ Battery lifetime meets target (measure for 7 days, extrapolate)
If any check fails, reconsider mode choice or adjust network topology.
40.4 Interactive: Memory Trade-off Calculator
Use this calculator to explore how network size and topology affect Storing vs Non-Storing mode memory requirements.
Common Pitfalls
1. Designing Without Considering Physical Constraints
Network design labs that ignore wall attenuation, device placement, and radio interference produce designs that fail in physical deployments. Always apply link budget calculations and path loss models to validate lab-designed topologies.
2. Not Documenting Design Rationale
Lab network designs that meet requirements without explanation of why specific choices were made don’t build transferable skills. Document the reasoning behind RANK configuration, mode selection, and topology decisions.
3. Over-Engineering for Lab Scenarios
Lab exercises often use simplified networks where complex features (multiple instances, floating DODAG) aren’t needed but are included to demonstrate completeness. Focus on what the lab scenario actually requires.
40.5 Summary
This hands-on lab demonstrated practical RPL network design skills:
- DODAG Topology Design: Strategic placement of border router and routing nodes based on network hierarchy and power availability is crucial for efficient RPL networks
- Memory Trade-offs: Storing mode distributes routing tables (~54 bytes per router) while Non-Storing mode centralizes at root (~990 bytes for 56-node network), impacting scalability differently
- Traffic Pattern Analysis: Many-to-one traffic shows identical performance in both modes, while point-to-point routing may benefit from Storing mode’s distributed tables
40.5.1 Key Design Principles
- Use mains-powered devices as routers - They have sufficient RAM and continuous power
- Configure battery sensors as leaf nodes - Minimize routing overhead
- Choose Non-Storing for sensor-heavy networks - Lower memory requirements
- Consider Storing for P2P-heavy networks - Better routing efficiency
40.6 Concept Relationships
Understanding RPL network design connects to these related concepts:
- RPL Fundamentals provides the theoretical foundation for DODAG construction and RANK calculation that this lab applies
- RPL Operation explains the control message flows (DIO, DAO) that enable the parent selection and route building demonstrated here
- Network Topologies shows how RPL’s tree-based DODAG relates to mesh, star, and other IoT network patterns
- 6LoWPAN works with RPL to compress IPv6 headers, affecting the packet overhead calculations in Task 3
- Thread Operation implements RPL as its routing protocol, demonstrating production deployment of these design principles
40.7 See Also
Related Labs and Exercises:
- RPL Knowledge Check - Scenario-based quizzes applying these design concepts
- RPL Production Framework - Production-ready implementation patterns
- Simulations Hub - Interactive DODAG formation visualizers
Reference Material:
- RFC 6550 (RPL Specification) - Section 8 on Mode of Operation
- RFC 6552 (OF0) - Hop count objective function used in Task 1
- RFC 6719 (MRHOF) - ETX-based objective function for lossy links
40.8 What’s Next
Continue to RPL Knowledge Check to test your understanding with scenario-based quizzes, or explore RPL Quiz Questions for detailed concept review with explanations.
| Previous: RPL Labs and Quiz | Next: RPL Quiz Questions |