RPL supports three traffic patterns: Many-to-One (sensors to root, always efficient), One-to-Many (root to actuators, requires downward routes), and Point-to-Point (sensor to actuator, mode-dependent). This chapter calculates memory requirements for each routing mode and applies RPL design to real-world smart building scenarios.
Learning Objectives
By the end of this section, you will be able to:
Differentiate upward, downward, and point-to-point routing paths in RPL DODAGs
Design RPL network topologies for specific IoT deployment scenarios
Calculate memory requirements for Storing vs Non-Storing modes using routing entry sizes
Evaluate traffic patterns to select appropriate RPL configurations and mode trade-offs
Apply RPL design principles to real-world smart building network architectures
For Beginners: RPL Traffic and Network Design
This chapter explores how different traffic patterns (sensor data flowing up, commands flowing down, device-to-device messages) affect RPL network design. Think of it like designing a road system – rush hour traffic heading downtown requires different planning than weekend traffic heading to the suburbs.
Sensor Squad: Three Ways to Talk!
“RPL handles three different traffic patterns,” said Sammy the Sensor. “The first one is Many-to-One – that is us sensors sending data upward to the root. It is the easiest because the DODAG tree is designed for exactly this direction!”
“The second is One-to-Many,” explained Max the Microcontroller. “That is when the root needs to send commands DOWN to specific devices – like telling a smart light to dim to 50 percent. This requires downward routes, which means DAO messages need to have registered reachability first.”
“The trickiest is Point-to-Point,” added Lila the LED. “If a motion sensor wants to talk directly to a light switch, the message has to go UP the tree to their common ancestor and then back DOWN. In Non-Storing mode, it goes all the way up to the root first!”
“When designing a network, you need to think about which pattern dominates,” said Bella the Battery. “A sensor-only network is mostly Many-to-One, so Non-Storing mode works great. But a smart home with sensors AND actuators needs lots of downward traffic, so Storing mode might be better despite using more memory.”
38.1 Prerequisites
Before diving into this chapter, you should be familiar with:
MP2P (Multipoint-to-Point): RPL’s dominant traffic pattern: many sensors sending data toward the DODAG root (border router); optimized by the default DODAG upward routing structure.
P2MP (Point-to-Multipoint): Traffic pattern from the root to many leaf nodes; requires Storing Mode downward routing or source routing in Non-Storing Mode.
P2P (Point-to-Point): Device-to-device traffic within the DODAG; in Non-Storing Mode, all P2P traffic routes through the root; Storing Mode allows more direct paths.
Traffic Engineering: The process of planning and configuring RPL routing to efficiently handle expected traffic patterns while meeting latency, bandwidth, and energy requirements.
RPL Memory Budget: Calculation of RAM required for RPL operation: routing table entries × bytes per entry + neighbor table + control message buffers; critical for constrained device deployment.
Channel Utilization: The fraction of 802.15.4 channel bandwidth consumed by application plus RPL control traffic; must stay below ~30% to avoid excessive collisions.
Non-Storing mode saves 738 bytes (26% reduction) but adds source routing headers (average 8 bytes per hop × 3 hops = 24 bytes per P2P packet). For infrequent P2P traffic, Non-Storing mode wins on total system efficiency. For frequent P2P (>100 packets/hour), the header overhead exceeds memory savings.
Quick Check: Traffic Pattern Recognition
38.4 Interactive: RPL Memory Budget Calculator
Use this calculator to estimate routing memory for your network before choosing a mode.
Smart building DODAG topology with three floors showing BR root node (Navy), mains-powered sensors (Teal), battery-powered sensors (Orange), and actuators (Gray). RANK values increase from 0 at root to 500 at leaf nodes, with a long-range link connecting Floor 3 BR to Floor 2 Sensor 2-1.
Figure 38.2: Smart building DODAG topology with three floors showing BR root node (Navy), mains-powered sensors (Teal), battery-powered sensors (Orange), and actuators (Gray). RANK values increase from 0 at root to 500 at leaf nodes.
RANK Distribution:
BR: RANK 0
Floor 3 mains sensors: RANK 100-200
Floor 2 mains sensors: RANK 200-400
Floor 1 mains sensors: RANK 300-500
Battery/actuators: RANK based on parent + 100
Routing Nodes: 15 mains-powered sensors (can route for battery devices)
Conclusion: For this topology, same hop count, but: - Storing: Distributed routing decisions (higher memory) - Non-Storing: Centralized at root (source routing overhead)
Summary:
Traffic Pattern
Storing Advantage
Non-Storing Advantage
Many-to-One
None (equal)
None (equal)
One-to-Many
None (equal)
Lower node memory
Point-to-Point
Can optimize locally
Simpler nodes
Recommendation: Non-Storing for this scenario - Battery-powered sensors dominate (low memory) - Many-to-one traffic primary (sensors reporting) - Point-to-point rare (motion to light scenarios uncommon)
Quiz 6: Lab Activity: Designing RPL Network for Smart Building
38.6 Quiz: RPL Routing Protocol
Question 1: RANK Purpose
What is the primary purpose of RANK in RPL?
To measure the distance in meters from the root
To prevent routing loops by defining hierarchical position
To prioritize packets based on importance
To encrypt routing information
Click to see answer
Answer: B) To prevent routing loops by defining hierarchical position
Explanation:
RANK Definition: RANK is a scalar value representing a node’s position in the DODAG hierarchy relative to the root.
Primary Purpose: Loop Prevention
How RANK Prevents Loops:
Root has minimum RANK (typically 0)
RANK increases as you move away from root
Upward routing rule: Packets forwarded to nodes with lower RANK
Parent selection rule: Node cannot choose parent with higher RANK
Loop Prevention Example:
RANK-based loop prevention mechanism showing valid parent selection (Node C can choose Node A, RANK 100 < 400) versus forbidden loop creation (Node A cannot choose Node C, RANK 400 > 100)
Figure 38.3: RANK-based loop prevention mechanism showing valid parent selection (Node C can choose Node A, RANK 100 < 400) versus forbidden loop creation (Node A cannot choose Node C, RANK 400 > 100).
Attempt to create loop:
Node C (RANK 400) wants to choose Node A (RANK 100) as parent:
Node A RANK (100) < Node C RANK (400) – moving toward root
ALLOWED (valid upward direction)
Node A (RANK 100) wants to choose Node C (RANK 400) as parent:
Node C RANK (400) > Node A RANK (100) – would move away from root
FORBIDDEN (would create routing loop)
RANK Calculation Factors:
RANK is calculated by objective function, which may consider: - Hop count: Each hop adds fixed amount - ETX: Expected Transmission Count (link quality) - Latency: Time to reach root - Energy: Remaining battery, power consumption - Throughput: Link bandwidth
RANK = Parent_RANK + (ETX x MULTIPLIER)
Good link (ETX = 1.2): RANK increase = 1.2 x 100 = 120
Poor link (ETX = 3.5): RANK increase = 3.5 x 100 = 350
Node might prefer 2 good hops (RANK increase: 240)
over 1 poor hop (RANK increase: 350)
Conclusion: RANK’s primary purpose is loop prevention by establishing a strict hierarchy where packets can only flow “upward” (toward lower RANK), preventing cycles in the DODAG.
Question 2: Storing vs Non-Storing Mode
In a network of 100 battery-powered sensors sending data to a single gateway (many-to-one traffic), which RPL mode is more appropriate?
Storing mode (better routing efficiency)
Non-Storing mode (lower memory requirements)
Both modes have identical performance for this scenario
RPL doesn’t support many-to-one traffic well
Click to see answer
Answer: C) Both modes have identical performance for this scenario
Explanation:
Many-to-One Traffic is RPL’s primary use case and is handled identically in both modes.
How Many-to-One Works in RPL:
Upward Routing (toward root): - Every node knows its parent (from DODAG construction) - Default route: Send to parent - No routing table needed for upward routes
Both Modes:
Sensor 50 (RANK 500)
-> Parent Node 20 (RANK 300)
-> Parent Node 10 (RANK 150)
-> ROOT (RANK 0)
Process:
1. Sensor 50 has data for gateway
2. Looks up default route: "Send to parent (Node 20)"
3. Node 20 receives, looks up default route: "Send to parent (Node 10)"
4. Node 10 receives, looks up default route: "Send to parent (ROOT)"
5. ROOT receives - destination reached!
Performance Comparison:
Aspect
Storing Mode
Non-Storing Mode
Hop Count
Same (upward to root)
Same (upward to root)
Latency
Same
Same
Forwarding Complexity
Same (parent lookup)
Same (parent lookup)
Memory Used
Parent pointer + routing table
Parent pointer only
Bandwidth
Same
Same
Key Insight: Routing tables are for downward/P2P routes!
For many-to-one traffic, both RPL modes have identical routing performance (same path, same hop count, same latency). The choice between modes should be based on memory constraints and other traffic patterns (downward, P2P), not many-to-one routing efficiency.
Question 3: RPL Control Messages
Which RPL control message is used by a node to request DODAG information from neighbors?
DIO (DODAG Information Object)
DIS (DODAG Information Solicitation)
DAO (Destination Advertisement Object)
DAO-ACK (DAO Acknowledgment)
Click to see answer
Answer: B) DIS (DODAG Information Solicitation)
Explanation:
RPL Control Messages (all ICMPv6):
Figure 38.4: RPL control message types: DIO for DODAG advertisement, DIS for solicitation, DAO for route building
DIS (DODAG Information Solicitation):
Purpose: Request DODAG information from neighbors
When Used:
New node joins network: Doesn’t know about any DODAG
Node loses DODAG info: Parent moved, connection lost
Proactive discovery: Node wants to find better DODAG
Message Flow:
New Node: "Is there a DODAG I can join?"
(sends DIS - multicast)
Neighbors: "Yes, here's my DODAG info"
(respond with DIO - unicast or multicast)
New Node: Receives DIO(s), chooses DODAG and parent
Conclusion: DIS (DODAG Information Solicitation) is the RPL control message used to request DODAG information from neighbors, enabling active network discovery and faster DODAG joining compared to waiting for periodic DIOs.
Question 4: Traditional vs RPL Routing
Why is OSPF (Open Shortest Path First) not suitable for IoT Low-Power and Lossy Networks?
OSPF doesn’t support IPv6
OSPF requires too much processing power and memory
OSPF can’t handle mesh topologies
OSPF is proprietary and requires licensing
Click to see answer
Answer: B) OSPF requires too much processing power and memory
Explanation:
OSPF is a link-state routing protocol designed for traditional IP networks (enterprise, ISP). It’s fundamentally incompatible with resource-constrained IoT devices.
Resource Requirements Comparison:
Resource
OSPF
RPL
CPU
GHz, multi-core
MHz, single-core
RAM
MB-GB
KB (10-128 KB)
Flash
MB-GB
KB (32-512 KB)
Power
Watts (mains)
Milliwatts (battery)
Algorithm
Dijkstra’s SPF
Distance-vector
Database
Link-state DB (entire network)
Parent pointer / routing table
Why OSPF Doesn’t Work for IoT:
1. Memory Requirements:
OSPF:
Link-State Database (LSDB): Stores topology of entire network
Every router knows everything: All links, all routers
Example: 100-node network
Average 3 links per node = 300 links
Link-state data: ~50 bytes per link
LSDB size: 300 x 50 = 15 KB (minimum, just topology)
Add routing table, neighbor table, etc.: 50-100 KB total
IoT Device (e.g., nRF52840): - Total RAM: 256 KB - OSPF would use: 50-100 KB (~40% of RAM!) - Application left with: 150 KB (including OS, app, buffers)
RPL:
Storing mode: Routing table for sub-DODAG only (KBs)
1. Receive DIO from parent
2. Update RANK = parent_RANK + increase
3. (Storing mode) Update routing table for children
4. Done
CPU Time: < 1 ms (simple calculation) vs 500 ms-2 s for OSPF on IoT hardware
3. Protocol Overhead:
OSPF:
Hello packets: Every 10 seconds (keep neighbors alive)
LSA flooding: Every topology change
LSA refresh: Every 30 minutes (even if no change)
Packets: Large (detailed link-state info)
RPL:
DIO: Trickle timer (adaptive, minutes when stable)
DAO: Only when topology changes
Packets: Smaller (compressed headers with 6LoWPAN)
Conclusion: OSPF is unsuitable for IoT LLNs primarily because its link-state database and SPF algorithm require far more memory and processing power than battery-powered IoT devices can afford, while RPL is specifically designed for these constraints.
38.7 Worked Example: RPL Memory Budget for a 3-Floor Smart Office
Scenario: A smart office occupies 3 floors with 120 Zigbee devices: 80 occupancy sensors (under-desk PIR, battery-powered), 20 smart lights (mains-powered), 10 HVAC zone controllers (mains-powered), and 10 meeting room displays (mains-powered). One border router per floor connects to the building management system. The network must support: occupancy data upward (every 30 seconds), lighting commands downward (on demand, ~50/hour building-wide), and occupancy-to-light point-to-point triggers (motion sensor directly dims nearby light within 200 ms).
Step 1: Map traffic patterns to RPL requirements
Traffic Pattern
Direction
Frequency
Latency Requirement
RPL Mode Implication
Occupancy data
Many-to-one (upward)
80 sensors x 2/min = 160 msg/min
Seconds OK
Both modes work
Lighting commands
One-to-many (downward)
~50/hour
<500 ms
Storing: direct path. Non-Storing: via root
Occupancy-to-light
Point-to-point
~200/hour (peak)
<200 ms
Storing: common ancestor. Non-Storing: via root
The 200 ms point-to-point requirement is critical. Let’s calculate latency for each mode.
Step 2: Calculate point-to-point latency
Network topology: 3 floors, average DODAG depth = 3 hops from sensor to root.
Storing mode (route through common ancestor):
A desk sensor and the nearest light are typically 1-2 hops apart with a common ancestor 1 hop up:
Hop
Direction
Latency (802.15.4 at 250 kbps)
Sensor to common ancestor
Up 1 hop
~8 ms (48-byte packet at 250 kbps + processing)
Common ancestor to light
Down 1 hop
~8 ms
Total
2 hops
~16 ms
Well within the 200 ms requirement.
Non-Storing mode (route through root/border router):
Hop
Direction
Latency
Sensor to root
Up 3 hops
~24 ms
Root source-route lookup
Processing
~2 ms
Root to light
Down 2 hops (source-routed)
~20 ms (16 ms + 4 ms source header processing)
Total
5 hops
~46 ms
Still within 200 ms, but 2.9x slower. More importantly, all P2P traffic now flows through the root, creating a bottleneck.
Step 3: Calculate root bottleneck in Non-Storing mode
In Non-Storing mode, the border router must process ALL downward and P2P traffic:
Traffic Type
Messages/min
Bytes/msg (incl. source routing header)
Root processing load
Lighting commands (downward)
0.83
48 + 56 (src-route, 3 hops) = 104 bytes
86 bytes/min
P2P occupancy-to-light
3.33 (peak)
48 + 72 (src-route, 4 hops) = 120 bytes
400 bytes/min
Upward sensor data (just forwarding)
53.3 (per-floor root)
48 bytes
2,560 bytes/min
Total root load
57.5 msg/min
3,046 bytes/min
This is manageable for a single root. But at peak occupancy (morning rush, 8:30-9:00 AM), P2P triggers spike:
Peak scenario
Messages/min at root
Processing time
60 people arriving in 30 min
120 occupancy-to-light triggers/min
120 x 2 ms = 240 ms/min
Plus normal upward traffic
53 sensor readings/min
53 x 1 ms = 53 ms/min
Total
173 msg/min
293 ms/min
The root can handle this (~0.5% CPU utilization). Non-Storing mode is feasible but adds unnecessary latency.
Step 4: Memory budget comparison
Storing mode:
Device Type
Count
Role
Routing Table Entries
RAM for Routing
Border routers
3
Root (all 40 devices on floor)
40 x 28 bytes = 1,120 bytes
1.1 KB
Smart lights
20
Router (~4 descendants each)
4 x 28 = 112 bytes
112 bytes
HVAC controllers
10
Router (~8 descendants each)
8 x 28 = 224 bytes
224 bytes
Meeting room displays
10
Router (~2 descendants each)
2 x 28 = 56 bytes
56 bytes
Occupancy sensors
80
Leaf (0 descendants)
0 bytes
0 bytes
Total routing memory
5.2 KB
Typical Zigbee module (CC2530): 8 KB RAM. Routing table for a light (112 bytes) is 1.4% of available RAM.
Non-Storing mode:
Device
Count
RAM for Routing
Border routers
3
40 x 28 = 1,120 bytes each (3.4 KB total)
All other devices
117
0 bytes (no routing table)
Total routing memory
3.4 KB
Decision: Storing mode. The memory savings from Non-Storing (1.8 KB less across the network) do not justify the 2.9x latency increase for P2P occupancy-to-light triggers. The mains-powered lights and controllers have sufficient RAM (8 KB) to store 4-8 routing entries (112-224 bytes). The battery-powered occupancy sensors are leaves with zero routing memory in both modes.
Key insight: In this smart office, 78% of traffic is upward (occupancy data) where both modes perform identically. But the remaining 22% (lighting commands and P2P triggers) determines the mode choice. The 200 ms occupancy-to-light requirement is easily met by both modes, but Storing mode’s 16 ms P2P latency leaves headroom for future requirements (e.g., adding Bluetooth presence for sub-100 ms lighting response). Non-Storing mode would be the right choice only if the occupancy sensors had extremely constrained RAM (<1 KB) – which is not the case for modern Zigbee modules.
Matching Quiz: RPL Traffic Patterns and Design
Ordering Quiz: Smart Building RPL Network Design Steps
Common Pitfalls
1. Designing Traffic Patterns Without Measuring Actual Payloads
Traffic design exercises often use round-number payload sizes. Real IoT sensors have protocol overhead (CoAP header, 6LoWPAN fragmentation, RPL source routing) that can double or triple the effective per-packet size. Measure full packet sizes including all headers.
2. Not Analyzing Traffic Bursts
Average traffic calculations hide burst behavior — a smart building with 200 sensors that all report simultaneously after a power restoration creates a DIO + application message storm. Design for peak burst, not average load.