Spring 2009 L 22 Sensor Networks 2 Overview Ad hoc routing Sensor Networks Directed Diffusion Aggregation TAG Synopsis Diffusion Ad Hoc Routing Goal Communication between wireless nodes ID: 789801
Download The PPT/PDF document "15-446 Distributed Systems" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
15-446 Distributed SystemsSpring 2009
L-22 Sensor Networks
Slide22
Overview
Ad
hoc routingSensor NetworksDirected Diffusion
AggregationTAGSynopsis Diffusion
Slide3Ad Hoc Routing
Goal: Communication between wireless nodesNo external setup (self-configuring)
Often need multiple hops to reach dst
3
Slide44
Ad Hoc Routing
Create multi-hop connectivity among set of wireless, possibly moving, nodes
Mobile, wireless hosts act as forwarding nodes as well as end systemsNeed routing protocol to find multi-hop paths
Needs to be dynamic to adapt to new routes, movementInteresting challenges related to interference and power limitationsLow consumption of memory, bandwidth, powerScalable with numbers of nodesLocalized effects of link failure
Slide5Challenges and Variants
Poorly-defined “links”
Probabilistic delivery, etc. Kind of n2 links
Time-varying link characteristicsNo oracle for configuration (no ground truth configuration file of connectivity)Low bandwidth (relative to wired)
Possibly mobilePossibly power-constrained5
Slide66
Problems Using DV or LS
DV protocols may form loops
Very wasteful in wireless: bandwidth, powerLoop avoidance sometimes complexLS protocols: high storage and communication overheadMore links in wireless (e.g., clusters) - may be redundant
higher protocol overhead
Slide77
Problems Using DV or LS
Periodic updates waste power
Tx sends portion of battery power into airReception requires less power, but periodic updates prevent mobile from “sleeping”Convergence may be slower in conventional networks but must be fast in ad-hoc networks and be done without frequent updates
Slide88
Proposed Protocols
Destination-Sequenced Distance Vector (DSDV)
DV protocol, destinations advertise sequence number to avoid loops, not on demand
Temporally-Ordered Routing Algorithm (TORA)On demand creation of hbh routes based on link-reversalDynamic Source Routing (DSR)On demand source route discoveryAd Hoc On-Demand Distance Vector (AODV)Combination of DSR and DSDV: on demand route discovery with hbh routing
Slide99
DSR Concepts
Source routingNo need to maintain up-to-date info at intermediate nodes
On-demand route discoveryNo need for periodic route advertisements
Slide1010
DSR Components
Route discovery
The mechanism by which a sending node obtains a route to destinationRoute maintenanceThe mechanism by which a sending node detects that the network topology has changed and its route to destination is no longer valid
Slide1111
DSR Route Discovery
Route discovery - basic idea
Source broadcasts route-request to DestinationEach node forwards request by adding own address and re-broadcasting
Requests propagate outward until:Target is found, orA node that has a route to Destination is found
Slide1212
C Broadcasts Route Request to F
A
Source
C
G
H
Destination
F
E
D
B
Route Request
Slide1313
C Broadcasts Route Request to F
A
Source
C
G
H
Destination
F
E
D
B
Route Request
Slide1414
H Responds to Route Request
A
Source
C
G
H
Destination
F
E
D
B
G,H,F
Slide1515
C Transmits a Packet to F
A
Source
C
G
H
Destination
F
E
D
B
F
H,F
G,H,F
Slide1616
Forwarding Route Requests
A request is forwarded if:
Node is not the destinationNode not already listed in recorded source routeNode has not seen request with same sequence numberIP TTL field may be used to limit scope
Destination copies route into a Route-reply packet and sends it back to Source
Slide1717
Route Cache
All source routes learned by a node are kept in Route Cache
Reduces cost of route discoveryIf intermediate node receives RR for destination and has entry for destination in route cache, it responds to RR and does not propagate RR furtherNodes overhearing RR/RP may insert routes in cache
Slide1818
Sending Data
Check cache for route to destinationIf route exists then
If reachable in one hopSend packetElse insert routing header to destination and sendIf route does not exist, buffer packet and initiate route discovery
Slide1919
Discussion
Source routing is good for on demand routes instead of a priori distribution
Route discovery protocol used to obtain routes on demandCaching used to minimize use of discoveryPeriodic messages avoided
Slide20Overview
Ad Hoc Routing
Sensor NetworksDirected Diffusion
AggregationTAGSynopsis Diffusion
20
Slide21Smart-Dust/Motes
First introduced in late 90’s by groups at UCB/UCLA/USCPublished at Mobicom/SOSP conferencesSmall, resource limited devices
CPU, disk, power, bandwidth, etc.Simple scalar sensors – temperature, motion
Single domain of deployment (e.g. farm, battlefield, etc.) for a targeted task (find the tanks)Ad-hoc wireless network
21
Slide22Smart-Dust/Motes
HardwareUCB motes
ProgrammingTinyOSQuery processing
TinyDBDirected diffusionGeographic hash tables
Power managementMAC protocolsAdaptive topologies22
Slide23Berkeley Motes
Devices that incorporate communications, processing, sensors, and batteries into a small package Atmel microcontroller with sensors and a communication unit
RF transceiver, laser module, or a corner cube reflector Temperature, light, humidity, pressure, 3 axis magnetometers, 3 axis accelerometers
23
Slide24Berkeley Motes (Levis & Culler, ASPLOS 02)
24
Slide25Sensor Net Sample Apps
25
Traditional monitoring apparatus.
Earthquake monitoring
in shake-test sites.
Vehicle detection
: sensors along a road, collect data about passing vehicles.
Habitat Monitoring
: Storm petrels on great duck island, microclimates on James Reserve.
Slide2626
Metric: Communication
Lifetime from one pair of AA batteries
2-3 days at full power6 months at 2% duty cycle
Communication dominates cost< few mS to compute30mS to send message
Slide2727
Communication In Sensor Nets
Radio communication has high link-level losses
typically about 20% @ 5mAd-hoc neighbor discovery
Tree-based routing
AB
C
DF
E
Slide28Overview
Ad Hoc Routing
Sensor NetworksDirected Diffusion
AggregationTAGSynopsis Diffusion
28
Slide29The long term goal
29
Disaster Response
Circulatory Net
Embed
numerous distributed devices to monitor and interact with physical world: in work-spaces, hospitals, homes, vehicles, and “the environment” (water, soil, air…)
Network these devices so that they can coordinate to perform higher-level tasks.
Requires robust distributed systems of tens of thousands of devices.
Slide30Motivation
Properties of Sensor NetworksData centric, but not node centric
Have no notion of central authorityAre often resource constrained
Nodes are tied to physical locations, but:They may not know the topologyThey may fail or move arbitrarily
Problem: How can we get data from the sensors?30
Slide31Directed Diffusion
Data centric – nodes are unimportantRequest driven:Sinks place requests as interests
Sources are eventually found and satisfy interestsIntermediate nodes route data toward sinksLocalized repair and reinforcement
Multi-path delivery for multiple sources, sinks, and queries31
Slide32Motivating Example
Sensor nodes are monitoring a flat space for animalsWe are interested in receiving data for all 4-legged creatures seen in a rectangleWe want to specify the data rate
32
Slide33Interest and Event Naming
Query/interest:Type=four-legged animal
Interval=20ms (event data rate)
Duration=10 seconds (time to cache)Rect=[-100, 100, 200, 400]
Reply:Type=four-legged animalInstance = elephantLocation = [125, 220]Intensity = 0.6Confidence = 0.85
Timestamp = 01:20:40Attribute-Value pairs, no advanced naming scheme33
Slide34Diffusion (High Level)
Sinks broadcast interest to neighborsInterests are cached by neighborsGradients are set up pointing back to where interests came from at low data rateOnce a sensor receives an interest, it routes measurements along gradients
34
Slide35Illustrating Directed Diffusion
35
Sink
Source
Setting up gradients
Sink
Source
Sending data
Sink
Source
Recovering
from node failure
Sink
Source
Reinforcing
stable path
Slide36Summary
Data Centric Sensors net is queried for specific data
Source of data is irrelevant No sensor-specific query
Application Specific In-sensor processing to reduce data transmitted In-sensor caching
Localized Algorithms Maintain minimum local connectivity – save energy Achieve global objective through local coordinationIts gains due to aggregation and duplicate suppression may make it more viable than ad-hoc routing in sensor networks
36
Slide37Overview
Ad Hoc Routing
Sensor NetworksDirected Diffusion
AggregationTAGSynopsis Diffusion
37
Slide38TAG Introduction
Programming sensor nets is hard!
Declarative queries are easyTiny Aggregation (TAG): In-network processing via declarative queries
In-network processing of aggregatesCommon data analysis operationCommunication reducing
Operator dependent benefitAcross nodes during same epochExploit semantics improve efficiency!Example: Vehicle tracking application: 2 weeks for 2 studentsVehicle tracking query: took 2 minutes to write, worked just as well!
38
SELECT MAX(mag) FROM sensors WHERE mag > threshEPOCH DURATION 64ms
Slide39Basic Aggregation
In each epoch:Each node samples local sensors once
Generates partial state record (PSR)
local readings readings from children Outputs PSR during its comm. slot.
At end of epoch, PSR for whole network output at root(In paper: pipelining, grouping)39
1
2
3
4
5
Slide4040
Illustration: Aggregation
1
2
3
4
5
1
1
2
3
4
1
1
2
3
4
5
1
Sensor #
Slot #
Slot 1
SELECT COUNT(*) FROM sensors
Slide4141
Illustration: Aggregation
1
2
3
4
5
1
1
2
2
3
4
1
1
2
3
4
5
2
Sensor #
Slot #
Slot 2
SELECT COUNT(*) FROM sensors
Slide4242
Illustration: Aggregation
1
2
3
4
5
1
1
2
2
3
1
3
4
1
1
2
3
4
5
3
1
Sensor #
Slot #
Slot 3
SELECT COUNT(*) FROM sensors
Slide4343
Illustration: Aggregation
1
2
3
4
5
1
1
2
2
3
1
3
4
5
1
1
2
3
4
5
5
Sensor #
Slot #
Slot 4
SELECT COUNT(*) FROM sensors
Slide4444
Illustration: Aggregation
1
2
3
4
5
1
1
2
2
3
1
3
4
5
1
1
1
2
3
4
5
1
Sensor #
Slot #
Slot 1
SELECT COUNT(*) FROM sensors
Slide4545
Types of Aggregates
SQL supports MIN, MAX, SUM, COUNT, AVERAGE
Any function can be computed via TAG
In network benefit for many operationsE.g. Standard deviation, top/bottom N, spatial union/intersection, histograms, etc. Compactness of PSR
Slide46Taxonomy of Aggregates
TAG insight: classify aggregates according to various functional propertiesYields a general set of optimizations that can automatically be applied
46
Property
Examples
Affects
Partial State
MEDIAN : unbounded,
MAX : 1 record
Effectiveness of TAG
Duplicate Sensitivity
MIN : dup. insensitive,
AVG : dup. sensitive
Routing RedundancyExemplary vs. Summary
MAX : exemplaryCOUNT: summaryApplicability of Sampling, Effect of Loss
MonotonicCOUNT : monotonicAVG : non-monotonicHypothesis Testing, Snooping
Slide4747
Benefit of In-Network Processing
Simulation Results
2500 Nodes
50x50 GridDepth = ~10Neighbors = ~20
Some aggregates require dramatically more state!
Slide48Optimization: Channel Sharing (“Snooping”)
Insight: Shared channel enables optimizationsSuppress messages that won’t affect aggregate
E.g., MAXApplies to all exemplary, monotonic aggregates
48
Slide49Optimization: Hypothesis Testing
Insight: Guess from root can be used for suppressionE.g. ‘MIN < 50’Works for monotonic & exemplary aggregates
Also summary, if imprecision allowedHow is hypothesis computed?
Blind or statistically informed guessObservation over network subset
49
Slide50Optimization: Use Multiple Parents
For duplicate insensitive aggregatesOr aggregates that can be expressed as a linear combination of parts
Send (part of) aggregate to all parentsIn just one message, via broadcastDecreases variance
50
A
B
C
A
B
C
A
B
C
1ABC
ABC
1/21/2
Slide51Overview
Ad Hoc Routing
Sensor NetworksDirected Diffusion
AggregationTAGSynopsis Diffusion
51
Slide5252
Aggregation in Wireless Sensors
Aggregate data is often more important
1
1
3
1
1
3
7
1
2
1
10
3Count =
In-network aggregation over tree with unreliable communication
Not robust against
node- or link-failures
Used by current systems, TinyDB [Madden et al. OSDI’02] Cougar [Bonnet et al. MDM’01]10
Slide5353
Traditional Approach
Reliable communication
E.g., RMST over Directed Diffusion [Stann’03]High resource overhead3x more energy consumption3x more latency25% less channel capacity
Not suitable for resource constrained sensors
Slide5454
Exploiting Broadcast Medium
Robust multi-path
Energy-efficient
1
4715
220
23Count =
13
2
58
Double-counting
Different ordering
Challenge: order and duplicate insensitivity
(
ODI
)
10
Challenge
Slide5555
A Naïve ODI Algorithm
Goal:
count
the live sensors in the network
0
1
0
0
0
0
0
00
0100010
000000
01idBit vector
Slide5656
Synopsis Diffusion (SenSys’04)
Goal:
count
the live sensors in the network
0
1
0
0
0
0
0
00
0100010
000000
01idBit vector
0
10000BooleanOR
010010
0110000
100000
1
001001
1010010
010010
0110110
1
1Count 1 bits
4
Synopsis should be small
Approximate COUNT algorithm: logarithmic size bit vector
Challenge
Slide57Synopsis Diffusion over Rings
A node is in ring
i if it is
i hops away from the base-station
Broadcasts by nodes in ring i are received by neighbors in ring i-1
Each node transmits once = optimal energy cost (same as Tree)57
Ring 2
Slide5858
Evaluation
Approximate COUNT with Synopsis Diffusion
Scheme
Energy
Tree
41.8 mJ
Syn. Diff.
42.1 mJ
More robust than Tree
Almost as energy efficient as Tree
Per node energy
Typical
loss rates
Slide5959
Slide60Design Considerations
60
Slide61Directed Diffusion (Data)
Sensors match signature waveforms from codebook against observationsSensors match data against interest cache, compute highest event rate request from all gradients, and (re) sample events at this rate
Receiving node:
Finds matching entry in interest cache, no match – silent dropChecks and updates data cache (loop prevention, aggregation)Retrieve all gradients, and resend message, doing frequency conversion if necessasry
61
Slide62Directed Diffusion (Reinforcement)
Reinforcement:Data-driven rules unseen msg. from neighbor
resend original with smaller intervalThis neighbor, in turn, reinforces upstream nodesPassive reinforcement handling (timeout) or active (weights)
62
Slide63Approach
Energy is the bottleneck resource
And communication is a major consumer--avoid communication over long distances
Pre-configuration and global knowledge are not applicableAchieve desired global behavior through localized interactions
Empirically adapt to observed environmentLeverage pointsSmall-form-factor nodes, densely distributed to achieve Physical locality to sensed phenomenaApplication-specific, data-centric networksData processing/aggregation
inside the network63
Slide64Directed Diffusion Concepts
Application-aware communication primitives
expressed in terms of named data (not in terms of the nodes generating or requesting data)
Consumer of data initiates interest in data with certain attributes
Nodes diffuse the interest towards producers via a sequence of local interactionsThis process sets up gradients in the network which channel the delivery of dataReinforcement and negative reinforcement used to converge to efficient distribution
Intermediate nodes opportunistically fuse interests, aggregate, correlate or cache data64
Slide6565
Query Propagation
SELECT COUNT(*)…
1
2
3
4
5
Epoch
Comm. Slot
Slide6666
Synopsis Diffusion (SenSys’04)
Synopsis Diffusion: a general framework
Count
Uniform Sample
Sum (Average)
Iceberg queries
Distinct count
Top-k items
Synopsis
Diffusion
algorithms
Slide6767
Aggregation Framework
As in extensible databases, we support any aggregation function conforming to:
Agg
n={f
init, fmerge, fevaluate}
finit{a0}
<a0>Fmerge{<a
1>,<a2>} <a12
>Fevaluate{<a1>}
aggregate value(Merge associative, commutative!)Example: Average
AVG
init {v} <v,1>AVGmerge {<S1, C1>, <S2, C2>} < S1 + S2 , C1 + C2>AVGevaluate
{<S, C>} S/CPartial State Record (PSR)
Slide6868
Multiple Parents Results
Better than previous analysis expected!
Losses aren’t independent!Insight: spreads data over many links
Critical Link!
No Splitting
With Splitting