IT 604(C) • Unit III

Query Processing, Data Aggregation and Node Localization

Complete RGPV exam-oriented notes covering query processing in WSN, data aggregation, localization concepts, localization challenges, range-based and range-free techniques, ranging methods and major wireless-localization algorithms.

Start Unit 3 Notes

1. Query Processing in Wireless Sensor Networks 14 Marks

Query processing in a Wireless Sensor Network is the process of accepting a user query, distributing it to relevant sensor nodes, collecting matching sensor data, processing the results and returning the required information to the user.

In a WSN, users generally do not communicate with each individual node. Instead, they issue high-level queries such as:

“Report the average temperature of Zone A every 30 seconds for the next 10 minutes.”
User Query | v Base Station / Sink | Query Dissemination | v Relevant Sensor Nodes | Sensing + Local Processing | v Aggregation / Routing | v Sink Result | v User

Characteristics

  • Data-centric operation
  • Distributed execution
  • Energy-aware processing
  • Support for continuous and event-based queries
  • In-network filtering and aggregation
  • Approximate or incomplete results may be acceptable

2. Need for Query Processing in WSN 7 Marks

  • Sensor networks generate a very large amount of raw data.
  • Transmitting every reading consumes excessive energy.
  • Users require only application-relevant information.
  • Queries help select specific regions, sensors and time intervals.
  • Local processing reduces communication overhead.
  • Aggregation removes duplicate and redundant readings.
  • Efficient query plans increase network lifetime.
Communication generally consumes more energy than simple local computation. Therefore, WSN query processing tries to process data near its source.

3. Components of a WSN Query 7 Marks

  • Target data: Temperature, pressure, humidity or other sensed value.
  • Region: Physical area or group of nodes.
  • Condition: Predicate such as temperature greater than 50°C.
  • Aggregation: Average, count, minimum, maximum or sum.
  • Sampling period: How frequently data should be measured.
  • Duration: How long the query should remain active.
  • Accuracy requirement: Desired precision or confidence.
SELECT AVG(temperature)
FROM sensors
WHERE region = 'Zone A'
SAMPLE PERIOD 30 seconds
FOR 10 minutes

4. Types of Queries in WSN 14 Marks

Snapshot Query

Requests the current value once.

Continuous Query

Remains active and produces results periodically.

Historical Query

Requests previously stored sensor data.

Event-Driven Query

Produces a result only when a specified event occurs.

Aggregate Query

Requests a summary such as average, count or maximum.

Location-Based Query

Selects nodes or data from a particular geographical region.

Top-k Query

Returns the k highest or lowest sensor readings.

Query TypeExample
SnapshotCurrent temperature of Room 101
ContinuousTemperature every 20 seconds
Event-drivenAlert when smoke level exceeds threshold
AggregateAverage humidity of the field
Top-kFive nodes with highest temperature

5. Query Processing Steps 14 Marks

  1. Query submission: User sends a query to the sink.
  2. Parsing: The system checks query syntax and meaning.
  3. Query optimization: An energy-efficient execution plan is selected.
  4. Query dissemination: Query is forwarded to relevant nodes.
  5. Sampling: Sensor nodes collect requested values.
  6. Local processing: Nodes filter or partially aggregate readings.
  7. Routing: Results travel toward the sink.
  8. Aggregation: Intermediate nodes combine data where possible.
  9. Result generation: Sink prepares the final answer.
  10. Result delivery: Information is presented to the user.
Query | Parse | Optimize | Disseminate | Sense Data | Filter / Aggregate | Route to Sink | Final Result

6. Query Optimization in WSN 14 Marks

Query optimization selects an execution strategy that minimizes energy, delay and communication cost while maintaining acceptable result quality.

Optimization Techniques

  • Predicate push-down near sensor nodes
  • Early filtering of unwanted readings
  • In-network aggregation
  • Adaptive sampling rate
  • Energy-aware routing
  • Query sharing among similar requests
  • Selection of suitable aggregation points
  • Approximate query processing
  • Suppression of unchanged values

Optimization Goals

  • Reduce transmitted packets
  • Reduce sensing operations
  • Balance energy consumption
  • Meet response-time requirements
  • Improve network lifetime

7. Data Aggregation in Wireless Sensor Networks 14 Marks

Data aggregation is the process of collecting and combining readings from multiple sensor nodes to produce a compact and meaningful result before forwarding it to the sink.
Node A: 22°C ----\ Node B: 23°C -----\ Node C: 22°C ------> Aggregator ----> Average 22.5°C Node D: 23°C -----/

Need for Aggregation

  • Nearby sensors often generate similar data.
  • Raw-data transmission wastes energy and bandwidth.
  • Aggregated information is easier to interpret.
  • Fewer packets reduce network congestion.
  • Aggregation can improve network lifetime.

Basic Operations

  • Filtering
  • Duplicate suppression
  • Summarization
  • Compression
  • Data fusion

8. Common Aggregation Functions 7 Marks

FunctionPurpose
COUNTCounts matching sensor readings or active nodes
SUMAdds all readings
AVERAGECalculates mean sensor value
MINReturns the minimum reading
MAXReturns the maximum reading
MEDIANReturns the middle value
Duplicate SuppressionRemoves repeated data
Average = Sum of Sensor Readings / Number of Readings

9. Data Aggregation Architectures 14 Marks

Tree-Based Aggregation

Nodes form a routing tree. Child nodes send data to parents, which aggregate and forward it upward.

Sink / \ A1 A2 / \ / \ N1 N2 N3 N4

Cluster-Based Aggregation

Cluster members send readings to a cluster head, which aggregates and forwards data.

Chain-Based Aggregation

Nodes form a chain, and each node combines its data with data received from a neighbor.

Grid-Based Aggregation

The sensing region is divided into grids, and selected nodes aggregate data within each grid.

Centralized Aggregation

All raw readings are sent directly to one sink for processing.

10. Data Aggregation Techniques 14 Marks

  • Temporal aggregation: Combines readings collected over time.
  • Spatial aggregation: Combines readings from nearby nodes.
  • Hierarchical aggregation: Aggregates data at multiple network levels.
  • Event-based aggregation: Combines reports related to the same event.
  • Lossless aggregation: Preserves all required information.
  • Lossy aggregation: Reduces data size while allowing controlled information loss.
  • Secure aggregation: Protects readings and aggregated results from attacks.

Advantages

  • Energy saving
  • Reduced bandwidth usage
  • Lower congestion
  • Improved scalability
  • Reduced redundant information

Limitations

  • Loss of individual readings
  • Additional processing cost
  • Delay at aggregation points
  • Aggregator failure
  • Security and trust issues

11. Challenges in Data Aggregation 14 Marks

  • Selection of aggregation points
  • Synchronization of readings
  • Accuracy and information loss
  • Dynamic network topology
  • Node and link failures
  • Aggregation delay
  • Different data formats
  • Malicious or false data
  • Privacy protection
  • Balancing computation and communication energy
  • Duplicate detection
  • Handling missing readings

12. Node Localization in Wireless Sensor Networks 14 Marks

Node localization is the process of estimating or determining the physical position of a sensor node within the deployment area.

Some nodes called anchors or beacons know their positions. Unknown sensor nodes estimate their locations using measurements or connectivity information from these anchors.

Anchor A (*) Anchor B (*) \ / \ / \ / Unknown Node (?) | | Anchor C (*)

Output

The estimated position may be represented as two-dimensional coordinates (x, y), three-dimensional coordinates (x, y, z), or a symbolic region such as “Room 4”.

13. Need and Applications of Localization 14 Marks

  • Associate sensed data with physical location.
  • Support geographic routing.
  • Track objects, vehicles, animals or people.
  • Detect and locate environmental events.
  • Improve coverage and deployment planning.
  • Support location-based queries.
  • Enable rescue and emergency applications.
  • Assist mobile robots and autonomous systems.
  • Identify failed or compromised nodes.
A fire-temperature reading becomes useful only when the system also knows where the high temperature was detected.

14. Important Localization Terminology 7 Marks

  • Anchor or beacon node: Node whose position is known.
  • Unknown node: Node whose position must be estimated.
  • Range: Estimated distance between two nodes.
  • Bearing: Estimated direction or angle toward another node.
  • Connectivity: Information about which nodes can communicate.
  • Localization error: Difference between estimated and actual position.
  • Reference point: Known position used for estimation.
Localization Error = Distance between Actual Position and Estimated Position

15. Challenges of Node Localization Technologies 14 Marks

  • Limited energy: Measurement and message exchange consume power.
  • Cost: Equipping every node with GPS is expensive.
  • Indoor operation: GPS signals may be weak or unavailable.
  • Signal variation: Obstacles, fading and interference affect measurements.
  • Clock synchronization: Time-based methods require accurate clocks.
  • Anchor placement: Poor anchor distribution reduces accuracy.
  • Scalability: Algorithms must work with many nodes.
  • Mobility: Moving nodes require repeated localization.
  • Non-line-of-sight conditions: Reflections increase distance error.
  • Security: Malicious anchors may provide false information.
  • Computational limitations: Complex algorithms may exceed node capability.
  • Three-dimensional environments: 3D localization requires more references.

16. Classification of Localization Techniques 14 Marks

Localization Techniques | +----+----+ | | Range-Based Range-Free | RSSI, ToA, TDoA, AoA Other Classifications: • Anchor-Based / Anchor-Free • Centralized / Distributed • Indoor / Outdoor • Static / Mobile • Absolute / Relative

Range-Based Localization

Uses measured distance or angle information between nodes.

Range-Free Localization

Uses connectivity, hop count or neighborhood information without direct distance measurement.

BasisRange-BasedRange-Free
MeasurementDistance or angleConnectivity or hop count
HardwareMay require additional hardwareUsually no special hardware
AccuracyGenerally higherGenerally lower
CostHigherLower
ExamplesRSSI, ToA, TDoA, AoADV-Hop, Centroid, APIT

17. Ranging Techniques for Wireless Sensor Networks 14 Marks

Ranging is the process of estimating distance or direction between sensor nodes using properties of received signals.

Main Ranging Techniques

  • Received Signal Strength Indicator
  • Time of Arrival
  • Time Difference of Arrival
  • Angle of Arrival
  • Round-Trip Time

Selection Factors

  • Required accuracy
  • Hardware cost
  • Energy consumption
  • Synchronization requirement
  • Indoor or outdoor environment
  • Line-of-sight availability

18. Received Signal Strength Indicator (RSSI) 14 Marks

RSSI estimates distance from the received radio-signal power. Signal strength generally decreases as distance increases.

Received Power decreases as Distance increases

Working

  1. A transmitter sends a radio signal.
  2. The receiver measures signal strength.
  3. A propagation model converts signal strength into distance.
  4. Distances from multiple anchors are used to estimate position.

Advantages

  • No additional ranging hardware
  • Low implementation cost
  • Available in many radio transceivers

Limitations

  • Strongly affected by obstacles and multipath.
  • Environmental changes reduce accuracy.
  • Requires calibration.

19. Time of Arrival (ToA) 14 Marks

Time of Arrival estimates distance by measuring the time taken by a signal to travel from transmitter to receiver.
Distance = Signal Propagation Speed × Travel Time

Working

  • Transmission time is known.
  • Receiver records signal-arrival time.
  • Travel time is calculated.
  • Distance is estimated using signal speed.

Advantages

  • Can provide high accuracy
  • Direct distance estimation

Limitations

  • Requires accurate clock synchronization.
  • Hardware may be costly.
  • Multipath and non-line-of-sight signals introduce error.

20. Time Difference of Arrival (TDoA) 14 Marks

TDoA estimates distance or position using the difference in arrival times of two signals having different propagation speeds, or the arrival-time difference at multiple receivers.

Common WSN Approach

A node may transmit radio and ultrasound signals at nearly the same time. Radio arrives quickly, while ultrasound arrives later. The time difference estimates distance.

Sensor Node |\ | \ Radio Signal: Fast | \________________ Receiver | \____ Ultrasound: Slow ______ Receiver Arrival-Time Difference → Distance

Advantages

  • Good ranging accuracy
  • May reduce strict transmitter-clock synchronization

Limitations

  • Requires additional hardware.
  • Ultrasound has limited range.
  • Environmental conditions affect sound speed.

21. Angle of Arrival (AoA) 14 Marks

Angle of Arrival estimates the direction from which a signal reaches a receiver.
Incoming Signal \ \ Angle θ \ [ Receiver Array ]

Working

  • An antenna or microphone array receives the signal.
  • Differences between array elements are measured.
  • The arrival angle is estimated.
  • Angles from multiple anchors determine node position.

Advantages

  • Provides directional information
  • Can locate a node using fewer anchors

Limitations

  • Requires directional antennas or arrays.
  • Hardware and processing cost are high.
  • Reflections affect accuracy.

22. Trilateration 14 Marks

Trilateration determines an unknown position using its measured distances from at least three known anchor nodes in a two-dimensional area.
Anchor A (x1,y1) Anchor B (x2,y2) ○-------------------○ \ ? / r1\ Node /r2 \ / \ / ○ Anchor C (x3,y3) r3

Basic Principle

Each anchor defines a circle whose radius equals the measured distance. The intersection of three circles estimates the unknown node position.

(x - xi)² + (y - yi)² = ri²

Requirements

  • At least three non-collinear anchors in 2D
  • At least four non-coplanar anchors in 3D
  • Reliable distance estimates

23. Triangulation 14 Marks

Triangulation determines a node's location using measured angles from known reference points.
Anchor A Anchor B ○ \ θ1 θ2 / ○ \ / \ / \ / Unknown Node

Working

  • Angles are measured from two or more anchors.
  • Lines are extended in the measured directions.
  • Their intersection estimates the unknown position.

Trilateration vs Triangulation

BasisTrilaterationTriangulation
UsesDistance measurementsAngle measurements
Typical inputRSSI, ToA or TDoA rangesAoA measurements
HardwareRanging supportDirectional array support
GeometryCircle intersectionLine or angle intersection

24. Wireless Localization Algorithms 14 Marks

Range-Based Algorithms

  • Trilateration
  • Multilateration
  • Triangulation
  • Maximum-likelihood estimation

Range-Free Algorithms

  • Centroid localization
  • DV-Hop
  • APIT
  • Hop-based and connectivity-based methods

Centralized Algorithms

Nodes send measurements to a central sink that calculates positions.

Distributed Algorithms

Sensor nodes estimate positions locally or cooperatively.

ApproachAdvantageLimitation
CentralizedCan run complex algorithmsHigh communication and central dependency
DistributedScalable and local processingLimited by node resources

25. DV-Hop Localization Algorithm 14 Marks

DV-Hop is a range-free localization algorithm that estimates distance from the number of communication hops between unknown nodes and anchors.

Steps

  1. Anchor nodes broadcast their positions and hop count.
  2. Each node stores the minimum hop count to each anchor.
  3. Anchors calculate average physical distance per hop.
  4. Average hop distance is distributed through the network.
  5. Unknown nodes estimate distance to anchors.
  6. Trilateration estimates the final position.
Estimated Distance = Minimum Hop Count × Average Distance per Hop

Advantages

  • No special ranging hardware
  • Suitable for large networks
  • Simple connectivity-based operation

Limitations

  • Lower accuracy in irregular networks
  • Error increases with non-uniform node density
  • Requires several anchors

26. Centroid Localization Algorithm 7 Marks

The centroid algorithm estimates an unknown node's position by averaging the coordinates of all anchor nodes it can hear.
Estimated x = Sum of Anchor x Coordinates / Number of Anchors
Estimated y = Sum of Anchor y Coordinates / Number of Anchors

Advantages

  • Very simple
  • No distance measurement
  • Low computation cost

Limitations

  • Accuracy depends on anchor placement.
  • Ignores actual distance from anchors.
  • Requires enough nearby anchors.

27. APIT Localization Algorithm 14 Marks

APIT stands for Approximate Point-In-Triangulation. It estimates whether an unknown node lies inside or outside triangles formed by combinations of anchor nodes.

Working

  1. Choose three anchor nodes to form a triangle.
  2. Estimate whether the unknown node lies inside the triangle.
  3. Repeat for many anchor combinations.
  4. Find the overlapping region of all positive triangles.
  5. Use the center of the overlapping area as the estimated position.
Anchor A /\ / \ / ? \ /______\ B C ? = Unknown Node inside anchor triangle

Advantages

  • Range-free operation
  • No special measurement hardware
  • Suitable for dense networks

Limitations

  • Requires many anchor nodes.
  • Accuracy depends on node density and triangle geometry.
  • Point-in-triangle estimation may contain errors.

28. Comparison of Ranging and Localization Techniques 14 Marks

TechniqueMeasurementHardware CostTypical AccuracyMain Limitation
RSSISignal strengthLowLow to moderateEnvironmental variation
ToATravel timeModerate to highHighClock synchronization
TDoAArrival-time differenceHighHighExtra hardware
AoASignal angleHighHighAntenna-array requirement
DV-HopHop countLowModerateTopology-dependent error
CentroidAnchor connectivityLowLowAnchor distribution
APITAnchor trianglesLowModerateRequires dense anchors

Unit 3 Quick Revision

  • Query processing converts a user request into distributed sensing operations.
  • Queries may be snapshot, continuous, historical, event-driven or aggregate.
  • Query optimization reduces sensing and communication cost.
  • Data aggregation combines multiple readings into a compact result.
  • Common functions are count, sum, average, minimum and maximum.
  • Aggregation may be tree-based, cluster-based, chain-based or grid-based.
  • Localization determines a sensor node's physical position.
  • Anchor nodes know their positions; unknown nodes estimate theirs.
  • Range-based methods use distance or angle measurements.
  • Range-free methods use connectivity and hop information.
  • RSSI uses received signal strength.
  • ToA uses signal travel time.
  • TDoA uses arrival-time difference.
  • AoA uses signal direction.
  • Trilateration uses distances; triangulation uses angles.
  • DV-Hop, Centroid and APIT are important range-free algorithms.

Important RGPV Exam Questions

Long Answer Questions

  1. Define query processing in WSN and explain its complete working.
  2. Explain different types of queries used in Wireless Sensor Networks.
  3. Discuss query optimization techniques for WSN.
  4. Define data aggregation and explain its need and advantages.
  5. Explain common aggregation functions and architectures.
  6. Discuss different data-aggregation techniques and challenges.
  7. Define node localization and explain its importance in WSN.
  8. Discuss the major challenges of node-localization technologies.
  9. Classify localization techniques into range-based and range-free methods.
  10. Explain RSSI-based ranging with advantages and limitations.
  11. Explain Time of Arrival and Time Difference of Arrival techniques.
  12. Explain Angle of Arrival localization.
  13. Explain trilateration with a neat diagram.
  14. Differentiate trilateration and triangulation.
  15. Explain centralized and distributed localization algorithms.
  16. Explain DV-Hop localization algorithm step by step.
  17. Explain Centroid localization algorithm.
  18. Explain APIT localization algorithm with a diagram.
  19. Compare RSSI, ToA, TDoA and AoA techniques.

Short Answer Questions

  1. Define query processing.
  2. What is a continuous query?
  3. What is an aggregate query?
  4. Define data aggregation.
  5. Name four aggregation functions.
  6. What is an anchor node?
  7. Define localization error.
  8. What is range-based localization?
  9. What is range-free localization?
  10. Define RSSI.
  11. What is ToA?
  12. What is TDoA?
  13. Define AoA.
  14. What is trilateration?
  15. What is DV-Hop?
  16. What is APIT?
Exam Tip: Query-processing steps, data-aggregation architecture, localization classification, RSSI/ToA/TDoA comparison, trilateration and DV-Hop are high-priority Unit 3 topics.

Download Study Resources

Unit 3 PDF

Printable Unit 3 notes will be available soon.

Coming Soon

Important Diagrams

Aggregation, ranging and localization diagrams.

Coming Soon

Important Questions

Expected Unit 3 RGPV questions.

Coming Soon

Frequently Asked Questions

Query processing user ki information request ko sensor nodes tak distribute karta hai, relevant data collect karta hai aur processed result sink ke through user ko deta hai.
Data aggregation duplicate aur similar readings ko combine karke packets kam karti hai, jisse energy aur bandwidth save hoti hai.
Anchor ya beacon node aisa sensor node hota hai jisko apni physical position already pata hoti hai.
Range-based techniques distance ya angle measurement use karti hain, jabki range-free techniques connectivity aur hop-count information use karti hain.
RSSI obstacles, interference, multipath aur environmental changes se strongly affect hota hai, isliye distance estimation error aa sakta hai.
Nahi. Trilateration distance measurements use karta hai, jabki triangulation angle measurements use karta hai.
DV-Hop minimum hop count ko average distance per hop se multiply karke anchors tak estimated distance calculate karta hai.