Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

1

Sensor Networks
3
Applications
What is a sensor network used for?
Military (detection of intrusion or chemical
attack, target tracking,)
Environmental (animal tracking, marine life
monitoring, flood or fire detection,)
Building monitoring and control (video-
surveillance, school monitoring, earthquake,)
Smart house/office/vehicle
4
Embedded Networked Sensing
Potential
Micro-sensors, can
monitor phenomena
up close
Will enable spatially
and temporally
dense environmental
monitoring
Embedded
Networked Sensing
reveal previously
unobservable
phenomena
Seismic Structure
response
Contaminant
Transport
Marine
Microorganisms
Ecosystems,
Biocomplexity
2
5
App#1: Seismic
Interaction between ground motions
and structure/foundation response
not well understood.
Current seismic networks not
spatially dense enough to monitor
structure deformation in response
to ground motion, to sample
wavefield without spatial aliasing.
Science
Understand response of buildings
and underlying soil to ground
shaking
Develop models to predict
structure response for earthquake
scenarios.
6
Field Experiment
!""""""" 1 km """"""!
38 strong-motion seismometers in 17-story steel-frame Factor Building.
100 free-field seismometers in UCLA campus ground at 100-m spacing
8
App#2: Contaminant Transport
Understand intermedia
contaminant transport and
fate in real systems
Identify risky situations
before they become
exposures. Subterranean
deployment
Multiple modalities (e.g., pH,
redox conditions, etc.)
Micro sizes for some applications
(e.g., pesticide transport in plant
roots)
Tracking contaminant fronts
Soil Zone
Groundwater
Volatization
Spill
Path
A
ir E
m
issions
Dissolution
Water Well
3
9
App#3: Ecosystem Monitoring
Understand response of wild populations (plants and
animals) to habitats over time
In situ data acquisition of physical and chemical
properties, at various spatial and temporal scales,
appropriate to the ecosystem, species and habitat
Measurements over long period of time,
taken in-situ
Harsh environments with
extremes in temperature,
moisture, obstructions, ...
11
Intelligent Transportation Project
App#4:
Transportation and Urban Monitoring
12
Crossbow Mote History
$$ +
Network Embedded
Systems Technology
Program
4
13
Current Design Analysis: Mica Series
Integrate sensors, computation and
communication in single unit
Basic board has radio, processor, memory
Sandwich sensor boards in layers
Open-source hardware/software concept
Software is TinyOS (TOS) and TinyDB (TDB)
Hardware design and Intel networking technology is
licensed to Crossbow
Modular design allows fast development
16
MICAz MOTES
MOTE ID Frequency range Processor Transceiver Nonvolatile
memory
MPR2400 2400-2483.5 Atmel
ATMega128L
Chipcon
CC2420
(802.15.4)
Atmel
AT45DB04B
(512 kB)
17
Energy Consumption
MICA MOTE
Berkeley
Output Tx cost
5 m: 3 A
150 m: 3 mA
Transceiver (Tx/Rx)
5
19
Typical Network Scenario
Internet,
Satellite,
etc.
Sink
Sink
Limited
energy,
computation
and storage
capability
20
Wireless Sensor Network Protocols
Primary theme:
building long-lived,
massively-
distributed,
physically-coupled
systems
In-network: Application processing,
Aggregation, Query processing
Adaptive topology, Routing
MAC, Time, Location
Phy: comm, sensing, actuation, SP
User Queries, External Database
Data dissemination, storage, caching
MAC Solutions
6
23
Primary MAC Attributes
Collision avoidance
Basic task of a MAC protocol
Energy efficiency
One of the most important attributes for
sensor networks, since most nodes are
battery powered
Scalability and adaptivity
Network size, node density and topology
change
24
Other MAC Attributes
Channel utilization
How well is the channel used? Also called
bandwidth utilization or channel capacity
Latency
Delay from sender to receiver; single hop or
multi-hop
Throughput
The amount of data transferred from sender
to receiver in unit time
Fairness
Can nodes share the channel equally?
25
Identifying the Energy Consumers
Need to shutdown the radio
SENSORS CPU
TX RX IDLE SLEEP
RADIO
7
26
Major sources of energy waste
Useless listening
Long idle time when no sensing event happens
Collisions
Control overhead
Overhearing
Try to reduce energy consumption from all above
sources
TDMA requires slot allocation and time
synchronization
Combine benefits of TDMA + contention protocols
Energy Efficiency in MAC
Common to all
wireless networks
28
Classification of MAC Protocols
Schedule-based protocols
Schedule nodes onto different sub-
channels
Examples: TDMA, FDMA, CDMA
Contention-based protocols
Nodes compete in probabilistic
coordination
Examples: CSMA
29
Scheduled Protocols: LEACH
Low-Energy Adaptive Clustering Hierarchy
Similar to Bluetooth
CDMA between clusters
TDMA within each cluster
Static TDMA frame
Cluster head rotation
Node only talks to cluster head
Only cluster head talks to base station (long dist.)
Scalability problem
8
30
Contention-based Protocols:
S-MAC
Tradeoffs
Major components in S-MAC
Collision avoidance
Periodic listen and sleep
Overhearing avoidance
Latency
Fairness
Energy
31
Coordinated Sleeping
Problem: Idle listening consumes
significant energy
Solution: Periodic listen and sleep
Turn off radio when sleeping
Reduce duty cycle to ~ 10% (120ms on/1.2s off)
sleep listen listen sleep
Latency Energy
32
Coordinated Sleeping
Schedules can differ: each node has its own
wakeup-listen (communicate) and sleep
schedule
Schedules are shared with neighbors
Node 1
Node 2
sleep listen listen sleep
sleep listen listen sleep
9
34
Coordinated Sleeping
Preferably neighboring nodes have same
schedule
easy broadcast & low control overhead
Border nodes:
two schedules Schedule 2
Schedule 1
35
Coordinated Sleeping
Schedule Synchronization
New node tries to follow an existing schedule
Each node broadcasts its schedule every few
periods of sleeping and listening
Re-sync when receiving a schedule update
Periodic neighbor discovery
Keep awake in a full sync interval over long
periods
36
Collision Avoidance
S-MAC is based on contention
Similar to IEEE 802.11 ad hoc mode (DCF)
Physical and virtual carrier sense
Randomized backoff time
RTS/CTS for hidden terminal problem
RTS/CTS/DATA/ACK sequence
10
37
Overhearing Avoidance
Problem: Receive packets destined to others
Solution: Sleep when neighbors talk
Who should sleep?
All immediate neighbors of sender and
receiver
How long to sleep?
The duration field in each packet informs
other nodes on the sleep interval
38
Coordinated Sleeping - Optimization
Adaptive listening
Reduce multi-hop latency due to periodic sleep
Wake up for a short period of time at end of
each transmission (if it heard a CTS)
4 1 2 3
CTS
RTS
CTS
Reduce latency by at least half
listen listen listen
t1 t2
40
S-MAC Pros and Cons
Cons
Relatively Complex (especially since CSMA is
often touted as being simple)
Increased Latency
Pros
Periodic sleep provides excellent energy
performance at light loads
Adaptive listen adjusts to traffic to achieve
same performance as no-sleep at heavy load
11
41
Contention-based Protocols:
B-MAC
Another low-power MAC for sensor networks
B-MAC design considerations
Minimalistic approach: based on simple CSMA
Configurable options
Minimize idle listening
Based on model of periodic sensor data transfer
B-MAC components
CSMA without RTS/CTS
Optional Low-power Listening (LPL)
Optional ACK
42
Clear Channel Assessment (CCA)
- Before transmission perform
random backoff, then take a
sample of the channel
- If the sample is below the
current noise floor, channel is
clear, send immediately
- Else, take five samples. If no
outlier found => channel busy,
take a random backoff. Else
channel idle -> transmit
- Noise floor updated when
channel is known to be clear
e.g., right after packet
transmission
A packet arrives between 22 and 54ms.
The middle graph shows the output of a
thresholding CCA algorithm.
( 1: channel clear, 0: channel busy)
43
Low-Power Listening
Goal: minimize listen cost
Principles
Node periodically wakes up, turns radio on and
sample channel using CCA
Wakeup time fixed
Check time variable
If energy is detected, node powers up in order
to receive the packet
Node goes back to sleep
If a packet is received
After a timeout
12
44
Low-Power Listening
Determine channel status by quick sampling
(minimize stage (e))
Noise floor estimation used to detect
channel activity during LPL (same CCA
procedure described earlier)
45
Low Duty Cycle with LPL
Nodes periodically sleep and perform LPL
Nodes do not synchronize on listen time
Sender uses a long preamble before each
packet to wake up the receiver
Shift most burden to the sender:
Preamble > Checking Interval
46
Remarks
Suitable for single-hop application doing periodic
data sampling
Sampling rate (traffic pattern) defines optimal
check interval
Check interval
Too small: energy wasted on idle listening
Too large: energy wasted on transmissions
(long preambles)
In general, its better to have larger preambles
than to check more often!
13
47
Comparison of S-MAC and B-MAC
S-MAC B-MAC
Collision avoidance CSMA/CA
Modified CSMA/
CA
ACK Yes Optional
Overhearing avoidance Yes No
Listen period
Pre-defined + adaptive
listen
Pre-defined
Listen interval Long Very short
Schedule
synchronization
Required Not required
Packet transmission Short preamble Long preamble
Code size 6.3KB 4.4KB (LPL & ACK)
48
Sources of wasted energy in WSN:
Idle Listening (sensing required
for all CSMA protocols)
Overhearing
Collisions
Control Overhead (e.g., RTS/CTS
or DATA/ACK)
Hybrid Protocols:
Z-MAC
S-MAC,
B-MAC
Z-MAC
49
Diverse Data Rates Within an
Application
E.g., Target tracking and monitoring
Typically trigger multiple sensors in near vicinity
Data aggregation near targets or the sink
Some areas of the network could be highly
contentious
Sink
14
50
Medium Access Paradigms
Contention Based (CSMA)
Simple, no time synch, and robust to network changes
High control overhead (for two-hop collision avoidance)
High idle listening (due to channel sensing) and overhearing
overheads
Solve this by duty cycling
TDMA Based
Nodes within interference range transmit during different
times, so collision free
Requires time synch and not robust to changes
Low throughput and high latency even during low contention
Low idle listening and overhearing overheads
Wake up and listen only during its neighbor transmission
51 # of Contenders
Channel
Utilization
TDMA
CSMA
IDEAL
Effective Throughput
CSMA vs. TDMA
Sensitive to
Time synch.
errors,
Topology
changes,
Slot
assignment
errors.
Do not use
any topology
or time
synch. Info.
Thus, more
robust to
time synch.
errors and
changes.
52
Z-MAC: Basic Idea - Can you do the
contention resolution in Hybrid?
! Z-MAC: combines the strengths of both
CSMA and TDMA at the same time offsetting
their weaknesses
! High channel efficiency and fair (quality of
service)
MAC
Channel Utilization
CSMA
TDMA
Low Contention High Contention
High Low
Low High
15
53
Z-MAC: Basic components
Baseline - CSMA
Use Imprecise Topology and Timing
Info in a robust way
Combining CSMA with TDMA
Scalable and Efficient TDMA
scheduling
54
Main Steps
Set-up phase
Neighbor discovery
Slot assignment
Local frame exchange
Global time synchronization
Z-MAC phase
Low contention level
High Contention Level
Explicit contention notification
55
Set Up Phase-
Neighbor Discovery
Nodes periodically broadcast a ping to
their 1-hop neighbors
The ping message includes the nodes
current 1-hop neighbor list
This way each node builds its 1- and 2-hop
neighbor list (to be used in the following
phase)
16
56
Set Up Phase - Slot Assignment
Z-MAC requires a conflict-free transmission
schedule or a TDMA schedule
DRAND is adopted to ensure that no two
nodes within a 2-hop neighborhood are
assigned to the same slot
DRAND is a scalable implementation of RAND, a
famous centralized channel scheduling scheme
57
Set Up Phase - DRAND
Let G = (V, E) be an input graph, where V is the set of
nodes and E the set of edges. An edge e = (u, v) exists
if and only if u and v are within interference range
Given G, DRAND calculates a TDMA schedule in a fully
distributed manner
DRAND is scalable: its complexity depends on the 2-
hop neighborhood size (not on the network size)
Assigned slot number doesnt exceed the 2-hop
neighborhood size ($)
Running time and message complexity bounded by O
($)
58
DRAND Algorithm
C D
A
F
B
C D
A
E
B
E
F
Radio
Interference
Map
Input Graph
C D
A
E
B F
DRAND slot
assignment
0
0
1
3 2
1
17
59
DRAND
Each node can assume 4 possible states:
Idle: no action
Request: a node is requesting a slot
Grant: a grant has been sent, the node is
waiting for the procedure to end
Release: a slot assignment has ended
successfully
60
DRAND Algorithm
Successful Round
A
F
D
G
E
B
C
Request
Step I Broadcast
Request
Step II Receive
Grants
A
F
D
G
E
B
C
Grant
A
F
D
G
E
B
C
A
F
D
G
E
B
C
Two Hop
Release
Step IV Broadcast
Two Hop Release
A
F
D
G
E
B
C
Release
Step III Broadcast
Release
61
DRAND Algorithm
Unsuccessful Round
A
F
D
G
E
B
C
Request
Step I Broadcast
Request
Reject
Step II Receive Grants
from A,B,D but Reject
from E
A
F
D
G
E
B
C
Grant
A
F
D
G
E
B
C
Fail
Step III Broadcast
Fail
Grant
18
62
DRAND
64
Set Up Phase - Local Frames
! After DRAND, each node needs to decide on
frame size (i.e., how often it can use a slot for
transmission)
! Conventional wisdom Synchronize with rest of
the network on Maximum Slot Number (MSN) as
the frame size
! Disadvantage:
MSN has to be broadcast across whole network
Unused slots if 1 and 2- hop neighborhood small
65
Set Up Phase - Local Frames
! Example: A and B would have to maintain frame size
of 8, in spite of having small neighborhood.
5(5)
A
H
G
F
E
D C B
2(5) 1(2) 0(5)
4(5)
3(5)
1(5)
0(2)
Label is the assigned slot, number in
parenthesis is maximum slot number (MSN)
within two hops (starting from 0)
19
66
Set Up Phase - Local Frames
Time Frame Rule (TF rule)
Let node i be assigned to slot s
i
, according to
DRAND and MSN within 2-hop neighborhood
be F
i
, then i's time frame is set to be 2
a
,
where positive integer a is chosen to satisfy
condition
In other words, i uses the s
i
-th slot in every
2
a
time frame (i's slots are L * 2
a
+ s
i
, for all
L=0,1,2,3,...)
2
a-1
<= F
i
< 2
a
1
67
A
H
G
F
E
D C B
2(5) 1(2) 0(5)
4(5)
3(5)
1(5)
0(2)
5(5)
Unused
slots
within
frame
size are
black
Set Up Phase - Local Frames
68
Set Up Phase
Global Time Synchronization
After DRAND, every node broadcasts its
frame size and slot number to its 2-hop
neighborhood
Thus, each node knows the frame size and
slot number of its 1- and 2-hop neighbors
at the beginning of the Z-MAC phase
At this point, every node synchronizes to
slot 0 (though specific sync algorithms)
20
69
Z-MAC Transmission Control
! Slot Ownership
If current timeslot is the node's assigned time-slot,
then it is the Owner, and all other neighboring nodes are
Non-Owners
Two possible states in Z-MAC phase:
! Low Contention Level (LCL)
! High Contention Level (HCL)
! Switches between CSMA and TDMA automatically
depending on contention level
! typically in LCL, a node switches to HCL when it
receives an explicit contention notification
70
Z-MAC Transmission Control
! Low Contention Level: Nodes compete in all
slots, albeit with different priorities. Before
transmitting:
if I am the Owner take backoff = Random(To)
else if I am Non-Owner take backoff = To + Random
(Tno)
after backoff, sense channel, if busy repeat above,
else send.
! High Contention Level: Only owners of the
current slot and their 1-hop neighbors are allowed
to compete for the channel access
71
Z-MAC Transmission Control
Busy Owner Accessing Channel
Random Backoff (Contention Window)
Busy Non-owner Accessing Channel To
Random Backoff (Contention Window)
21
72
Z-MAC LCL
! Problem Hidden Terminal Collisions
Although LCL effectively reduces collisions within one hop, hidden
terminal may still manifest itself when two hops are involved
C
A B 0(2)
2(2)
1(2)
Time
Slots
A(0)
B(1)
0 0 2 1
Collision at C
73
Z-MAC HCL
High Contention Level: node can compete in current slot only if:
- It is owner of the slot OR
- It is one-hop neighbor to the owner of the slot
C
A B 0(2)
2(2)
1(2)
Time
Slots
A(0)
B(1)
0 0 2 1
Slot in HCL, sleep till next time
slot
Collisions still possible here
74
Z-MAC Transmission Control
(Continued)
A A B B B A A A A B B B
TDMA and Z-MAC under high contention (Two node example)
A A A A A A
TDMA under no contention (Two node example)
A A A A A A A A A A A A
Z-MAC under no contention (Two node example)
22
75
Z-MAC
Explicit Contention Notification
! A node experiencing high contention informs nodes
within 2-hop neighborhood not to send during its time-
slot
! High contention detected by lost ACKs or congestion
backoffs
! The generator of an ECN transmits a unicast message
to the destination toward which the node is experiencing
high contention
76
Z-MAC
Explicit Contention Notification
! On receiving one-hop ECN from i, a node j checks
whether j is the destination
If so, j broadcasts the ECN to its 1-hop
neighbors (in this case the message is called two-
hop ECN)
Else, j discards the message
When a node receives a 2-hop ECN message, it sets
its HCL flag
77
Z-MAC
Explicit Contention Notification
ECN Suppression
HCL flag is soft state, so reset periodically
Nodes need to resend ECN if high contention
persists
To prevent ECN implosion, if ECN message
received from one-hop neighbor, cancel one's
own pending ECN message
23
78
A
F
E
D
B
C
discard
discard
forward
forward
! C experiences high contention
! C transmits 1-hop ECN message with
destination D
! A, B not intended destination, so
discard ECN
! D forwards ECN as two-hop ECN
message to E, F
! Now, E and F will not compete during
C's slot as Non-Owners
! A, B and D are eligible to compete
during C's slot, albeit with lesser
priority as Non-Owners
Thick Line Routing Path
Dotted Line ECN
Messages
Z-MAC
Explicit Contention Notification
79
Performance Results
DRAND and ZMAC have been implemented on
both NS2 and on Mica2 motes
! Platform:
Mica2
8-bit CPU at 4MHz
8KB flash, 256KB RAM
916MHz radio
TinyOS event-driven
80
Experimental Setup - Testbed
"
40 Mica2 sensor
motes in Withers
Lab
Wall-powered and
connected to the
Internet via
Ethernet ports
Programs uploaded
via the Internet, all
mote interaction via
wireless
Links vary in quality,
some have loss rates
up to 30-40%
Asymmetric links
also present (14--
>15).
24
81
Z-MAC Single-Hop Throughput
Z-MAC
B-MAC
82
Multi Hop Results Throughput
Z-MAC
B-MAC
MULTI-HOP
83
Fairness (two hop)
0
0.2
0.4
0.6
0.8
1
2 4 6 8 10 12 14 16
F
a
ir
n
e
s
s
In
d
e
x
Number of Sources/Contenders
Transmission Fairness in the Two-hop Mica2 Experiment
B-MAC - Initial = 32, Congestion = 16
B-MAC - Initial = 16, Congestion = 64
Z-MAC-HCL - To = 8, Tno = 32
Z-MAC-LCL - To = 8, Tno = 32
25
84
Multi Hop Results Energy
Efficiency (KBits/Joule)
Z-MAC HCL
B-MAC
MULTI-HOP
87
Conclusion
Combine strengths of TDMA and CSMA
The owner of a time-slot always has priority over the non-
owners while accessing the medium
Unlike TDMA, non-owners can 'steal' the time-slot when
the owners do not have data to send
This enables Z-MAC to switch between CSMA and TDMA
depending on the level of contention
Hence, under low contention, Z-MAC acts like CSMA (i.e.,
high channel utilization and low latency), while under high
contention, Z-MAC acts like TDMA (i.e., high channel
utilization, fairness and low contention overhead)
The IEEE 802.15.4 Standard

You might also like