26  WSN Routing & Monitoring

In 60 Seconds

WSN routing protocol selection follows a decision tree: use LEACH for periodic reporting with 100+ nodes (8x lifetime gain), Directed Diffusion for query-driven applications needing named data, AODV for mobile nodes requiring on-demand paths, and GPSR when node positions are known via GPS. Health monitoring dashboards must track three critical metrics in real-time: battery levels (alert at 20%), packet delivery ratio (alert below 90%), and end-to-end latency (alert above 2x baseline). Heartbeat intervals of 30-60 seconds balance failure detection speed against energy overhead.

26.1 Learning Objectives

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

  • Select Routing Protocols: Choose appropriate routing algorithms (LEACH, PEGASIS, SPIN, Directed Diffusion, AODV) based on network characteristics
  • Apply Decision Frameworks: Use structured decision trees to match protocols to deployment requirements
  • Design Monitoring Systems: Implement health dashboards tracking battery levels, packet delivery, and latency
  • Configure Failure Detection: Set up heartbeat monitoring and automatic recovery mechanisms for network resilience

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.

26.2 Prerequisites

Before diving into routing and monitoring, you should be familiar with:

Minimum Viable Understanding (MVU)

If you only learn three things from this chapter:

  1. Match protocol to deployment – LEACH for static clustered networks, PEGASIS for linear layouts (pipelines), SPIN for event-driven, Directed Diffusion for queries, AODV for mobile nodes
  2. Monitor five KPIs – battery level (>30%), packet delivery (>95%), latency (<1s), coverage (>98%), and network lifetime to detect problems before they cascade
  3. Three missed heartbeats triggers failure response – this threshold balances fast detection against false positives from normal packet loss, enabling automatic route repair and cluster head re-election

Sammy the Sensor has a message to deliver but there are many possible paths. Which one should he pick?

Lila the Listener explains with a school analogy: “Imagine passing a note in class. Different situations need different strategies:”

  • LEACH (Team Captains): “The class is split into groups. Each group picks a captain who collects everyone’s notes and brings ONE combined note to the teacher. Captains rotate so nobody gets too tired!”
  • PEGASIS (Chain of Friends): “Everyone sits in a line. You pass your note to the person next to you, who passes it along. Perfect when desks are in a row!”
  • AODV (Moving Students): “Students walk around the room! Before passing a note, you shout ‘WHO CAN REACH SARAH?’ and someone nearby says ‘I can!’ Great when people keep moving.”

Max the Messenger adds: “And we need a health check! Like a teacher taking attendance every minute. If someone doesn’t answer THREE times in a row, we know they might be absent (or their battery died).”

Bella the Battery says: “Picking the right strategy can mean the difference between my energy lasting 6 months versus 2 years!”

26.3 Routing Protocol Selection

⏱️ ~8 min | ⭐⭐ Intermediate | 📋 P05.C32.U05

Key Concepts

  • Routing Protocol: Algorithm determining the path a packet takes through the multi-hop WSN to reach the sink
  • Convergecast: N-to-1 routing pattern where all sensor data flows toward a single sink along a tree structure
  • Routing Table: Per-node data structure mapping destination addresses to next-hop neighbors
  • Energy-Aware Routing: Protocol selecting paths based on node residual energy to balance consumption and maximize lifetime
  • Link Quality Indicator (LQI): Metric quantifying the reliability of a wireless link — higher LQI means more reliable packet delivery
  • Routing Tree: Spanning tree structure rooted at the sink used by hierarchical routing protocols
  • Multi-path Routing: Maintaining multiple disjoint paths to improve reliability and enable load balancing

26.3.1 Protocol Comparison

Different WSN routing protocols optimize for different deployment scenarios:

Protocol Type Energy Efficiency Scalability Best For
LEACH Hierarchical High Medium Static networks
PEGASIS Chain Very High Low Linear deployments
SPIN Flat Medium High Event-driven
Directed Diffusion Data-centric High High Query-response
AODV Reactive Low High Mobile networks

Protocol Details:

How it works: Nodes self-organize into clusters with rotating cluster heads that aggregate data before transmitting to the base station.

Strengths:

  • Distributes energy load through cluster head rotation
  • Data aggregation reduces transmission count
  • Simple distributed algorithm

Weaknesses:

  • Assumes uniform node distribution
  • Single-hop from nodes to cluster head
  • Random cluster head selection can be suboptimal

Best for: Dense, static deployments with uniform distribution (environmental monitoring, smart agriculture)

How it works: Nodes form a chain where each node transmits only to its nearest neighbor. One node per round becomes the leader and transmits to the base station.

Strengths:

  • Minimizes transmission distance
  • Very energy-efficient for linear deployments
  • Simple neighbor-to-neighbor communication

Weaknesses:

  • Chain construction overhead
  • Single point of failure if chain breaks
  • High latency for large chains

Best for: Linear deployments (pipeline monitoring, highway sensors, perimeter security)

How it works: Nodes use negotiation to eliminate redundant data transmission. ADV (advertisement), REQ (request), and DATA messages coordinate transfers.

Strengths:

  • Avoids duplicate data transmission
  • Works well for event-driven data
  • No topology constraints

Weaknesses:

  • Higher control message overhead
  • No guarantee of data delivery
  • Doesn’t consider remaining energy

Best for: Event-driven applications where data redundancy is common (intrusion detection, fire monitoring)

How it works: Base station floods “interests” (queries) into the network. Data matching interests flows back along reinforced gradient paths.

Strengths:

  • Data-centric naming (query what you want)
  • In-network aggregation
  • Path repair through gradient refresh

Weaknesses:

  • Interest flooding overhead
  • Not suitable for continuous monitoring
  • Complex state maintenance

Best for: Query-response applications (find specific events, location-based queries)

How it works: Routes discovered only when needed through RREQ/RREP flooding. Routes maintained until broken or expired.

Strengths:

  • Works with mobile nodes
  • No periodic routing updates
  • Adapts to topology changes

Weaknesses:

  • Route discovery delay
  • High overhead in high-mobility scenarios
  • Not optimized for energy

Best for: Mobile sensor networks, vehicular networks, scenarios with frequent topology changes

26.3.2 Protocol Selection Guide

Use the interactive selector below to identify the recommended protocol for your scenario:

26.3.3 Routing Decision Matrix

Use this decision tree to select the appropriate protocol:

Routing protocol decision tree flowchart. Root question: Is the network mobile? Yes branch leads to AODV for on-demand route discovery. No branch asks: Is the topology linear? Yes leads to PEGASIS chain routing. No branch asks: Is traffic event-driven or query-based? Event-driven leads to SPIN negotiation routing. Query-based leads to Directed Diffusion. Remaining periodic-reporting static networks route to LEACH for hierarchical clustering. Each leaf node includes the protocol name, best-for use case, and key energy efficiency characteristic.
Figure 26.1: Routing protocol decision tree based on network mobility, density, and topology requirements

Quick Selection Guide:

Deployment Scenario Recommended Protocol Reasoning
Environmental monitoring (100+ static sensors) LEACH Clustering handles scale, rotation balances energy
Pipeline monitoring (linear sensors) PEGASIS Chain topology matches physical layout
Wildlife tracking (mobile sensors) AODV Handles mobility and topology changes
Intrusion detection (event-based) SPIN Negotiation prevents redundant alerts
Target tracking queries Directed Diffusion Query-response matches application pattern

26.4 Network Monitoring Implementation

⏱️ ~8 min | ⭐⭐ Intermediate | 📋 P05.C32.U06

26.4.1 Health Metrics Dashboard

A WSN monitoring system tracks key performance indicators:

WSN health monitoring system architecture diagram. Data collection layer: nodes send heartbeat messages every 60 seconds containing battery voltage, RSSI, packet counts, and uptime. Analytics layer: time-series database stores all metrics; threshold engine compares values against KPI targets (battery greater than 30%, PDR greater than 95%, latency less than 1 second, coverage greater than 98%). Alert layer: three severity levels shown - INFO for metrics approaching thresholds, WARNING for threshold breaches, CRITICAL for complete node failure. Action layer: recommended responses including battery replacement scheduling, route diagnostics, relay node deployment, and automatic cluster head re-election.
Figure 26.2: WSN monitoring system with metric collection, analytics, alerts, and recommended actions

26.4.2 Key Performance Indicators

Metric Target Critical Threshold Action
Battery Level >30% <10% Replace node
Packet Delivery >95% <80% Diagnose link
End-to-End Latency <1 sec >5 sec Add relay
Coverage >98% <90% Deploy more nodes
Network Lifetime Maximize - Optimize duty cycle

Metric Collection Strategy:

HEARTBEAT MESSAGE STRUCTURE
═══════════════════════════════════════

Message Type: HEARTBEAT (0x01)
Frequency: Every 60 seconds
Size: 16 bytes

Fields:
├── Node ID (2 bytes)
├── Sequence Number (2 bytes)
├── Battery Voltage (2 bytes, mV)
├── Temperature (2 bytes, 0.1°C)
├── Packets Sent (2 bytes, since last HB)
├── Packets Received (2 bytes, since last HB)
├── RSSI to Parent (1 byte, dBm)
├── Hop Count to Gateway (1 byte)
└── Uptime (2 bytes, minutes)

Overhead: 16 bytes × 1440/day = 23 KB/day per node

Heartbeat Monitoring Energy Cost vs Failure Detection Speed: Compare three heartbeat intervals for a 100-node WSN with 2000 mAh batteries:

30-second heartbeat (fast detection):

  • Messages per day: \(\frac{86{,}400}{30} = 2{,}880\)
  • Overhead: \(2{,}880 \times 16 \text{ bytes} = 46 \text{ KB/day/node}\)
  • TX energy: \(46{,}000 \times 8 \times 50 \text{ µJ/bit} = 18.4 \text{ mJ/day}\)
  • Detection latency: 90 seconds (3 missed heartbeats)

60-second heartbeat (balanced):

  • Messages per day: \(1{,}440\)
  • Overhead: \(23 \text{ KB/day/node}\)
  • TX energy: \(9.2 \text{ mJ/day}\)
  • Detection latency: 180 seconds

300-second heartbeat (slow detection):

  • Messages per day: \(288\)
  • Overhead: \(4.6 \text{ KB/day/node}\)
  • TX energy: \(1.84 \text{ mJ/day}\)
  • Detection latency: 900 seconds (15 minutes)

For a 2-year deployment (730 days), 30-second heartbeats consume \(18.4 \times 730 = 13{,}432 \text{ mJ} = 1.1\%\) of 2000mAh battery capacity just for health monitoring. 60-second interval is the sweet spot: only 0.56% battery cost with 3-minute failure detection, acceptable for most applications.

26.4.3 Failure Detection and Recovery

Common detection methods:

  1. Heartbeat timeouts - a node stops sending periodic beacons.
  2. Path quality degradation - sharply increased loss or latency.
  3. Coverage gaps - regions where no recent readings are received.
  4. Battery alarms - nodes reporting critically low battery.

Detection Algorithm:

FAILURE DETECTION ALGORITHM
═══════════════════════════════════════

For each node n:
  last_heartbeat[n] = timestamp of last received heartbeat
  missed_count[n] = consecutive missed heartbeats

Every heartbeat_interval:
  For each node n:
    If time_now - last_heartbeat[n] > heartbeat_interval:
      missed_count[n] += 1
    Else:
      missed_count[n] = 0

    If missed_count[n] >= 3:
      mark_node_failed(n)
      notify_operator(n, "Node unresponsive")
      initiate_route_repair(n)

Automatic Recovery Responses:

Failure type Automatic response Manual escalation
Single node Route around the failed node; mark for maintenance After 24 hours
Cluster head Re-elect a new cluster head in that region If re-election fails
Gateway Switch to a backup gateway if available Immediate if no backup
Regional outage Raise alert for investigation Immediate

Recovery Workflow:

Failure recovery workflow diagram showing three concurrent recovery tracks. Single node failure track: system routes around the failed node automatically within 3 minutes, marks it for scheduled maintenance, and escalates to manual replacement if still unresponsive after 24 hours. Cluster head failure track: surviving nodes in the cluster initiate a new LEACH election within 5 minutes, promotes the node with highest remaining energy as temporary CH, escalates if election fails. Gateway failure track: traffic switches to backup gateway immediately if available, otherwise operator is paged for immediate response. All three tracks converge at a network health verification step before closing the incident.
Figure 26.3: Failure recovery workflow with automatic route repair and escalation

26.5 Knowledge Check

26.6 Academic Resources: WSN in Smart Grid Applications

The following academic resources from NPTEL (IIT Kharagpur) illustrate real-world WSN implementations in smart grid infrastructure, demonstrating how wireless sensor networks enable intelligent power distribution and energy management.

Smart grid wireless sensor network architecture diagram showing the hierarchical network structure with Home Area Network (HAN) containing home appliances and smart meters, Neighborhood Area Network (NAN) with gateway nodes connecting multiple homes, Data Aggregator Unit (DAU) with metering data buffer, Wide Area Network (WAN) for power transmission and distribution with communication towers, Sensor and Actuator Network (SANET) monitoring power generation including solar and wind renewable sources, and central Meter Data Management System (MDMS) for power management - illustrating multi-tier WSN deployment in smart grid infrastructure

Smart Grid WSN Architecture showing Neighborhood Area Network (NAN), Home Area Network (HAN), Wide Area Network (WAN), and Sensor/Actuator Network (SANET) integration

Source: NPTEL Internet of Things Course, IIT Kharagpur

This diagram illustrates the hierarchical WSN architecture used in smart grids:

  • HAN (Home Area Network): Connects smart meters and home appliances
  • NAN (Neighborhood Area Network): Aggregates data from multiple homes via gateway nodes
  • WAN (Wide Area Network): Backbone connecting neighborhoods to utility control centers
  • SANET: Sensor/actuator networks monitoring power generation assets

Smart grid conceptual model diagram showing seven interconnected domains with bidirectional communication and electrical flows - Operations control center at top, Markets and Service Provider on sides, Customer domain with buildings and homes, Distribution network, Transmission infrastructure with power lines, and Generation including traditional power plants and renewable sources like wind and solar - demonstrating the cyber-physical system nature of smart grids where WSN enables monitoring and control across all domains

Smart Grid Conceptual Model showing interconnected domains: Operations, Markets, Service Provider, Customer, Distribution, Generation, and Transmission

Source: NPTEL Internet of Things Course, IIT Kharagpur

This conceptual model shows how WSN enables communication across all smart grid domains:

  • Secure Communication Flows (blue lines): Data exchange between domains
  • Electrical Flows (orange lines): Power distribution paths
  • Domain Integration: Operations, Markets, Service Provider, Customer, Distribution, Generation, and Transmission all connected through sensor networks

Wireless sensor network mesh deployment for smart grid showing multiple residential homes (orange/yellow icons) connected via wireless links (white lines) in a mesh topology across a green landscape, with a central power substation (yellow building with smokestacks) serving as the data aggregation point - demonstrating how mesh networking provides redundant communication paths for reliable smart meter data collection and grid monitoring in neighborhood-scale deployments

Wireless sensor network mesh topology for smart grid monitoring showing distributed sensor nodes across residential and industrial areas

Source: NPTEL Internet of Things Course, IIT Kharagpur

This illustration shows practical WSN mesh deployment:

  • Mesh Connectivity: Each node connects to multiple neighbors for redundancy
  • Central Aggregation: Substation serves as gateway to utility network
  • Coverage Pattern: Distributed sensor placement across service area

Micro-grid architecture diagram showing dual infrastructure with Cloud Energy Storage and Cloud Data Storage at top connecting to hierarchical power system - Substation level connected to Micro-grid level connected to Customer level with local Storage, PHEV (plug-in hybrid electric vehicle), and Solar generation - solid arrows indicate power line flows while dashed arrows indicate communication line flows for sensor data and control commands - illustrating how WSN enables bidirectional energy management in distributed generation scenarios

Micro-grid WSN architecture showing power and communication flows between cloud storage, substation, micro-grid, and customer endpoints

Source: NPTEL Internet of Things Course, IIT Kharagpur

This diagram demonstrates WSN-enabled micro-grid management:

  • Power Lines (solid arrows): Bidirectional energy flow
  • Communication Lines (dashed arrows): WSN sensor data and control signals
  • Customer Integration: Local storage, electric vehicles, and solar generation monitored via sensors
  • Cloud Integration: Both energy and data storage in cloud infrastructure

Scenario: Select routing protocol for 50-node natural gas pipeline monitoring system. Sensors detect leaks, corrosion, and pressure anomalies along 5 km pipeline.

Requirements:

  • Topology: Linear (sensors spaced 100m along pipeline)
  • Data: 32-byte readings every 60 seconds per node
  • Alert latency: <5 seconds for leak detection
  • Network lifetime: 3 years on batteries
  • Environment: Rural, no GPS

Protocol Options Analysis:

Option A: LEACH (Hierarchical Clustering)

  • Cluster formation: Problematic for linear topology (clusters would be unbalanced)
  • Energy: Rotation distributes load well
  • Latency: 2-3 hop average to cluster head, then to base station = 1-2 seconds
  • Suitability: Poor - designed for random 2D deployment, not linear

Option B: PEGASIS (Chain-Based)

  • Topology match: Perfect - designed for linear sensor arrangements
  • Energy calculation:
    • Each node transmits to nearest neighbor (100m) instead of base station (up to 2.5 km)
    • Power scales with distance²: (100m)² / (2500m)² = 1/625 = 0.16% transmission power
    • One designated “leader” per round transmits chain aggregate to base station
  • Latency: Chain traversal = 50 nodes × 20ms = 1 second + 50ms to base = 1.05 seconds
  • Lifetime calculation:
    • Without PEGASIS (each of 50 nodes transmits 2,500m directly): power ∝ (2,500)^2 relative to (100m)^2 = 625× more TX power → impractical battery life
    • With PEGASIS (each node transmits 100m to neighbor): one leader per round pays the 2,500m cost
    • Average TX current per node: (49 nodes × short TX @ 5 mA + 1 leader × long TX @ 28 mA) / 50 = (245 + 28) / 50 = 5.46 mA active average
    • With 98% sleep duty cycle: I_avg = 0.02 × 5.46 mA + 0.98 × 0.001 mA = 0.110 mA
    • Battery: 2,500 mAh / 0.110 mA = 22,727 hours = 2.6 years (exceeds 3-year target with solar assist)

Option C: AODV (On-Demand Routing)

  • Route discovery overhead: High for periodic reporting
  • Mobility support: Unnecessary (sensors are static)
  • Suitability: Poor - designed for mobile ad-hoc networks

Option D: Directed Diffusion (Data-Centric)

  • Interest flooding: Base station sends “query for leaks”
  • Gradient establishment: Data flows back along gradients
  • Energy: Moderate (interest propagation overhead)
  • Latency: Good for event-driven (leak alerts)
  • Suitability: Moderate - works but more complex than needed

Decision Matrix:

Protocol Energy Efficiency Latency Topology Fit Complexity Score
LEACH Medium (6/10) Medium (6/10) Poor (3/10) Low (8/10) 5.75/10
PEGASIS Excellent (10/10) Good (8/10) Perfect (10/10) Low (8/10) 9.0/10
AODV Poor (3/10) Good (8/10) Medium (5/10) High (4/10) 5.0/10
Directed Diffusion Good (7/10) Excellent (9/10) Good (7/10) High (4/10) 6.75/10

Recommendation: Deploy PEGASIS chain-based routing. Sensor arrangement perfectly matches linear topology, achieving 19-year battery life (exceeds 3-year target) and 1.05-second latency (exceeds <5-second requirement).

Application Characteristics Primary Protocol Backup Option Rationale
Static, clustered, >100 nodes LEACH HEED (energy-aware CH) Rotation balances energy, scales to hundreds
Linear deployment (pipeline, road) PEGASIS Chain-based custom Minimizes transmission distance
Event-driven, query-response Directed Diffusion SPIN (negotiation) Interest-based avoids unnecessary data
Mobile nodes (vehicles, animals) AODV DSR (source routing) On-demand handles topology changes
Geographic coordinates available GPSR GeRaF (geographic relay) Greedy forwarding toward sink location
Small network (<30 nodes, single hop) Direct to gateway Simple flooding Routing overhead unnecessary
Multi-sink aggregation TAG (Tiny AGgregation) Directed Diffusion Aggregation trees optimize for queries

Selection flowchart:

  1. Network size: <30 nodes → Direct transmission; 30-100 → LEACH; >100 → Hierarchical
  2. Topology: Linear → PEGASIS; Clustered → LEACH; Geographic data → GPSR
  3. Traffic: Periodic reporting → LEACH/PEGASIS; Event-driven → Directed Diffusion; Mobile → AODV
  4. Data pattern: Aggregate queries → TAG; Point-to-point → GPSR; Broadcast → Flooding

Energy ranking (lowest to highest consumption): 1. PEGASIS (chain, single long-range TX per round) 2. LEACH (clustering, cluster heads relay) 3. Directed Diffusion (gradient setup overhead) 4. GPSR (geographic routing, moderate overhead) 5. AODV (route discovery floods network)

Latency ranking (lowest to highest): 1. Direct to gateway (single hop) 2. GPSR (greedy forwarding, shortest path) 3. Directed Diffusion (pre-established gradients) 4. LEACH (2-3 hops through cluster head) 5. PEGASIS (chain traversal, N/2 hops average)

Common Mistake: Using Mesh Protocols for Static WSN

Misconception: “Mesh networking with full AODV routing provides maximum reliability for WSN.”

Reality: Mesh routing protocols (AODV, DSR) designed for mobile ad-hoc networks waste enormous energy on route discovery and maintenance in static sensor networks.

Quantified cost: 100-node environmental monitoring network - AODV overhead: Route Request (RREQ) floods network every route timeout (default 3-5 minutes) - 100 nodes × 24-byte RREQ × 20 broadcasts/hour = 48,000 bytes/hour routing overhead - Transmission cost: 48 KB × 50 nJ/bit = 19.2 mJ/hour = 461 mJ/day - Per-node impact: 4.61 mJ/day per node - LEACH overhead: Cluster advertisement once per round (10 minutes) - 10 cluster heads × 16-byte ADV = 160 bytes/round = 960 bytes/hour - Transmission cost: 960 bytes × 50 nJ/bit = 0.38 mJ/hour = 9.2 mJ/day - AODV overhead is 50× higher than LEACH

Battery impact over 2 years:

  • AODV: 461 mJ/day × 730 days = 336 J
  • LEACH: 9.2 mJ/day × 730 days = 6.7 J
  • AODV wastes 330 J per node – equivalent to 3,300 data transmissions

When to use mesh protocols:

  • ✓ Mobile nodes (tracking animals, vehicles)
  • ✓ Dynamic topology (nodes added/removed frequently)
  • ✓ Unpredictable link quality (urban RF interference)
  • ✗ Static environmental monitoring
  • ✗ Predictable sensor placement
  • ✗ Energy-critical applications

Better alternatives for static WSN:

  1. Fixed routing trees: Compute optimal routes once at deployment, store in nodes
  2. Geographic routing: If GPS available, greedily forward toward sink coordinates
  3. Hierarchical protocols: LEACH, HEED with pre-computed cluster assignments

Rule of thumb: Reserve mesh routing for scenarios with genuine mobility or unpredictability. For static deployments, routing overhead is pure waste – pre-compute paths and use simpler protocols.

26.7 Concept Relationships

Understanding how routing and monitoring concepts interconnect:

Concept Builds On Enables Conflicts With Complements
LEACH Protocol Cluster topology, randomized CH selection Distributed energy balancing Linear deployments TDMA scheduling
PEGASIS Protocol Chain formation, nearest-neighbor Minimal transmission distance 2D clustered networks Linear sensor arrays
Directed Diffusion Named data, gradient establishment Query-response applications Continuous monitoring In-network aggregation
AODV Routing On-demand route discovery Mobile node support Static topology efficiency Reactive applications
Heartbeat Monitoring Periodic status messages Failure detection Battery constraints Automated recovery
PDR Metric Packet sequence numbers Link quality assessment Lossy channels Routing decisions
Route Repair Failure detection, alternate paths Network resilience Fixed routing Dynamic topology

26.8 How It Works: PEGASIS Chain-Based Routing

PEGASIS (Power-Efficient GAthering in Sensor Information Systems) minimizes transmission energy through chain formation. Here’s the complete mechanism:

Initialization Phase (One-Time Setup):

Step 1: Greedy Chain Construction

  • Assume base station (BS) knows all node positions (GPS or deployment map)
  • Start with farthest node from BS (call it node_1)
  • Find nearest unvisited node to node_1 (call it node_2)
  • Add node_2 to chain, set as current node
  • Repeat: Find nearest unvisited node to current node
  • Continue until all nodes in chain
  • Result: Linear chain where each node has exactly 2 neighbors (except endpoints)

Step 2: Leader Designation

  • Nodes take turns being “leader” (rotates each round)
  • Leader round_i = node(i mod N), where N = total nodes
  • Leader is responsible for final transmission to BS

Data Collection Phase (Every Round):

Step 3: Token Passing Algorithm

  • Leader generates TOKEN and sends to endpoint of chain
  • Token travels along chain, collecting data:
    1. Node receives TOKEN from neighbor
    2. Node aggregates own data with TOKEN data
    3. Node forwards TOKEN to next neighbor
    4. Repeat until TOKEN reaches other endpoint
  • TOKEN at endpoint contains aggregated data from half the chain

Step 4: Reverse Direction Aggregation

  • Endpoint sends TOKEN back toward leader
  • Each node aggregates its data with TOKEN on reverse pass
  • When TOKEN reaches leader, contains complete chain aggregation

Step 5: Leader Transmission to Base Station

  • Leader transmits final aggregated packet to BS
  • Only one long-range transmission per round (vs N in direct approach)
  • Aggregation: MIN, MAX, AVG, SUM of all node readings

Energy Savings Calculation:

Direct transmission (baseline): - Each of N nodes transmits directly to BS - Average distance: d_avg meters - Energy per node: E_tx × d_avg² - Total: N × E_tx × d_avg²

PEGASIS chain: - Each node transmits to nearest neighbor: d_neighbor ≈ d_avg / N - N-1 short transmissions: (N-1) × E_tx × (d_avg/N)² - 1 leader transmission: E_tx × d_avg² - Total: (N-1) × E_tx × d_avg² / N² + E_tx × d_avg² - Simplify: E_tx × d_avg² × (1 + (N-1)/N²)

Energy ratio: PEGASIS / Direct = (1 + (N-1)/N²) / N ≈ 1/N for large N

Example (N=50 nodes):

  • Direct: 50 × E_tx × d²
  • PEGASIS: E_tx × d² × (1 + 49/2500) ≈ 1.02 × E_tx × d²
  • Savings: 49x less energy!

Why It Works:

  • Transmission power ∝ distance² (or higher)
  • Many short hops << one long hop
  • Only leader pays long-range transmission cost
  • Leader rotation distributes this burden fairly

Trade-off:

  • Latency increases: Token must traverse entire chain (N hops)
  • Acceptable for periodic reporting (e.g., every 60 seconds)
  • Not suitable for real-time alerts (use Directed Diffusion instead)

26.9 Try It Yourself: Protocol Selection Decision Tree

Objective: Build decision logic to select optimal routing protocol for different scenarios.

Decision Variables:

  • Mobility: Static / Mobile
  • Topology: Linear / Clustered / Random
  • Traffic: Periodic / Event-driven / Query-response
  • Network size: Small (<30) / Medium (30-100) / Large (>100)
  • Energy priority: Critical / Important / Moderate

Scenarios to Analyze:

Scenario 1: Smart Agriculture

  • 200 soil sensors in vineyard
  • Static positions (grid deployment)
  • Periodic readings every 15 minutes
  • Network size: Large
  • Energy: Critical (solar-powered, want perpetual operation)

Your Task: Which protocol? (LEACH / PEGASIS / AODV / Directed Diffusion / SPIN) Answer: _______ Reasoning: _______

Scenario 2: Wildlife Tracking

  • 50 GPS collars on migrating caribou
  • Mobile (animals move 5-20 km/day)
  • Periodic position reports (every 6 hours) + event alerts (predator proximity)
  • Network size: Medium
  • Energy: Important (battery replacement requires recapture)

Your Task: Which protocol? Answer: _______ Reasoning: _______

Scenario 3: Pipeline Monitoring

  • 80 pressure/corrosion sensors along 8 km natural gas pipeline
  • Static, linear deployment (100m spacing)
  • Periodic readings every 60 seconds
  • Network size: Medium
  • Energy: Critical (remote Arctic location, -40°C winters)

Your Task: Which protocol? Answer: _______ Reasoning: _______

Scenario 4: Event Detection (Intrusion)

  • 150 motion/vibration sensors in perimeter fence
  • Static positions
  • Event-driven (only transmit when motion detected)
  • Network size: Large
  • Energy: Important (battery replacement costs $50/sensor)

Your Task: Which protocol? Answer: _______ Reasoning: _______

Scenario 5: Query-Based Monitoring

  • 100 environmental sensors in smart building
  • Static positions
  • Query-response (“Which rooms have CO2 > 1000 ppm?”)
  • Network size: Medium
  • Energy: Moderate (mains power backup available)

Your Task: Which protocol? Answer: _______ Reasoning: _______

What to Observe:

  • How does mobility eliminate certain protocols?
  • Why is topology (linear vs clustered) important?
  • How does traffic pattern (periodic vs event vs query) affect choice?

Extension: Create a scoring matrix: - Assign scores (0-10) for each protocol on each criterion - Weight criteria by application priorities - Sum weighted scores to find optimal protocol

Example Matrix: | Protocol | Energy | Latency | Scalability | Mobility | Total | |———-|——–|———|————-|———-|——-| | LEACH | 8 | 6 | 7 | 2 | ? | | PEGASIS | 10 | 4 | 5 | 2 | ? | | AODV | 4 | 7 | 8 | 10 | ? |

Apply different weights for different scenarios.

26.10 See Also

WSN Implementation Series:

Routing Protocols:

Network Monitoring:

  • Network Management{target=“_blank”} - SNMP and monitoring frameworks
  • Testing and Validation - Network health verification

Smart Grid Application (Academic Context):

  • Smart grid WSN deployment examples shown in this chapter demonstrate real-world multi-tier architectures
  • See NPTEL IoT course materials for detailed case studies

Common Pitfalls

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.

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.

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.

26.11 Summary

This chapter covered WSN routing protocol selection and network monitoring:

  • Protocol Selection: LEACH for static clustered networks, PEGASIS for linear deployments, SPIN for event-driven, Directed Diffusion for queries, AODV for mobile networks
  • Decision Framework: Use structured decision trees based on mobility, density, topology, and application pattern to select appropriate protocols
  • Health Monitoring: Track battery levels (>30%), packet delivery (>95%), latency (<1s), and coverage (>98%) with automated alerts
  • Failure Detection: Heartbeat timeouts with 3-miss threshold balance quick detection against false positives
  • Automatic Recovery: Route repair, cluster head re-election, and backup gateway switching minimize manual intervention

26.12 What’s Next

Topic Chapter Description
WSN Review WSN Overview: Review Comprehensive summary of WSN concepts and review exercises
Architecture Design WSN Implementation: Architecture and Topology Multi-tier system design, LEACH clustering, and hardware selection
Deployment and Energy WSN Implementation: Deployment and Energy Coverage planning, duty cycling, and solar harvesting