WSN routing differs fundamentally from IP routing: nodes are identified by data type rather than address, energy is the primary cost metric rather than hop count, and routes must be rebuilt as nodes deplete batteries. Data-centric routing (e.g., Directed Diffusion) can reduce energy consumption by 40-60% compared to address-based approaches by aggregating redundant sensor readings in-network before forwarding to the sink.
76.1 Learning Objectives
By the end of this chapter, you will be able to:
Explain WSN Routing Fundamentals: Articulate why sensor network routing differs from traditional network routing
Describe Data-Centric Concepts: Illustrate how data-centric routing addresses content rather than node identities
Calculate Energy Impacts: Quantify why energy-aware routing is critical for battery-powered sensor networks
76.2 Prerequisites
Before diving into this chapter, you should be familiar with:
Wireless Sensor Networks: Understanding WSN architecture, multi-hop communication, and energy constraints provides the foundation for specialized routing protocols
WSN Overview: Fundamentals: Knowledge of sensor network characteristics, data aggregation, and network topologies is essential for understanding routing decisions
Routing Fundamentals: Familiarity with basic routing concepts, routing tables, and forwarding mechanisms helps distinguish WSN-specific routing approaches
Multi-Hop Ad Hoc: Fundamentals: Understanding self-organizing networks and dynamic routing provides context for data-centric and geographic routing strategies
MVU: Minimum Viable Understanding
Core concept: WSN routing is fundamentally different from internet routing – it is data-centric (routes by content, not address), energy-aware (balances battery drain), and optimized for many-to-one traffic patterns where all sensors report to a single sink.
Why it matters: Using internet-style routing in a sensor network wastes energy on retransmissions, creates hotspots near the sink, and ignores opportunities for in-network data aggregation that could reduce traffic by 70-90%.
Key takeaway: The shortest path is NOT the best path in WSNs. Always consider link quality (ETX metric), node energy levels, and aggregation opportunities when selecting routes.
Key Concepts
Routing Protocol: Algorithm determining paths for data packets to travel from source sensors to destination sinks through multi-hop networks
Energy-Aware Routing: Protocols that select paths based on node energy levels to balance consumption and extend network lifetime
Data-Centric Routing: Routing based on data content rather than node addresses, enabling in-network aggregation and filtering
Hierarchical Routing: Organizing network into clusters with cluster heads aggregating data from members before forwarding to sinks
Geographic Routing: Protocols using node location information to make forwarding decisions without maintaining routing tables
Quality of Service (QoS): Meeting application requirements for delivery reliability, latency, and bandwidth in routing decisions
76.3 Introduction
⏱️ ~12 min | ⭐⭐ Intermediate | 📋 P05.C34.U01
For Beginners: WSN Routing - Finding Paths Through Sensor Networks
Imagine 1,000 temperature sensors scattered across a farm. Each sensor measures its local area, but data needs to reach a central gateway (barn). How do messages hop from sensor to sensor to get there?
Traditional routing (like internet): Send email to bob@example.com—routers look up address, forward packet hop-by-hop based on routing tables. Works when you know the destination’s address.
WSN routing (different!): Not “send message to sensor #573,” but rather “all sensors detecting temperature > 30°C, report your data.” We care about what data says, not who sent it. This is called data-centric routing.
Why WSN routing is unique:
Energy-aware: Choose paths that balance battery drain across all sensors (don’t overwork nodes near gateway)
Data-centric: Route based on content (“fire detected!”) not addresses
Aggregation: Sensors combine data along the path (100 temperature readings → 1 average)
Many-to-one: Unlike internet (any-to-any), WSNs mostly flow toward one gateway
Term
Simple Explanation
Directed Diffusion
Routing protocol where “interests” (queries) flood network, data flows back along best paths (like water finding downhill routes)
Data Aggregation
Combining multiple sensor readings into summaries (10 nodes report “21°C, 22°C, 21°C…” → one node sends “avg: 21.3°C”)
Energy-Aware Routing
Choosing paths that avoid overusing nodes with low batteries (balances energy consumption)
Geographic Routing
Using physical location to forward (move packet toward GPS coordinates of gateway)
Link Quality
How reliable a wireless connection is (affected by distance, obstacles, interference)
Example: Fire detection network. When smoke sensor detects fire, it doesn’t need to send to “Sensor #573”—it broadcasts “FIRE at location X!” Nearby sensors hear this, aggregate with their data, and forward toward gateway. Path chosen: good battery, strong signal quality, shortest hops. Multiple paths used (redundancy in case one fails).
Key insight: Traditional routing protocols (like those for internet) fail in WSNs because they assume stable topology, ignore energy constraints, and don’t aggregate data. WSN protocols are specialized for battery-powered, dense deployments focused on data collection.
For Kids: Meet the Sensor Squad!
Sensor network routing is like playing a game of telephone across a huge playground where friends pass messages to each other until they reach the teacher!
76.3.1 The Sensor Squad Adventure: The Great Message Relay Race
One sunny day, the Sensor Squad was spread across Greenfield Farm to watch for anything unusual. Sammy the Temperature Sensor was way out by the pond, Lila the Light Sensor was in the orchard, Max the Motion Detector guarded the barn entrance, and Bella the Button sat by the farmhouse where Farmer Jones lived.
“I found something!” shouted Sammy from the pond. “The water is getting too hot for the fish!” But Sammy was too far away for Farmer Jones to hear directly. How could the message get through?
“I’ve got an idea,” said Max. “Let’s play Message Relay! I’m closer to the farmhouse, so Sammy passes to Lila, Lila passes to me, and I’ll tell Bella, who’s right next to Farmer Jones!”
But here’s the tricky part - Lila’s battery was running low from working all day in the sunny orchard. “I’m tired,” Lila yawned. “Maybe find another path?”
So clever Max found that Sammy could pass directly to him instead, skipping tired Lila. The message hopped from Sammy to Max to Bella to Farmer Jones - and the fish were saved!
“That’s called energy-aware routing,” explained Bella proudly. “We pick paths where friends aren’t too tired, so everyone’s batteries last longer!”
76.3.2 Key Words for Kids
Word
What It Means
Routing
Finding the best path for a message to travel, like choosing which friends to pass a note through
Multi-hop
When a message jumps from friend to friend to friend (like stepping stones across a creek)
Energy-aware
Being smart about who does work - don’t always ask the tired friend to help!
Data aggregation
Combining messages together - instead of 5 friends each saying “it’s hot,” one friend says “everyone says it’s hot!”
76.3.3 Try This at Home!
The Telephone Game Challenge: Gather 4-6 friends or family members and spread out across your yard or living room. One person whispers a message, and everyone passes it along until it reaches the last person. Now try it again, but this time skip the person in the middle - did the message travel faster? Did it stay accurate? This is how sensors choose different paths to send their messages! Try having one person pretend to be “tired” (they speak very quietly) and see if the message still gets through - that’s why sensors need backup routes!
Routing in Wireless Sensor Networks (WSNs) differs fundamentally from traditional network routing due to the unique characteristics and constraints of sensor networks. Unlike conventional networks where routing focuses on establishing end-to-end communication between arbitrary nodes, WSN routing is typically data-centric, application-specific, and energy-aware.
Putting Numbers to It
Consider a 100-node WSN where each sensor transmits a 50-byte packet every 60 seconds. In traditional address-centric routing, the sink must maintain a routing table with 100 entries (4 bytes per entry × 100 = 400 bytes of RAM). With 512 bytes total RAM on a typical sensor node, routing tables consume 78% of available memory.
In contrast, data-centric routing using Directed Diffusion maintains gradients (reverse paths) only for active interests. With 3 concurrent interests active, gradient storage requires approximately 3 interests × 4 neighbors × 8 bytes = 96 bytes (19% of RAM). The memory savings enable more application data buffering.
Energy impact: Address-centric protocols like DSDV broadcast routing updates every 15 seconds. For 100 nodes with 250 kbps radios (CC2420): \(\text{Energy} = \frac{400 \text{ bytes} \times 8 \text{ bits/byte}}{250{,}000 \text{ bps}} \times 17.4 \text{ mA} \times 3 \text{ V} = 0.67 \text{ mJ per update}\). Over one hour: 240 updates × 0.67 mJ = 160 mJ just for routing overhead – compared to 12 mJ for interest propagation in data-centric routing (93% savings).
This chapter introduces the specialized routing protocols designed for WSNs, including Directed Diffusion, link quality-based routing, data aggregation techniques, and the Trickle algorithm for network reprogramming.
Putting Numbers to It
Quantifying the ETX (Expected Transmission Count) metric advantage: Consider two 4-hop paths from sensor to sink:
Path A (shortest hop count): Each link has 70% delivery rate (PDR = 0.7) \[\text{ETX}_{\text{Path A}} = \sum_{i=1}^{4} \frac{1}{\text{PDR}_i} = \frac{1}{0.7} + \frac{1}{0.7} + \frac{1}{0.7} + \frac{1}{0.7} = 5.71 \text{ transmissions}\]
Path B (longer, 5 hops): Each link has 95% delivery rate (PDR = 0.95) \[\text{ETX}_{\text{Path B}} = \sum_{i=1}^{5} \frac{1}{0.95} = 5 \times 1.053 = 5.26 \text{ transmissions}\]
Path B requires 0.45 fewer transmissions (8% energy savings) despite the extra hop. At 50 µJ per transmission (CC2420 radio), Path A wastes 5.71 × 50 µJ = 285.5 µJ vs. Path B’s 263 µJ per packet. For 1,440 packets/day (one per minute), Path A wastes an extra 32.4 mJ/day = 11.8 Joules per year – reducing 2-year battery life to 1.8 years.
76.4 ETX Path Quality Calculator
Adjust the link quality of two competing paths to see which has lower ETX (fewer expected transmissions):
Show code
viewof path_a_hops = Inputs.range([1,8], {value:4,step:1,label:"Path A hops"})viewof path_a_pdr = Inputs.range([0.3,1.0], {value:0.70,step:0.05,label:"Path A link PDR"})viewof path_b_hops = Inputs.range([1,8], {value:5,step:1,label:"Path B hops"})viewof path_b_pdr = Inputs.range([0.3,1.0], {value:0.95,step:0.05,label:"Path B link PDR"})viewof tx_energy_uj = Inputs.range([10,500], {value:50,step:10,label:"Energy per TX (µJ)"})
Figure 76.1: WSN routing characteristics comparing traditional address-centric routing with WSN-specific data-centric, energy-aware approaches
Figure 76.2: Alternative View: Protocol Selection Decision Tree - This decision tree guides practitioners in selecting the appropriate WSN routing protocol. Start with network size: small networks (< 100 nodes) can use flat routing where all nodes are equal. Large networks (> 1000 nodes) require hierarchical clustering (LEACH) to manage scale. For medium networks, consider whether GPS locations are available (use geographic routing) or focus on data patterns: event-driven applications (fire detection) suit Directed Diffusion while continuous monitoring suits tree-based aggregation (CTP). Each leaf node shows the recommended use case.
Cross-Hub Connections
Interactive Learning Resources:
Simulations Hub: Network Topology Visualizer helps understand WSN routing topologies and compare star, mesh, and tree structures. Try the routing simulator to visualize Directed Diffusion interest propagation and gradient formation.
Quizzes Hub: Test your understanding of WSN routing with protocol comparison questions, link quality estimation exercises, and data aggregation calculations. Focus on LEACH cluster formation and Trickle algorithm operation.
Videos Hub: Watch animated explanations of Directed Diffusion phases, WMEWMA link estimation visualizations, and Trickle polite gossip demonstrations. Video walkthroughs show real WSN deployments using CTP and RPL protocols.
Hands-On Practice: Use network simulators (NS-3, TOSSIM) to compare routing protocols. Implement simple Directed Diffusion on Arduino-based WSNs. Measure link quality with RSSI on ESP32 networks.
Common Misconception: “Shortest Path = Most Energy Efficient”
Misconception: “In WSNs, the shortest path (fewest hops) is always the most energy-efficient route.”
Reality: Shortest paths often waste energy due to poor link quality requiring retransmissions.
Quantified Example:
Path A (Shortest): 2 hops, each link has 50% delivery rate
Expected transmissions: 1/0.5 + 1/0.5 = 4 total transmissions
Energy: 4 transmissions × 20 mJ = 80 mJ
Path B (Longer): 3 hops, each link has 90% delivery rate
Energy savings: Path B saves 17% energy despite being longer!
Why This Matters: Hop-count routing (traditional) would choose Path A, wasting 13.4 mJ per packet. In a network sending 10,000 packets/day, that’s 134 Joules wasted = 3-4 weeks shorter network lifetime.
Correct Approach: Use ETX (Expected Transmission Count) or MIN-T metrics that account for link quality. Route selection should minimize total expected transmissions, not just hop count.
Real Impact: Urban WSN deployment switched from hop-count to ETX routing. Result: Average transmissions per packet decreased from 4.2 to 2.1 (50% reduction), network lifetime extended from 8 months to 18 months.
Quick Check: ETX vs Hop Count
76.5 Worked Example: Energy Cost of Routing Decisions
Consider a 200-node WSN deployed in a 500m x 500m agricultural field, with a single sink at the center. Each node runs on 2x AA batteries (3,000 mAh at 3V = 32,400 Joules).
Energy model per transmission (CC2420 radio, typical for Zigbee):
Operation
Current Draw
Duration
Energy
Transmit (0 dBm)
17.4 mA
4.2 ms/packet
219 uJ
Receive
18.8 mA
4.2 ms/packet
237 uJ
Listen (idle)
18.8 mA
per second
56.4 mJ
Sleep
20 uA
per second
60 uJ
Scenario: 200 nodes reporting temperature every 60 seconds to the sink
Approach 1: Shortest-path routing (hop count)
Nodes near the sink relay all traffic. The 8 nodes adjacent to the sink each relay data for ~25 nodes:
Energy per hour for relay node near sink:
Own transmissions: 60 packets/hour x 219 uJ = 13.1 mJ
Relay receives: 25 nodes x 60 pkt/hr x 237 uJ = 355 mJ
Relay transmits: 25 nodes x 60 pkt/hr x 219 uJ = 328 mJ
Total: 696 mJ/hour = 16.7 J/day
Battery lifetime for relay node: 32,400 J / 16.7 J/day = 1,941 days
Sounds fine, but these 8 relay nodes also overhear all traffic from 25 upstream nodes (idle listening while radio is on). If the radio stays on to receive relayed packets, that adds roughly:
Idle-listen overhead for relay node (radio on ~12% of time for 25 upstream nodes):
Receive window: 25 nodes × 60 pkt/hr × 4.2 ms/pkt = 6,300 ms/hr = 10.5 min/hr on
Idle listen current: 18.8 mA at 3V = 56.4 mW
Additional idle energy: 6,300 s/day × 56.4 mW = 355 J/day
Total for relay node: 16.7 + 355 = ~372 J/day. Lifetime: 32,400 / 372 = ~87 days before relay nodes near the sink exhaust their batteries, partitioning the network – while edge nodes still have 95% battery remaining.
Distribute relay duties among all 40 nodes within 2 hops of sink. Each node relays for ~5 other nodes on average:
Energy per hour for balanced relay node:
Own transmissions: 60 pkt/hr x 219 uJ = 13.1 mJ
Relay receives: 5 nodes x 60 pkt/hr x 237 uJ = 71 mJ
Relay transmits: 5 nodes x 60 pkt/hr x 219 uJ = 65.7 mJ
Total: 150 mJ/hour = 3.6 J/day
Battery lifetime: 32,400 J / 3.6 J/day = 9,000 days (~24 years)
Even accounting for idle listening overhead (duty cycle), balanced routing achieves 2+ year network lifetime versus 2 months with shortest-path. The network dies when the first node dies (it creates a coverage hole), so balancing energy across all nodes is critical.
Python simulation of network lifetime:
# What to observe: How routing strategy affects network lifetimeimport numpy as npdef simulate_network_lifetime(num_nodes=200, strategy="shortest"):"""Compare routing strategies by simulating energy drain.""" battery_joules =32_400# 2x AA batteries energy = np.full(num_nodes, battery_joules, dtype=float) tx_cost =219e-6# Joules per transmit rx_cost =237e-6# Joules per receive reports_per_day =24*60# Once per minute# Nodes 0-7 are adjacent to sink# Nodes 0-39 are within 2 hops of sink sink_neighbors =list(range(8)) two_hop =list(range(40)) day =0while energy.min() >0: day +=1for node inrange(num_nodes):# Own transmission cost energy[node] -= reports_per_day * tx_cost# Relay cost depends on strategyif strategy =="shortest":# Nodes 0-7 relay for ~25 eachif node in sink_neighbors: relayed =25* reports_per_day energy[node] -= relayed * (rx_cost + tx_cost)elif strategy =="balanced":# Nodes 0-39 relay for ~5 eachif node in two_hop: relayed =5* reports_per_day energy[node] -= relayed * (rx_cost + tx_cost)return day# Results (simplified, excluding idle listening overhead):# shortest: ~1,941 days (relay only); with idle listen: ~87 days# balanced: ~9,000 days (~24 years) -- load distributed across 40 nodes
76.6 Knowledge Check
Test Your Understanding
Question 1: What is the fundamental difference between traditional internet routing and WSN routing?
WSN routing uses wireless links while internet routing uses wired links
WSN routing is data-centric (routes by content) while internet routing is address-centric (routes by destination IP)
WSN routing is slower than internet routing due to constrained hardware
WSN routing requires GPS while internet routing uses IP addresses
Answer
b) WSN routing is data-centric while internet routing is address-centric. In traditional routing, packets are forwarded based on destination IP addresses. In WSN routing, the network cares about WHAT data contains (e.g., “temperature > 30 degrees C”), not WHO sent it. This enables in-network aggregation and filtering, which is impossible with address-only routing.
Question 2: Why is “shortest path” routing often energy-inefficient in WSNs?
Shorter paths use higher transmission power
Shortest paths create energy hotspots near the sink and ignore link quality, requiring costly retransmissions
WSN nodes cannot compute shortest paths due to limited processing power
Shortest paths always go through obstacles that block radio signals
Answer
b) Shortest paths create energy hotspots near the sink and ignore link quality. A 2-hop path with 50% link quality requires an average of 4 total transmissions (including retransmissions), while a 3-hop path with 90% quality needs only 3.33 transmissions. Additionally, shortest-path routing always uses the same relay nodes near the sink, draining them first and partitioning the network while distant nodes still have plenty of energy.
Question 3: What is “many-to-one” traffic pattern and why does it matter for WSN routing?
Multiple sinks collect data from a single source for redundancy
All sensor nodes send data toward a single sink/gateway, creating asymmetric load
Nodes communicate peer-to-peer with many neighbors simultaneously
One node broadcasts messages to all other nodes in the network
Answer
b) All sensor nodes send data toward a single sink/gateway, creating asymmetric load. Unlike internet traffic (any-to-any), WSN traffic flows primarily from many sensors toward one or few gateways. This creates increasing traffic density near the sink, causing relay nodes close to the sink to carry disproportionate load. Routing protocols must balance this load through techniques like hierarchical clustering (LEACH) or multipath routing.
76.7 Energy Cost of Routing: Why Protocol Choice Matters
The routing protocol consumes a significant portion of a WSN node’s energy budget. Choosing incorrectly can halve network lifetime.
Worked Example: Routing Energy Comparison for 100-Node Agricultural WSN
Scenario: 100 soil moisture sensors deployed across 10 hectares, reporting to a single gateway every 5 minutes. Each node runs on a 3,000 mAh AA battery pair. The question: which routing paradigm extends network lifetime the most?
Control overhead: Full routing table (99 entries x 8 bytes = 792 bytes) every 15 seconds
Per node per hour: 240 table broadcasts x 792 bytes = 190 KB transmitted + received from ~5 neighbors
Energy for control: 240 x (792 x 8 / 250,000) x 17.4 mA + 240 x 5 x (792 x 8 / 250,000) x 18.8 mA = 1.45 mJ/hour
Energy for data: 12 reports/hour x 4 hops x 60 bytes x 8 / 250,000 x 17.4 mA = 0.04 mJ/hour
Routing overhead dominates: 97% of energy spent on route maintenance
Reactive (DSR-style):
Route discovery: 1 RREQ flood per hour (assuming routes break ~once per hour in stable agriculture)
RREQ size: 40 bytes, flooded to all 100 nodes
Energy for discovery: 100 x 40 x 8 / 250,000 x (17.4 + 18.8) mA = 0.046 mJ/hour
Energy for data: same as proactive = 0.04 mJ/hour
Data and routing roughly equal: 53% data, 47% routing
Hierarchical (LEACH-style):
Cluster formation: 5% of nodes become cluster heads per round (20-minute rounds)
Cluster head overhead: aggregates data from ~20 members, single transmission to sink
Non-cluster-head: transmits to nearby cluster head (1 hop, not 4)
Energy for data: 12 reports/hour x 1 hop x 60 bytes x 8 / 250,000 x 17.4 mA = 0.01 mJ/hour
Cluster head penalty: receives from 20 members + transmits aggregated data = 5x average energy
Rotation distributes load: no single node exhausted
Metric
Proactive (DSDV)
Reactive (DSR)
Hierarchical (LEACH)
Control overhead/hour
190 KB/node
4 KB/node
0.5 KB/node
Energy for routing/hour
1.45 mJ
0.046 mJ
0.02 mJ
Energy for data/hour
0.04 mJ
0.04 mJ
0.01 mJ
Total energy/hour
1.49 mJ
0.086 mJ
0.03 mJ
Battery lifetime (3,000 mAh)
2.4 years
8.1 years
12+ years
Route availability
Instant
~200 ms delay
Instant (within cluster)
Decision: For this agricultural deployment with stable topology and periodic reporting, hierarchical routing (LEACH or variants) extends lifetime by 5x over proactive routing. Reactive routing is a strong middle ground – 3.4x better than proactive with simpler implementation than hierarchical.
Common Pitfalls
1. Building Routing Tables Without Energy Awareness
Shortest-hop routing concentrates relay load on nodes near the sink, depleting them 10-100× faster than edge nodes. Always incorporate residual energy into route metric (e.g., ETX × energy factor) to balance consumption and prevent premature network partitioning.
2. Forgetting to Handle Routing Table Staleness
WSN topology changes as nodes die or move — routing tables become stale within hours in dynamic deployments. Implement periodic route discovery with a timeout proportional to expected node lifetime, and use link-quality metrics that decay when no recent transmissions are observed.
3. Using Flooding for Data Collection in Dense Networks
Flooding generates O(n²) messages in a 100-node network — a single data collection round produces 10,000 transmissions. Use directed diffusion or tree-based convergecast to reduce collection overhead to O(n) messages.
🏷️ Label the Diagram
Code Challenge
76.8 Summary
This chapter introduced the fundamental differences between traditional network routing and WSN routing:
Key Takeaways:
Data-Centric Approach: WSN routing focuses on data content rather than node addresses
Energy Awareness: Routing decisions must balance energy consumption across all nodes