Sensor Networks
Sensor Networks
Wireless Networks
Constraints and Challenges
Limited hardware:
o Storage
o Processing
o Communication
o Energy supply (battery power)
Limited support for networking:
o Peer-to-peer network
o Unreliable communication
o Dynamically changing
Limited support for software development:
o Real-time tasks that involve dynamic collaboration among
nodes
o Software architecture needs to be co-designed with the
information processing architecture
Wireless Networks
Sensor vs other ad hoc networks
Sensor networks Mobile ad hoc networks
Special communication
patterns: many-to-one, General-purpose
one-to-many, attribute- communication
based involving mobile
Static sensors in many devices
applications
Devices are often
Constraints more severe
than general ad hoc mobile
networks
Distributed collaborative
computing
Wireless Networks
Applications
Environmental monitoring
o Traffic, habitat, security
Industrial sensing and diagnostics
o Manufacturing, supply chains
Context-aware computing
o Intelligent homes
Military applications:
o Multi-target tracking
Infrastructure protection:
o Power grids
Wireless Networks
Why are Sensor Networks Special?
Wireless Networks
Advantages of networked sensing
Detection:
o Improved signal-to-noise ratio by reducing
average distance between source and sensor
Energy:
o A path with many short hops has less energy
consumption than a path with few long hops
Robustness:
o Address individual sensor node or link failures
Wireless Networks
Localization techniques
Methods that allow the nodes in a network to determine their
geographic positions
Use of current GPS systems not feasible:
o Cost
o Power consumption
o Form factor
o Do not work indoors or under dense foliage
Sensor network approach:
o A small number of nodes are equipped with GPS receivers and can
localize themselves
o Other nodes localize themselves using landmarks
Two ranging techniques:
o Received signal strength (RSS)
o Time of arrival (TOA/TDOA)
Wireless Networks
Received signal strength (RSS)
If the source signal strength and attenuation are
known, then receiver can estimate its distance
from the sender
Pr = G " Pt /d #
Wireless Networks
Time of arrival
Basic idea:
o Measure time it takes for a signal to travel from sender to receiver
o Multiply by signal propagation speed
Need sender and receiver to be synchronized, and exact time of
transmission known
Exact transmission time hard to determine
Time Difference of Arrival (TDOA)
o Measure TDOA at two receivers
o Can obtain difference in distances between the two receivers and the
sender
Signal speed not necessarily constant
o Local beacons and measurements to estimate signal speed
Apparently distance measurement to within centimeters achievable
Wireless Networks
Localization using ranging
Obtain multiple distance measurements using
multiple landmarks
Write out equations, including measurement errors
o Variables are the errors and the location coordinates
Minimize the weighted total squared error to yield
the desired estimate
[SHS01]
Wireless Networks
Focus Problems
Medium-access and power control:
o Power saving techniques integral to most sensor networks
o Possibility of greater coordination among sensor nodes to
manage channel access
Routing protocols:
o Geographic routing and localization
o Attribute-based routing
o Energy-Awareness
Synchronization protocols:
o Many MAC and application level protocols rely on
synchronization
Query and stream processing:
o Sensor network as a database
o Streams of data being generated at the nodes by their
sensors
o Need effective in-network processing and networking
support
Wireless Networks
MAC Protocols for Sensor Networks
Contention-Based:
o CSMA protocols (IEEE 802.15.4)
o Random access to avoid collisions
o IEEE 802.11 type with power saving methods
Scheduling-Based:
o Assign transmission schedules (sleep/awake patterns) to
each node
o Variants of TDMA
Hybrid schemes
Wireless Networks
IEEE 802.15.3
Two versions:
o Basic (without beacons)
o Beacon-based
Basic: CSMA-CA
Beacon-based
o Similar to PCF of 802.11
o Coordinator sends out a beacon periodically
o Superframe between consecutive beacons
Active period
Inactive period
o Active period
Contention Access Period
Contention Free Period
Wireless Networks
Proposed MAC Protocols
PAMAS [SR98]:
o Power-aware Medium-Access Protocol with Signaling
o Contention-based access
o Powers off nodes that are not receiving or forwarding
packets
o Uses a separate signaling channel
S-MAC [YHE02]:
o Contention-based access
TRAMA [ROGLA03]:
o Schedule- and contention-based access
Wave scheduling [TYD+04]:
o Schedule- and contention-based access
Wireless Networks
S-MAC
Wireless Networks
S-MAC: Sleep and Listen Schedules
Wireless Networks
S-MAC: Collision and Overhearing Avoidance
Collision avoidance:
o Within a listen phase, senders contending to send
messages to same receiver use 802.11
Overhearing avoidance:
o When a node hears an RTS or CTS packet, then it goes to
sleep
o All neighbors of a sender and the receiver sleep until the
current transmission is over
Wireless Networks
TRAMA
Wireless Networks
TRAMA: Medium Access
Wireless Networks
Wave Scheduling
Motivation:
o Trade off latency for reduced energy consumption
o Focus on static scenarios
In S-MAC and TRAMA, nodes exchange local schedules
Instead, adopt a global schedule in which data flows
along horizontal and vertical waves
Idea:
o Organize the nodes according to a grid
o Within each cell, run a leader election algorithm to
periodically elect a representative (e.g., GAF [XHE01])
o Schedule leaders wakeup times according to positions in
the grid
Wireless Networks
Wave Scheduling: A Simple Wave
Wireless Networks
Wave Scheduling: A Pipelined Wave
Wireless Networks
Wave Scheduling: Message Delivery
When an edge is scheduled:
o Both sender and receiver are awake
o Sender sends messages for the duration of the awake
phase
o If sender has no messages to send, it sends an NTS
message (Nothing-To-Send), and both nodes revert to
sleep mode
Given the global schedule, route selection is easy
o Depends on optimization measure of interest
o Minimizing total energy consumption requires use of
shortest paths
o Minimizing latency requires a (slightly) more complex
shortest-paths calculation
Wireless Networks
Routing strategies
Geographic routing
o Greedy routing
o Perimeter or face routing
o Geographic localization
Attribute-based routing:
o Directed diffusion
o Rumor routing
o Geographic hash tables
Energy-aware routing:
o Minimum-energy broadcast
o Energy-aware routing to a region
Wireless Networks
Geographic Location Service (GLS)
Use sensor nodes as location servers
Organize the space as a hierarchical grid according to a
spatial quad-tree
Each node has a unique ID (e.g., MAC address)
Location servers for a node X:
o One server per every vertex of the quad tree that is a sibling of
a vertex that contains X
o This server is the node with smallest ID larger than X in the
region represented by the quad tree vertex (with wraparound, if
necessary)
To locate a node X:
o Traverse up the quad tree repeatedly seeking the node that has
the smallest ID larger than X
[L+00]
Wireless Networks
Performance of GLS
Depth of the quad-tree = O(log n), where n is the number of
nodes in the network
Therefore, number of location servers for a given node is
O(log n)
How many nodes does a given node serve?
o If the Ids are randomly distributed, can argue that the expected
number of nodes served per node is O(log n)
o Even with high probability
If the source and destination lie in a common quad-tree tile
at level i
o At most i steps are needed to reach the location server for the
destination
o Cost of location service distance-sensitive
Wireless Networks
Attribute-based routing
Data-centric approach:
o Not interested in routing to a particular node or a
particular location
o Nodes desiring some information need to find nodes that
have that information
Attribute-value event record, and associated query
Wireless Networks
Directed diffusion
Sinks: nodes requesting information
Sources: nodes generating information
Interests: records indicating
o A desire for certain types of information
o Frequency with which information desired
Key assumption:
o Persistence of interests
Approach:
o Learn good paths between sources and sinks
o Amortize the cost of finding the paths over period of use
[IGE00]
Wireless Networks
Diffusion of interests and gradients
Wireless Networks
Rumor routing
Spread information from source and query from
sink until they meet
Source information and query both follow a one-
dimensional strategy
o Random walk
o Straight ray emanating from origin
As agents move, both data and interest are stored
at intermediate nodes
Query answered at intersection point of these two
trajectories
Multiple sources and sinks:
o Merge interest requests and data
[BE02]
Wireless Networks
Geographic hash tables (GHT)
Hash attributes to specific geographic locations in
the network
o Information records satisfying the attributes stored at
nodes near location
Every node is aware of the hash function
o Query about records satisfying a given attribute are
routed to the relevant location
Load balancing achieved by hash function
Information also stored locally where it is
generated
Can also provide replication through a hierarchical
scheme similar to GLS
[R+03]
Wireless Networks
GHT & geographic routing
Wireless Networks
Energy-aware routing
Need energy-efficient paths
Notions of energy-efficiency:
o Select path with smallest energy consumption
o Select paths so that network lifetime is maximized
When network gets disconnected
When one node dies
When area being sensed is not covered any more
Approaches:
o Combine geographic routing with energy-awareness
o Minimum-energy broadcast
Wireless Networks
Geography and energy-awareness
Recall that geographic routing is divided into two
steps:
o Planarization of the underlying transmission graph
o Routing on the planar graph using greedy and perimeter
routing
Can we obtain planar subgraphs that contain
energy-efficient paths?
o Gabriel graph and similar variants do not suffice
o Planar subgraphs based on Delaunay triangulation have
desired properties
o Unfortunately, not necessary that greedy and perimeter
routing will find such paths
Energy available at nodes dynamically changes as
different paths are used
Wireless Networks
Incorporating residual node energy
Cost for each edge has two components:
o Energy consumption for transmission
o Energy already consumed at each endpoint
o A suitable weighted combination of both
Geographic Energy-Aware Routing (GEAR)
o If neighbors exist that are closer with respect to both
distance and cost, select such a node that has smallest
cost
o Otherwise, select a node that has smallest cost
o Costs updated as energy of nodes change
[YGE01]
Wireless Networks
Minimum Energy Broadcast Routing
Wireless Networks
Minimum Energy Broadcast Routing
Energy consumed by a
broadcast over range r is
proportional to r
!
Wireless Networks
Three Greedy Heuristics
!
Wireless Networks
Lower Bound on SPT
Assume ( n ! 1) / 2 nodes
per ring
Total energy of SPT:
(n # 1)(" ! + (1 # " )! ) / 2
Optimal solution:
o Broadcast to all nodes ! 1" !
o Cost 1
Approximation ratio
!(n)
Wireless Networks
Performance of the MST Heuristic
"
Weight of an edge (u,v) equals d(u,v)
MST for these weights same as Euclidean MST
o Weight is an increasing function of distance
o Follows from correctness of Prims algorithm
Upper bound
! on total!MST weight
Lower bound on optimal broadcast tree
Wireless Networks
Weight of Euclidean MST
Dependence on "
o " < 2 : in the limit "
o " # 2 : bounded
< 12
!
! !
!
Wireless Networks
Structural Properties of MST
60 radius
Empty Disjoint
60
Wireless Networks
Upper Bound on Weight of MST
Assume " = 2
For each edge e, its diamond
accounts for an area of
! | e |2
! 2 3 60
Wireless Networks
Need for Synchronization in Sensor Networks
Localization
o Time of arrival methods require tight time
synchronization between sender and receiver or
among multiple receivers
Coordinated actuation
o Multiple sensors in a local area make a
measurement
o Determining the direction of a moving car through
measurements at multiple sensors
At the MAC level:
o Power-saving duty cycling
o TDMA scheduling
Wireless Networks
Synchronization in Distributed Systems
Wireless Networks
Network Time Protocol (NTP)
}
o Satellite, radio, modem S2 S2 S2
Secondary servers (S2,
) synchronize to primary
servers and other
secondary servers S2 S2 S2 S2
o Hierarchical subnet
S3 S3 Secondary
S3 S3 S3
http://www.ntp.org
S4
Wireless Networks
Measures of Interest
Wireless Networks
Synchronization Between Two Nodes
! (T2 # T1 ) # (T4 # T3 )
! !
"=
! 2
(T2 " T1 ) + (T4 " T3 )
T1 T4 d=
A 2
!
Wireless Networks
! !
!
Sources of Synchronization Error
Non-determinism of processing times
Send time:
o Time spent by the sender to construct packet; application
to MAC
Access time:
o Time taken for the transmitter to acquire the channel and
exchange any preamble (RTS/CTS): MAC
Transmission time: MAC to physical
Propagation time: physical
Reception time: Physical to MAC
Receive time:
o Time spent by the receiver to reconstruct the packet; MAC
to application
Wireless Networks
Sources of Synchronization Error
Sender time = send time + access time + transmission
time
o Send time variable due to software delays at the
application layer
o Access time variable due to unpredictable contention
Receiver time = receive time + reception time
o Reception time variable due to software delays at the
application layer
Propagation time dependent on sender-receiver
distance
o Absolute value is negligible when compared to other
sources of packet delay
o If node locations are known, these times can be explicitly
accounted
Wireless Networks
Error Analysis
(T2 # T1 ) # (T4 # T3 ) B
"= T2 T3
2
(T2 " T1 ) + (T4 " T3 )
d=
2 ! !
!
S A : Sender time at A
RA : Receiver time at A T1 A T4
! PA"B : Prop. time for A " B
! UC ! !
! S : SA " SB
SUC + RUC + PUC
! RUC : RB " RA Error =
2
PUC : PA"B # PB"A
! Wireless Networks
! !
Two Approaches to Synchronization
Sender-receiver:
o Classical method, initiated by the sender
o Sender synchronizes to the receiver
o Used in NTP
o Timing-sync Protocol for Sensor Networks (TPSN) [GKS03]
Receiver-based:
o Takes advantage of broadcast facility
o Two receivers synchronize with each other based on the
reception times of a reference broadcast
o Reference Broadcast Synchronization (RBS) [EGE02]
Wireless Networks
TPSN
Time stamping done at the MAC
layer
o Eliminates send, access, and 0
receive time errors
Creates a hierarchical topology
Level discovery: 1 1 1
Wireless Networks
Reference Broadcast Synchronization
Motivation:
o Receiver time errors are significantly smaller than sender
time errors
o Propagation time errors are negligible
o The wireless sensor world allows for broadcast capabilities
Main idea:
o A reference source broadcasts to multiple receivers (the
nodes that want to synchronize with one another)
o Eliminates sender time and access time errors
Wireless Networks
Reference Broadcast Synchronization
Simple form of RBS:
o A source broadcasts a
reference packet to all
receivers
o Each receiver records the
time when the packet is
received i j
o The receivers exchange
their observations
Ti : Receive time at i
"ij = T j # Ti
General form:
!
o Several executions of the !
simple form m
1
For each receiver
j
receiver i derives an
,
!
"ij =
m
$(Tkj # Tki )
k=1
estimate of "ij
Wireless Networks
! !
!
Reference Broadcast Synchronization
Clock skew:
o Averaging assumes sij equals 1 t j = ti sij + "ij
o Find the best fit line using least
squares linear regression
o Determines sij and "ij
i
! !
Pairwise synchronization in
multihop networks:
o Connect
! two
! nodes if they were
synchronized by same reference
o Can add drifts along path !
o But which path to choose?
o Assign weight equal to root-mean
square error in regression
o Select path of min-weight j
Wireless Networks
Query Processing in Sensor Networks
Wireless Networks
The Sensor Network as a Database
From the point of view of the user, the sensor network
generates data of interest to the user
Need to provide the abstraction of a database
o High-level interfaces for users to collect and process
continuous data streams
TinyDB [MFHH03], Cougar [YG03]
o Users specify queries in a declarative language (SQL-like)
through a small number of gateways
o Query flooded to the network nodes
o Responses from nodes sent to the gateway through a
routing tree, to allow in-network processing
o Especially targeted for aggregation queries
Directed diffusion [IGE00]
o Data-centric routing: Queries routed to specific nodes
based on nature of data requested
Wireless Networks
Challenges in Sensor Network Databases
A potentially highly dynamic environment
Relational tables are not static
o Append-only streams where useful reordering operations
too expensive
High cost of communication encourages in-network
processing
Limited storage implies all the data generated cannot be
stored
Sensor nodes need to determine how best to allocate its
sensing tasks so as to satisfy the queries
Data is noisy
o Range queries and probabilistic or approximate queries
more appropriate than exact queries
Wireless Networks
Classification of Queries
Long-running vs ad hoc
o Long-running: Issued once and require periodic updates
o Ad hoc: Require one-time response
Temporal:
o Historical
o Present
o Future: e.g., trigger queries
Nature of query operators
o Aggregation vs. general
Spatial vs. non-spatial
Wireless Networks
The DB View of Sensor Networks
Traditional
SensId Loc Time Type Value
Procedural addressing of
individual sensor nodes; user 1 (2,5) 3 temperature 60
DB Approach
Declarative querying and SensId Loc Time Type Value
tasking; user isolated from 2 (4,2) 3 light 55
how the network works; 2 (4,2) 5 pressure 30
in-network distributed
processing.
[TinyDB, Cougar]
Wireless Networks
Query propagation
Construct an aggregation tree
Propagate query information for epoch along the
tree
o Query vectors, frequencies, durations
The tree will be used for result propagation during
the epoch
What aggregation tree to construct?
How should a node schedule its processing,
listening, receiving and transmit periods?
o Can be done on the basis of the level in the aggregation
tree
How should we adapt the aggregation tree to
network changes?
Wireless Networks
Result propagation
Given an aggregation tree
and query workload, find
5
an energy-efficient result
propagation scheme
In-network processing 5 3
o Sensor network is power 5 3
(and bandwidth) constrained
4 2
o Local computation is much
cheaper than communication 2
3 2
4
4 3
Wireless Networks