74  Sensor Network Routing

In 60 Seconds

WSN routing differs fundamentally from IP routing: it is data-centric (route by content, not address), energy-aware (balance load to prevent hotspots), and aggregation-friendly (reduce data in-network). Four protocol families exist – data-centric (Directed Diffusion), hierarchical (LEACH clustering), geographic (GPSR forwarding), and QoS-aware – each optimized for different deployment constraints.

74.1 Learning Objectives

By the end of this chapter series, you will be able to:

  • Compare WSN Routing Paradigms: Distinguish data-centric, hierarchical, and geographic routing approaches
  • Implement Directed Diffusion: Configure attribute-based routing for data-centric sensor networks
  • Design Energy-Aware Routes: Select paths that balance energy consumption across network nodes
  • Apply Data Aggregation: Implement in-network data processing to reduce communication overhead
  • Evaluate Link Quality: Use link quality metrics to improve routing reliability and performance
  • Configure Trickle Algorithm: Implement efficient dissemination protocols for network updates

Routing in wireless sensor networks determines how data finds its way from sensors to the collection point. Think of water flowing downhill through a network of channels – routing protocols create efficient pathways for data, choosing routes that conserve battery power while ensuring messages arrive reliably.

74.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 differs fundamentally from traditional network routing because it prioritizes energy efficiency over throughput and uses data-centric approaches instead of address-based routing.

Why it matters: Sensors operate on limited batteries for years; inefficient routing drains nodes prematurely, creating coverage gaps. Traditional shortest-path routing fails because it ignores link quality, energy levels, and the many-to-one traffic pattern in sensor networks.

Key takeaway: Choose routing protocols based on your application: Directed Diffusion for event-driven data collection, LEACH for hierarchical aggregation, geographic routing when GPS is available, and always consider link quality metrics (ETX) over simple hop count.

Sensor network routing is like a game of telephone - but smarter!

74.2.1 The Sensor Squad Adventure: The Forest Fire Alert

Imagine a huge forest with hundreds of tiny sensor friends spread out watching for fires. When Smokey the Smoke Sensor spots danger, how does the message get to Ranger Rita at the station miles away?

Hoppy the Routing Rabbit explains: “It’s like passing notes in class, but we’re super smart about it! If Smokey just shouted the message, only sensors nearby would hear. So instead, Smokey whispers to his closest friend, who whispers to their friend, and so on - until the message reaches Ranger Rita!”

But here’s the tricky part: Each sensor runs on a tiny battery, like the battery in your TV remote. If one sensor does ALL the whispering, their battery dies and there’s a gap in our forest protection!

Clever Clara the Cluster Head shows how they solve this: “We take turns being the leader! Today, I collect all the messages from my neighborhood and send just ONE summary to the next group. Tomorrow, Sonny the Soil Sensor takes over as leader. We share the hard work!”

Gracie the GPS Sensor has another trick: “I know exactly where I am! So when I need to send a message to Ranger Rita, I just send it toward her direction - like knowing which way to walk home. No need to memorize complicated maps!”

74.2.2 Key Words for Kids

Word What It Means
Routing Finding the best path to send a message from one place to another
Multi-hop Messages jumping from friend to friend instead of going directly
Energy-aware Being careful about how much battery each sensor uses
Cluster A group of sensors with one leader who collects all their messages
Data aggregation Combining many small messages into one bigger summary message

74.2.3 Try This at Home!

The Telephone Relay Game!

  1. Get 5+ friends and stand in a line spread apart
  2. Whisper a message from one end to the other
  3. Challenge 1: Each person can only whisper once per round (limited energy!)
  4. Challenge 2: Middle person becomes “cluster head” - everyone whispers to them, they pass ONE summary forward
  5. Challenge 3: If someone is “too tired” (eyes closed), route around them!

What did you learn?

  • Direct path isn’t always possible
  • Sharing the work keeps everyone going longer
  • Sometimes summarizing is smarter than repeating everything!

74.3 Chapter Overview

This chapter has been organized into six focused sections for easier learning. Work through them in order, or jump to the topic most relevant to your current needs.

74.3.1 WSN Routing at a Glance

The following diagram illustrates the three main routing paradigms in wireless sensor networks:

Flowchart comparing three WSN routing paradigms: Data-Centric routing showing sink broadcasting interest then nodes establishing gradients then data flowing along reinforced paths; Hierarchical routing showing network forming clusters then cluster heads aggregating data then forwarding to sink; Geographic routing showing nodes knowing their location then forwarding toward destination without routing tables. All three connect to a central choice node indicating when to use each approach.

WSN Routing Paradigms: Data-Centric vs Hierarchical vs Geographic
Figure 74.1: WSN Routing Paradigms: Data-Centric vs Hierarchical vs Geographic

Understanding when to use each paradigm is crucial for efficient WSN design:

Scenario: 300-node WSN monitoring a 1 km² industrial facility. Each node reports every 5 minutes (288 reports/day). Battery: 2× AA = 10,000 J. Radio: 50 µJ per transmission.

Data-Centric (Directed Diffusion): Sink broadcasts interest every 5 minutes (periodic query). Interest flood: 300 nodes × 80 µJ = 24 mJ per round. Data delivery: Only sensors with matching data respond (assume 10% match rate = 30 nodes). Energy: \(288 \times (24 \text{ mJ interest} + 30 \times 4 \text{ hops} \times 50 \text{ µJ}) = 8{,}611 \text{ mJ/day}\).

Hierarchical (LEACH with p=0.1): 30 clusters, CH rotates every round. Cluster formation: 30 CHs × 20 bytes = 0.6 KB/round = minimal energy. Data: 270 members send to CH (1 hop), 30 CHs aggregate and send to sink (avg 3 hops). Energy per day: \(288 \times [(270 \times 50) + (30 \times 3 \times 50)] = 5{,}184 \text{ mJ/day}\).

Geographic (GPSR): No control overhead (stateless). Data delivery: 300 nodes × 4 hops × 50 µJ × 288 reports = 17,280 mJ/day. Problem: No aggregation → high traffic.

Result: LEACH consumes 40% less energy than Directed Diffusion for periodic reporting and 70% less than GPSR. Network lifetime: LEACH = 5.3 years, Directed Diffusion = 3.2 years, GPSR = 1.6 years. For event-driven queries (only 5% of time), Directed Diffusion would outperform with 95% energy savings by avoiding unnecessary routing overhead.

74.3.2 1. WSN Routing Fundamentals (3 chapters)

Introduction, challenges, and protocol classification

Routing in Wireless Sensor Networks differs fundamentally from traditional network routing. This section is organized into three focused chapters:

74.3.3 2. Directed Diffusion Protocol

Data-centric routing with interests and gradients

Directed Diffusion revolutionized WSN routing with its publish-subscribe paradigm. This section explains how sinks express “interests” and how data flows along gradients back to interested parties.

  • Interest propagation mechanism
  • Gradient establishment and data delivery
  • Two-phase pull and reinforcement
  • Protocol benefits and trade-offs

74.3.4 3. Data Aggregation Techniques

In-network processing to reduce transmissions

Data aggregation combines sensor readings to dramatically reduce transmission count and energy consumption. This section covers aggregation functions, metrics, and the LEACH clustering protocol.

  • Aggregation functions (MIN, MAX, AVG, SUM)
  • Accuracy, completeness, and latency trade-offs
  • LEACH cluster head rotation
  • Worked example: Energy analysis

74.3.5 The Power of Data Aggregation

The following diagram demonstrates how in-network aggregation dramatically reduces transmission count compared to naive forwarding:

Side-by-side comparison of two data transmission approaches. Without aggregation: four sensors each sending temperature readings directly to sink requiring 16 transmissions. With aggregation: four sensors send to a cluster head which computes the average and forwards one summary to sink requiring only 5 transmissions. Energy savings calculation shows 69% reduction from 800 microjoules to 250 microjoules.

Data Aggregation: 16 Sensor Readings to 1 Summary
Figure 74.2: Data Aggregation: 16 Sensor Readings to 1 Summary

This example shows only 4 sensors for clarity, but in real deployments with hundreds of nodes, aggregation savings are even more dramatic. A cluster of 50 nodes sending 50 individual readings versus one aggregated summary represents 98% transmission reduction.

74.3.8 5. Trickle Algorithm

Efficient network reprogramming

WSNs may operate for years, requiring over-the-air updates. Trickle provides “polite gossip” for code propagation with minimal overhead when consistent and rapid propagation when needed.

  • Network reprogramming challenges
  • Trickle’s suppression mechanism
  • Exponential backoff
  • Implementation parameters

74.3.9 6. Labs and Interactive Games

Hands-on practice and simulations

Apply your knowledge with interactive tools and hands-on labs that demonstrate routing protocols in action.

  • WSN Route Optimizer Game
  • Multi-hop routing simulation (Wokwi ESP32)
  • Protocol comparison exercises

74.4 Quick Reference: Protocol Selection

The following decision flowchart helps you select the appropriate routing protocol based on your network characteristics:

Decision flowchart for selecting WSN routing protocols. Starting from application requirements, first decision: GPS available? If yes, use Geographic Routing like GPSR or GEAR. If no, check network size: greater than 100 nodes leads to Hierarchical like LEACH or PEGASIS. For smaller networks, check data pattern: event-driven leads to Data-Centric like Directed Diffusion, continuous data checks mobility: mobile nodes use Reactive like AODV or DSR, static nodes use Proactive like DSDV. All paths converge on always considering Link Quality ETX metric.

WSN Routing Protocol Selection Decision Tree
Figure 74.4: WSN Routing Protocol Selection Decision Tree
Scenario Recommended Protocol Rationale
Event-driven monitoring Directed Diffusion Data-centric, responds to queries
Dense deployment (>100 nodes) LEACH/PEGASIS Hierarchical aggregation scales
GPS-equipped nodes GPSR/GEAR Geographic forwarding efficient
Real-time alerts QoS protocols (SPEED) Latency guarantees
Stable topology Proactive (DSDV) Routes ready immediately
Mobile nodes Reactive (AODV) Adapts to changes
Code updates Trickle Low overhead when consistent

74.5 Interactive: Protocol Energy Estimator

Use the sliders below to model the daily energy budget of three WSN routing approaches for your scenario.

74.6 Key Concepts

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
  • Expected Transmission Count (ETX): Link quality metric estimating transmissions needed for successful delivery, accounting for retransmissions

74.7 Worked Example: ETX Path Selection

Understanding how ETX (Expected Transmission Count) works helps engineers make better routing decisions. Consider this practical calculation:

Scenario: A sensor node has two paths to reach the sink:

Path Hops Link Success Rates
Path A 2 Link 1: 60%, Link 2: 80%
Path B 3 Link 1: 95%, Link 2: 90%, Link 3: 95%

Calculation:

For ETX, we calculate expected transmissions per link as 1/success_rate:

  • Path A ETX: (1/0.60) + (1/0.80) = 1.67 + 1.25 = 2.92
  • Path B ETX: (1/0.95) + (1/0.90) + (1/0.95) = 1.05 + 1.11 + 1.05 = 3.21

Result: Path A has lower ETX (2.92 < 3.21), so ETX routing would select Path A despite the poor first link.

Practical Consideration

In real deployments, link quality varies over time due to interference, weather, and battery depletion. Production systems use Exponentially Weighted Moving Average (EWMA) to smooth measurements and avoid route flapping.

74.8 Common Pitfalls

Pitfall 1: Using Hop Count as Primary Metric

  • Mistake: Selecting routes based solely on minimum hops, like traditional networks
  • Why it fails: A 2-hop path with 60% packet loss per link delivers only 16% of packets (0.4 × 0.4), requiring massive retransmissions
  • Solution: Always use link quality metrics (ETX, WMEWMA) that account for actual delivery probability

Pitfall 2: Fixed Cluster Heads

  • Mistake: Assigning permanent cluster head roles based on location or initial energy
  • Why it fails: Cluster heads consume 10-100x more energy than members; fixed roles create “hot spots” that die first
  • Solution: Rotate cluster heads (like LEACH) or use residual energy in selection algorithms

Pitfall 3: Ignoring the Many-to-One Traffic Pattern

  • Mistake: Using protocols designed for peer-to-peer traffic (like AODV) in data collection networks
  • Why it fails: WSNs have convergecast patterns where all data flows toward sinks; nodes near sinks become bottlenecks
  • Solution: Use collection protocols (CTP, RPL) designed for many-to-one, or deploy multiple sinks

Pitfall 4: Over-Aggregation

  • Mistake: Aggressively aggregating data to minimize transmissions without considering application needs
  • Why it fails: Aggregation loses granularity; averaging temperatures hides the single hot spot indicating fire
  • Solution: Match aggregation function to application: use MIN/MAX for anomaly detection, AVG for ambient monitoring

Pitfall 5: Ignoring Asymmetric Links

  • Mistake: Assuming if node A can hear node B, then B can hear A
  • Why it fails: Due to varying transmission power, antenna orientation, and interference, 30-50% of links are asymmetric
  • Solution: Verify bidirectional connectivity before including links in routing tables; use link probing in both directions

74.9 Knowledge Check

Scenario: Environmental monitoring with 200 temperature sensors. Compare traditional address-centric routing vs. data-centric (Directed Diffusion) approach.

Query: “Report all temperatures > 35°C in northwest quadrant”

Address-Centric Approach (IP-style):

  1. Sink broadcasts query to all 200 nodes: 200 × 50 bytes = 10,000 bytes transmitted network-wide
  2. All 200 nodes process query, check temperature
  3. Matching nodes (assume 8 in NW quadrant > 35°C) respond individually to sink
  4. Each response: 8 nodes × 50 bytes × average 4 hops = 1,600 bytes
  5. Non-matching nodes (192) send “no match” or timeout (wasted energy)
  6. Total network traffic: 10,000 + 1,600 = 11,600 bytes transmitted
  7. Energy (50 µJ/byte): 580 mJ total network consumption

Data-Centric Approach (Directed Diffusion):

  1. Sink sends interest “temp > 35°C, region=NW” toward northwest quadrant only
  2. Interest propagates via geographic gradients: ~50 nodes in NW receive interest (not all 200)
  3. Only matching nodes (8 with temp > 35°C) establish data paths
  4. Gradient reinforcement focuses on best paths (suppresses redundant paths)
  5. Only 8 nodes transmit data: 8 × 50 bytes × 3 hops (optimized) = 1,200 bytes
  6. Total network traffic: Interest (50 nodes × 50 bytes) + Data (1,200 bytes) = 3,700 bytes
  7. Energy: 185 mJ total network consumption
  8. Energy savings: 68% reduction vs. address-centric

Scalability Analysis:

  • Address-centric scales with total node count (N): O(N)
  • Data-centric scales with matching node count (M): O(M)
  • For queries matching M << N (common in WSN), data-centric wins

Real-World Implication: Wildfire detection system with 10,000 sensors. Normal conditions (no fire): 0 matches. Fire event: 50 matches. - Address-centric: Queries 10,000 nodes every 5 minutes = 120 MB/hour - Data-centric: Queries ~100 sensors in fire-prone regions = 1.2 MB/hour (100× reduction during normal operation)

Key Insight: Data-centric routing exploits WSN application semantics – queries are usually spatial (“region X”), temporal (“last hour”), or value-based (“above threshold”). Routing by data attributes instead of node addresses allows optimization impossible in traditional networks.

Application Type Best Routing Paradigm Rationale Example
Periodic data collection Hierarchical (LEACH) All nodes report regularly; aggregation reduces traffic Precision agriculture (hourly soil readings)
Event-driven monitoring Data-centric (Directed Diffusion) Most queries match few nodes; spatial targeting efficient Forest fire detection (rare events, localized)
Mobile target tracking Geographic (GPSR, GEAR) Query/data routing toward moving target location Wildlife tracking, vehicle monitoring
Real-time alerts QoS-aware (SPEED, MMSPEED) Latency guarantees essential for safety-critical Industrial alarm systems, medical monitoring
Continuous video/audio Traditional (minimize hops) High bandwidth needs, energy secondary to throughput Security cameras (usually mains-powered)
Infrequent maintenance Energy-aware hybrid Maximize lifetime; accept higher latency Remote environmental (5-10 year deployment)

Selection Logic:

  1. Is latency critical (<100 ms)? → QoS-aware (SPEED) OR always-on MAC (costly)
  2. Is data high-bandwidth (>10 kbps/node)? → Traditional routing (WSN may be wrong choice)
  3. Is network mostly static AND node count >100? → Hierarchical (LEACH/PEGASIS)
  4. Are events rare AND spatially localized? → Data-centric (Directed Diffusion)
  5. Do nodes have GPS AND mobility matters? → Geographic (GPSR)
  6. Default for general WSN: Hybrid approach (Collection Tree Protocol = ETX-based tree + trickle)
Common Mistake: Choosing Protocols Based on Simulation Performance, Not Application Match

The Mistake: Running 5 routing protocol simulations (AODV, LEACH, Directed Diffusion, GPSR, DSR), picking the one with highest packet delivery rate and lowest average hop count.

Why It’s Wrong: Protocol performance depends critically on workload characteristics. LEACH wins for periodic sensing but fails catastrophically for rare event detection. Directed Diffusion excels at event queries but wastes energy for continuous monitoring.

Real-World Example: Smart city deployment chose AODV because simulation showed “95% delivery rate, 3.2 average hops, lowest latency.” Application: Air quality monitoring with 5-minute periodic reports from 500 sensors. Actual deployment after 3 months: - AODV hotspot nodes died (relaying 400 packets/hour), creating coverage holes - Route maintenance overhead: 40% of total traffic (RREQ/RREP/RERR) - Network partitioned into 8 disconnected islands - Battery life: 4 months worst-case (target was 3 years)

Post-Mortem: LEACH would have extended lifetime to 2.5 years for this periodic reporting application via: - Clustering eliminates hotspot problem (CH rotation distributes relay burden) - Aggregation reduces traffic by 85% (20 readings → 1 summary per cluster) - No route maintenance overhead (clusters use direct communication)

The Fix: Match protocol to workload, not abstract metrics: 1. Characterize YOUR workload: Periodic vs. event? Query patterns? Latency needs? 2. Understand protocol assumptions: LEACH assumes static periodic reporting. AODV assumes occasional any-to-any communication. Directed Diffusion assumes event queries. 3. Simulate realistic workload: Don’t use “random packet every 10 seconds” – use actual application traffic patterns 4. Measure over full lifetime: Include node failures, battery depletion, protocol overhead

Rule of Thumb: Protocol selection is application-driven, not performance-driven. There is no “best WSN routing protocol” – only “best protocol for THIS application’s workload and constraints.”

74.10 Summary

This chapter introduced the fundamental concepts of Wireless Sensor Network routing:

  • WSN routing differs from traditional routing: Energy efficiency, data-centric operation, and many-to-one traffic patterns require specialized protocols
  • Three main paradigms: Data-centric (Directed Diffusion), hierarchical (LEACH), and geographic (GPSR) routing each address different application needs
  • Protocol selection matters: Choose based on network size, mobility, GPS availability, and data patterns - there is no one-size-fits-all solution
  • Link quality is crucial: ETX and other link metrics outperform simple hop count for reliable delivery
  • Data aggregation saves energy: In-network processing reduces transmission count, the dominant energy consumer
  • Trickle enables updates: Efficient code propagation with polite gossip minimizes overhead

The sub-chapters that follow provide deep dives into each of these topics with practical examples, worked calculations, and hands-on labs.

74.11 Knowledge Check

74.12 What’s Next

Topic Chapter Description
Routing Fundamentals WSN Routing Fundamentals Why WSN routing differs from traditional networking
Directed Diffusion Directed Diffusion Data-centric routing with interest propagation and gradients
Data Aggregation Data Aggregation In-network processing to reduce transmissions
Link Quality Routing Link Quality Routing ETX and WMEWMA metrics for reliable path selection
Trickle Algorithm Trickle Algorithm Efficient network reprogramming via polite gossip
Labs and Games Labs and Games Hands-on practice and interactive simulations
RPL Routing RPL Routing IPv6 routing for constrained networks

74.13 Further Reading

  1. Intanagonwiwat, C., et al. (2003). “Directed diffusion for wireless sensor networking.” IEEE/ACM Transactions on Networking, 11(1), 2-16.

  2. Woo, A., Tong, T., & Culler, D. (2003). “Taming the underlying challenges of reliable multihop routing in sensor networks.” ACM SenSys, 14-27.

  3. Levis, P., et al. (2004). “Trickle: A self-regulating algorithm for code propagation and maintenance in wireless sensor networks.” USENIX NSDI, 15-28.

  4. Fasolo, E., et al. (2007). “In-network aggregation techniques for wireless sensor networks: A survey.” IEEE Wireless Communications, 14(2), 70-87.

  5. Gnawali, O., et al. (2009). “Collection tree protocol.” ACM SenSys, 1-14.