supporting aggregate queries over ad-hoc wireless sensor networks

38
Supporting Aggregate Supporting Aggregate Queries Queries Over Over Ad-Hoc Wireless Sensor Ad-Hoc Wireless Sensor Networks Networks

Upload: justin

Post on 13-Feb-2016

48 views

Category:

Documents


0 download

DESCRIPTION

Supporting Aggregate Queries Over Ad-Hoc Wireless Sensor Networks. Abstract :. This paper proposes a generic, query based scheme for extracting data from sensor networks. Main Aim of the Paper. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

Supporting Aggregate Queries Supporting Aggregate Queries OverOver

Ad-Hoc Wireless Sensor NetworksAd-Hoc Wireless Sensor Networks

Page 2: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

Abstract :Abstract :

• This paper proposes a generic, query based This paper proposes a generic, query based scheme for extracting data from sensor scheme for extracting data from sensor networks.networks.

Page 3: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

Main Aim of the PaperMain Aim of the Paper

• The main idea behind this paper is to show how The main idea behind this paper is to show how a generic query interface for data aggregation a generic query interface for data aggregation can be applied to ad-hoc networks of sensor can be applied to ad-hoc networks of sensor devices.devices.

• The authors want to emphasize the fact that this The authors want to emphasize the fact that this technique helps in querying arbitrary data in a technique helps in querying arbitrary data in a sensor network without building any custom sensor network without building any custom application. application.

• To study the generic aggregation techniques.To study the generic aggregation techniques.

Page 4: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

IntroductionIntroduction

• Advances in computing technology have led to Advances in computing technology have led to the production of wireless battery powered smart the production of wireless battery powered smart sensors.sensors.

• Due to deployment of large sensor networks a Due to deployment of large sensor networks a need arises for tools to collect & query data from need arises for tools to collect & query data from these network.these network.

Page 5: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

AggregationAggregation

• It is an important issue from the network It is an important issue from the network performance & longevity standpointperformance & longevity standpoint

• It drastically reduces the amount of data routed It drastically reduces the amount of data routed through the network .through the network .

• Increases throughput , extending life of battery Increases throughput , extending life of battery powered sensor networks.powered sensor networks.

• It provides benefits like optimizing the It provides benefits like optimizing the computation & giving programmers the ease to computation & giving programmers the ease to issue declaration SQL style queries.issue declaration SQL style queries.

Page 6: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

BackgroundBackgroundThe authors discuss the relevant design aspects of the The authors discuss the relevant design aspects of the followingfollowing

• MotesMotes• TinyOSTinyOS• Ad-hoc Sensor NetworksAd-hoc Sensor Networks• Aggregation in Database SystemsAggregation in Database Systems

The paper then summarizes aggregation in database The paper then summarizes aggregation in database systems & discusses how these techniques provide a systems & discusses how these techniques provide a useful & well defined framework for computing useful & well defined framework for computing aggregates in sensor networks.aggregates in sensor networks.

Page 7: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

MotesMotes • Configuration Configuration : Equipped with 4MHz Atmel : Equipped with 4MHz Atmel

microprocessor, microprocessor, RAM : 512 bytes , Code space : 8kB RAM : 512 bytes , Code space : 8kB ,917 MHz RFM radio running at 10 kb/s,,917 MHz RFM radio running at 10 kb/s, EEPROM : 32 EEPROM : 32 kB.kB.

• Sensor optionsSensor options : Light , Temperature, Magnetic Field, : Light , Temperature, Magnetic Field, Acceleration, Sound and Power.Acceleration, Sound and Power.

• TradeoffTradeoff : Power consumption of each sensor node is : Power consumption of each sensor node is dominated by the cost of transmitting and receiving dominated by the cost of transmitting and receiving messages.messages.

• Message delivery is unreliable by default.Message delivery is unreliable by default.

Page 8: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

A TinyOS Sensor MoteA TinyOS Sensor Mote

Page 9: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

TinyOSTinyOS

• TinyOS makes it possible to deploy TinyOS makes it possible to deploy ad-hocad-hoc networks of sensors that can locate each other & networks of sensors that can locate each other & route data without any prior knowledge of route data without any prior knowledge of network topology.network topology.

• They help in writing programs that capture & They help in writing programs that capture & process sensor data & transmit messages over process sensor data & transmit messages over the radio.the radio.

Page 10: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

Ad-hoc Sensor Ad-hoc Sensor NetworksNetworks

• Each sensor has a unique id .Sensors route data by Each sensor has a unique id .Sensors route data by adopting a technique of building a routing tree.adopting a technique of building a routing tree.

• One sensor is appointed as the root ,that interfaces the One sensor is appointed as the root ,that interfaces the querying user to the rest of the network.querying user to the rest of the network.

• The constant topology maintenance makes it easy to The constant topology maintenance makes it easy to adapt to network changes caused by mobility of certain adapt to network changes caused by mobility of certain nodes or to the addition or deletion of sensors.nodes or to the addition or deletion of sensors.

Page 11: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

• The root broadcasts the message asking sensors to The root broadcasts the message asking sensors to organize into a routing tree.organize into a routing tree.

• The message contains the root id ,its level and distance The message contains the root id ,its level and distance from the root ,i.e. zero.from the root ,i.e. zero.

• Sender of message is chosen by the sensors as its Sender of message is chosen by the sensors as its parent through which it will route messages to the root.parent through which it will route messages to the root.

• The application helps to efficiently route data towards the The application helps to efficiently route data towards the root.root.

• This application doesn’t address point-to-point routing.This application doesn’t address point-to-point routing.

Page 12: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

Aggregation in Database SystemsAggregation in Database Systems

• Its defined by an aggregate function & a grouping Its defined by an aggregate function & a grouping predicate in SQL – based database systems.predicate in SQL – based database systems.

• Aggregate Function Aggregate Function :- :- It specifies how a set of values should be combined to It specifies how a set of values should be combined to compute an aggregate .Eg: COUNT ,MIN,MAX , compute an aggregate .Eg: COUNT ,MIN,MAX , AVERAGE , and SUMAVERAGE , and SUM

• SELECT AVERAGE (temp) FROM sensorsSELECT AVERAGE (temp) FROM sensors

Page 13: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

• Most database systems allow Most database systems allow user – defined functions user – defined functions (UDFs) , that specify more complex aggregates .(UDFs) , that specify more complex aggregates .

• Grouping Predicate Grouping Predicate :- :- It partitions values into groups based on certain It partitions values into groups based on certain attributes.attributes.

• Eg : Eg : SELECT TRUNC (temp/10) , AVERAGE (light)SELECT TRUNC (temp/10) , AVERAGE (light)FROM sensorsFROM sensorsGROUP BY TRUNC (temp/10)GROUP BY TRUNC (temp/10)HAVING AVERAGE (light) > 50HAVING AVERAGE (light) > 50

• The above query partitions the sensor readings into The above query partitions the sensor readings into groups by their temperatures reading and computes the groups by their temperatures reading and computes the average light within a group.average light within a group.

Page 14: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

Generic Aggregation TechniquesGeneric Aggregation Techniques• An implementation of sensor network aggregation would An implementation of sensor network aggregation would

be to use a centralized ,server based approach.be to use a centralized ,server based approach.

• However focus is given to the distributed in-network However focus is given to the distributed in-network approach since it has the potential to be both lower approach since it has the potential to be both lower latency and lower power as compared to the server latency and lower power as compared to the server based approach.based approach.

• Its assumed that the entire experiment is based on the Its assumed that the entire experiment is based on the fact that the user is stationed on a desktop PC that has a fact that the user is stationed on a desktop PC that has a large memorylarge memory..

Page 15: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

Advantages of in-network approachAdvantages of in-network approach

• Consider computing an aggregate over a group of Consider computing an aggregate over a group of sensors as arranged in the following figure.sensors as arranged in the following figure.

• Dotted lines represent connections between sensorsDotted lines represent connections between sensors

• Solid lines represent the routing tree imposed on top of Solid lines represent the routing tree imposed on top of this graph to allow sensors to propagate data to the root this graph to allow sensors to propagate data to the root along a single path.along a single path.

Page 16: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks
Page 17: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

• Sensors in fig (a),are labeled with their distance from the root.Sensors in fig (a),are labeled with their distance from the root.• Summing these numbers gives 16 messages required to route all Summing these numbers gives 16 messages required to route all

aggregation information to the root.aggregation information to the root.• Each node is labeled with the number of messages required to get Each node is labeled with the number of messages required to get

data to the host PC.i.e. 16 messages are required.data to the host PC.i.e. 16 messages are required.

• Sensors in fig (b) :- sensors with no children simply transmit their Sensors in fig (b) :- sensors with no children simply transmit their readings tot heir parents.readings tot heir parents.

• One message is sent along each edge as aggregation is performed One message is sent along each edge as aggregation is performed by sensor themselves .by sensor themselves .

• Intermediate nodes combine their own readings with the readings of Intermediate nodes combine their own readings with the readings of their children via the aggregation function their children via the aggregation function f f and propagate the and propagate the partial aggregate along with any additional data required to update partial aggregate along with any additional data required to update the aggregate ,up the tree.the aggregate ,up the tree.

Page 18: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

• The amount of data transmitted in this solution depends The amount of data transmitted in this solution depends on the aggregateon the aggregate

• The focus is on class of aggregation predicates that is The focus is on class of aggregation predicates that is particularly well suites to the in-network regime.Such particularly well suites to the in-network regime.Such aggregated are denoted by an aggregate function aggregated are denoted by an aggregate function f f over the setsover the sets a a and and b. b.

f ( a f ( a U U b) = g ( f(a) , f(b) ) b) = g ( f(a) , f(b) )

• We assume that aggregate queries do not specify We assume that aggregate queries do not specify groups .groups .

Page 19: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

Injecting a QueryInjecting a Query• Computing an aggregate consists of two phases.Computing an aggregate consists of two phases.

• Propagation phase Propagation phase : in which aggregate queries are pushed : in which aggregate queries are pushed down into sensor networks.down into sensor networks.

• Aggregation phase : Aggregation phase : in which aggregate values are propagated in which aggregate values are propagated up from the children to the parents .up from the children to the parents .

• In the network discovery algorithm, leaf nodes must discover In the network discovery algorithm, leaf nodes must discover that they are leaves and propagate singular aggregates upto that they are leaves and propagate singular aggregates upto their parents.their parents.

Page 20: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

• Thus when a sensor Thus when a sensor p p receives an aggregate receives an aggregate a a ,either from ,either from another sensor or user, it transmits another sensor or user, it transmits a a & begins listening.& begins listening.

• If p has any children they will hear those children If p has any children they will hear those children retransmit retransmit a a to their children & will know it is not a to their children & will know it is not a leaf.leaf.

• At some timeAt some time t ,p t ,p has heard no children and has heard no children and concludes that it’s a leaf and transmits its current concludes that it’s a leaf and transmits its current sensor value up the routing tree.sensor value up the routing tree.

• If If p p has children they will report within time has children they will report within time t t & thus & thus computes the value of computes the value of a a applied its own value applied its own value

Page 21: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

• Choosing a short duration for Choosing a short duration for t t leads to missed reports leads to missed reports from children.from children.

• Then while injecting a query using propagation Then while injecting a query using propagation aggregate, the time interval is set to be long enough so aggregate, the time interval is set to be long enough so that the messages have time to propagate down to the that the messages have time to propagate down to the leaves and back in the routing tree .leaves and back in the routing tree .

• T = 2 * ( dT = 2 * ( dpp-d-dtreetree) * (t) * (txmit xmit + t+ tprocesssprocesss))where twhere txmitxmit is – time to send a msg is – time to send a msg

ttprocess process is time to process aggregation request.is time to process aggregation request.

• This approach is undesirable as it takes long This approach is undesirable as it takes long computation times. The major limitation of the tree based computation times. The major limitation of the tree based routing approach is that it is not suitable for peer-to-peer routing approach is that it is not suitable for peer-to-peer routing. routing.

Page 22: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

Streaming AggregatesStreaming Aggregates• Sensor networks are inherently unreliable.Sensor networks are inherently unreliable.• Individual radio transmission can failIndividual radio transmission can fail• Nodes can move Nodes can move

All this makes it difficult to guarantee that certain All this makes it difficult to guarantee that certain portion of the network was not detached during a portion of the network was not detached during a particular aggregate computation.particular aggregate computation.

• Eg : If Eg : If pp broadcasts broadcasts a a ,& its only child , ,& its only child , c c ,due to some ,due to some reason misses the message reason misses the message p p wont ever hear wont ever hear cc rebroadcast & thus entire network below rebroadcast & thus entire network below pp is excluded is excluded from aggregation computation and the end result is from aggregation computation and the end result is probably incorrect.probably incorrect.

Page 23: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

• This problem can be solved by computing double check This problem can be solved by computing double check aggregates multiple times i.e. to request the aggregate aggregates multiple times i.e. to request the aggregate be computed many times at the root of the network .be computed many times at the root of the network .

• The drawback of this technique is that it requires The drawback of this technique is that it requires retransmitting the aggregate request down the network retransmitting the aggregate request down the network multiple time ,at a significant message overhead.multiple time ,at a significant message overhead.

• The pipelined aggregate scheme was proposed which The pipelined aggregate scheme was proposed which has time divided into intervals of duration i . has time divided into intervals of duration i .

Page 24: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

Properties of Pipelined Aggregate Properties of Pipelined Aggregate • After aggregates have propagated up from leaves ,a new After aggregates have propagated up from leaves ,a new

aggregate arrives every aggregate arrives every i i seconds. seconds.• t t is total time for an aggregation request to propagate is total time for an aggregation request to propagate

down to the leaves& back to the root, but user begins to down to the leaves& back to the root, but user begins to see approximations of the aggregate after the 1see approximations of the aggregate after the 1stst interval interval has elapsed.has elapsed.

• These properties change as the sensor readings and These properties change as the sensor readings and underlying network change.underlying network change.

• Drawback of this approach s that a number of additional Drawback of this approach s that a number of additional messages are transmitted to extract the first aggregate messages are transmitted to extract the first aggregate over all sensors .over all sensors .

• This scheme will improve robustness of This scheme will improve robustness of aggregates ,throughput.aggregates ,throughput.

Page 25: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

Pipelined Computation of Aggregates

Page 26: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

Shared ChannelShared Channel• The previous algorithms have ignored the fact that The previous algorithms have ignored the fact that

sensors communicate over shared radio channelsensors communicate over shared radio channel

• Shared channel increasesShared channel increases message efficiency message efficiency . .

• It improves the It improves the number of sensorsnumber of sensors participating in any participating in any aggregate.aggregate.

• It reduces the It reduces the number of messagesnumber of messages sent, by snooping. sent, by snooping.

• The inherently broadcast nature of radio offers The inherently broadcast nature of radio offers communications redundancy which improve communications redundancy which improve reliabilityreliability

Page 27: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

• Multiple parents issueMultiple parents issue

Consider the case where sensor Consider the case where sensor s s sends count sends count c c to a single parent, expected value of transmitted count to a single parent, expected value of transmitted count is p * c & variance is c is p * c & variance is c22 * p * (1-p) * p * (1-p)

Page 28: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

Hypothesis TestingHypothesis Testing• The main drawback of the shared channel approach is The main drawback of the shared channel approach is

that it requires input from every node in the network to that it requires input from every node in the network to compute an aggregate.compute an aggregate.

• Hypothesis Testing :-Hypothesis Testing :- • When computing a MAX or MIN , a sensor can snoop When computing a MAX or MIN , a sensor can snoop

on the values its peers report & omit its own value if on the values its peers report & omit its own value if its aware that it cannot affect the final value of the its aware that it cannot affect the final value of the aggregate.aggregate.

Page 29: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

• In this approach, leaf nodes will be required to send no In this approach, leaf nodes will be required to send no message if their value is greater than the minimum message if their value is greater than the minimum observed over the top observed over the top k k levels. levels.

• If we assume sensor values to be independent and If we assume sensor values to be independent and randomly distributed ,then a particular node must randomly distributed ,then a particular node must transmit with probability 1/2transmit with probability 1/2kk which is low for even small which is low for even small values of k.values of k.

Page 30: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

Summary of TechniquesSummary of Techniques

• Pipelining aggregates enables to increase the throughput Pipelining aggregates enables to increase the throughput and to smooth over intermittent losses inherent in radio and to smooth over intermittent losses inherent in radio communication.communication.

• Snooping over radio to reduce message load , improve Snooping over radio to reduce message load , improve accuracy of aggregates .accuracy of aggregates .

• Hypothesis testing to invert problems & further reduce Hypothesis testing to invert problems & further reduce the number of messages sent.the number of messages sent.

Page 31: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

Grouping Grouping • Grouping Grouping computes aggregates over partitions of computes aggregates over partitions of

sensor readings and its basic technique is to push down sensor readings and its basic technique is to push down a set of predicates which specify group membership, ask a set of predicates which specify group membership, ask sensors to choose the group they belong to,& then as sensors to choose the group they belong to,& then as answers flow back , update the aggregate values in the answers flow back , update the aggregate values in the appropriate groups.appropriate groups.

• Each group predicate specifies a group id, a sensor Each group predicate specifies a group id, a sensor attribute and a range of sensor values .attribute and a range of sensor values .

• Groups are assumed to be disjoint & defined over the Groups are assumed to be disjoint & defined over the same attribute which may not be the attribute being same attribute which may not be the attribute being aggregated.aggregated.

Page 32: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

• When a sensor is a leaf ,and receives a message from a When a sensor is a leaf ,and receives a message from a child ,& checks the group number. child ,& checks the group number.

• If the child is in the same group as the sensor , it If the child is in the same group as the sensor , it combines the two values (of sensor). Else it stores the combines the two values (of sensor). Else it stores the value of the child’s group along with its own value for value of the child’s group along with its own value for forwarding in the next arrival.forwarding in the next arrival.

• The predicate is only sent into the network if it can The predicate is only sent into the network if it can potentially be used to reduce the number of messages potentially be used to reduce the number of messages that must be sent.that must be sent.Eg : predicate : MAX (attr) > x Eg : predicate : MAX (attr) > x

then information about groups with MAX (attr)<= x then information about groups with MAX (attr)<= x need not be transmitted up the tree.need not be transmitted up the tree.

Page 33: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

• Since the number of groups can exceed available Since the number of groups can exceed available storage on any one sensor , a way to evict groups is storage on any one sensor , a way to evict groups is needed.needed.

• Evicting partially computed groups is known as partial Evicting partially computed groups is known as partial pre-aggregation. Evicting groups with low membership is pre-aggregation. Evicting groups with low membership is likely a good policy, as they are least likely to be likely a good policy, as they are least likely to be combined with other sensor readings. combined with other sensor readings.

• Evicting groups forces information about current time Evicting groups forces information about current time interval into higher level nodes in the tree. interval into higher level nodes in the tree.

Page 34: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

In the above diagram of the standard pipelined scheme , In the above diagram of the standard pipelined scheme , aggregates are computed over values from the previous time aggregates are computed over values from the previous time interval, this presents an inconsistencyinterval, this presents an inconsistency

Page 35: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

Related WorkRelated Work• Cougar project at Cornell discusses queries over Cougar project at Cornell discusses queries over

sensor networks – sensor networks – it only considers moving selection it only considers moving selection operators onto sensors.operators onto sensors.

• USC/ISI & UCLA have contributed to the works on USC/ISI & UCLA have contributed to the works on networks within the sensor network community.networks within the sensor network community.

• An important platform on which our solution An important platform on which our solution operates is the number of papers published by the operates is the number of papers published by the TinyOS group at UC Berkeley describing the design TinyOS group at UC Berkeley describing the design of motes, TinyOS and the implementation of the of motes, TinyOS and the implementation of the networking protocols used to construct ad-hoc networking protocols used to construct ad-hoc sensor networks.sensor networks.

Page 36: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

Future WorkFuture Work

• Researchers at UC Berkeley are currently Researchers at UC Berkeley are currently working with the sensor testbed built by the working with the sensor testbed built by the TinyOS group to empirically verify algorithms TinyOS group to empirically verify algorithms presented in this paper.presented in this paper.

• There is a need for experimental & mathematical There is a need for experimental & mathematical validation of many techniques presented in this validation of many techniques presented in this paper.paper.

Page 37: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

ChallengesChallenges• The authors have not explored the tradeoffs between The authors have not explored the tradeoffs between

fully pipelined communication and techniques such as fully pipelined communication and techniques such as sending values only when sensor readings change.sending values only when sensor readings change.

• Its not clear how this approach will behave when sensors Its not clear how this approach will behave when sensors move. The routing tree construction algorithm allows move. The routing tree construction algorithm allows moving nodes to reattach, but its unclear how moving nodes to reattach, but its unclear how movements and disconnections affect the value of movements and disconnections affect the value of aggregates.aggregates.

• The problem of computing multiple simultaneous The problem of computing multiple simultaneous aggregates over a single sensor network has yet to be aggregates over a single sensor network has yet to be exploredexplored

Page 38: Supporting Aggregate Queries  Over Ad-Hoc Wireless Sensor Networks

ConclusionConclusion• Thus by applying generic aggregation operations this Thus by applying generic aggregation operations this

approach offers the ability to query arbitrary data in a approach offers the ability to query arbitrary data in a sensor network.sensor network.

• Its possible to robustly compute aggregates while Its possible to robustly compute aggregates while providing rapid and continuous updates of their value to providing rapid and continuous updates of their value to the user by pipelining the flow of data through the sensor the user by pipelining the flow of data through the sensor network.network.

• By snooping messages n the shared channel & applying By snooping messages n the shared channel & applying techniques for hypothesis testing , its possible to techniques for hypothesis testing , its possible to improve the performance . improve the performance .