Smart Dust and TinyOS: Hardware and Software for Network

Download Report

Transcript Smart Dust and TinyOS: Hardware and Software for Network

Wireless Embedded Systems and Networking
Foundations of IP-based Ubiquitous Sensor Networks
Self-Organized Multihop Routing
David E. Culler
University of California, Berkeley
Arch Rock Corp.
July 9, 2007
AIIT Summer Course - D#
7/9/2007
1
WSN Communication Requirements
•
•
•
•
Local neighbor communication (1 to few)
Dissemination (1 to many)
Data Collection and Aggregation (many to 1)
Point-to-point Transfers (1 to 1)
• Reliably over lossy links
• At low power
– Idle listening, management, monitoring
• Adapting to changing conditions
• With very light memory footprint
AIIT Summer Course - D#
7/9/2007
2
Classical View of Routing
• Connectivity between nodes defines the network
graph.
– Topology formation
• A Routing algorithm determines the sub-graph
that is used for communication between nodes.
– Route formation, path selection
• Packets are forwarded from source to
destination over the routing subgraph
– At each node in the path, determine the recipient of the next
hop
• The selection at each hop is made based on the
information at hand
– Sender address, current address, destination address,
information in the packet, information on the node.
– Table-driven, source based, algorithmic, …
– Who knows the route? Do you determine it as you go?
AIIT Summer Course - D#
7/9/2007
3
Basic Approaches
• Link state
– Nodes shout (send) and listen (receive) to determine neighbor
connectivity.
– Each floods this information throughout (Link State
Advertisement) so every node has a map (Link state data
base) of the network.
– Any node can determine the path or the next hop.
– management protocol deals with changes in connectivity
– Classic Example: OSPF
• Distance vector
– Nodes maintain routing information about “distance” and
“direction” to destinations
– Choose next hop by comparing the cost of routing through
neighbors
» Cost(dest D, neighbor b) = linkCost(b) + pathCost(b,D)
– Management propagates routing information
» Sequence numbers, etc.
– Classic Example: RIP
AIIT Summer Course - D#
7/9/2007
4
What’s different in WSN?
• There is no a priori network graph
– It is discovered by sending packets and seeing who receives
them.
– The link relationship is not binary.
» pairs of nodes communicate with some probability that is
determined by many of factors.
– It is not static.
• The embedding of the “network” in space is
important.
– Need to get information to travel between particular physical
places.
– But the “communication range” is not a simple function of
distance.
• addressing & naming
– Flat EUID? Hierarchical IP? Topologically meaningful?
Spatially meaningful?
AIIT Summer Course - D#
7/9/2007
5
Topology Formation
• Much of the “paper protocols” define
connectivity graph with unit disk model
R
– Link(A,B) iff dist(A,B) ≤ R
• OK for rough calculations, but not for protocol
design
– Nearby nodes may not be able to communicate.
– Far away nodes may be able to communicate.
– Nodes that communicated in the past may not be able to
communicate in the future.
– Nodes may have intermittent communication depending on
external factors.
• Connectivity is determined by communication
– If B receives packet reasonably reliably from A, then A  B
– If A receives packet reasonably reliably from B, then A  B
– And if both are true, A  B
AIIT Summer Course - D#
7/9/2007
6
Wireless Routing Protocols
• Many wireless protocols in the IP context have
been development in the IETF MANET (Mobile Ad
Hoc Networking) working group in the context of
802.11 links carrying traditional TCP/IP point-topoint traffic.
–
–
–
–
–
AODV – ad hoc on-demand distance vector
OLSR – Optimized link state Routing
DSDV - Destination Sequenced Distance Vector
DSR – Dynamic Source Routing
TDRPF - Topology Dissemination Based on Reverse-Path
Forwarding
• Assume a fairly “classic” view of connectivity
– Naïve radio
AIIT Summer Course - D#
7/9/2007
7
Neighbor Communication
1
1
0
AIIT Summer Course - D#
7/9/2007
8
Fundamental Primitive
• Transmit to whatever receivers happen to hear it
• This is the fundamental primitive that is buried
underneath complex protocols like Bluetooth,
but not made available.
• It is what make it possible to build higher level
protocols on the link, especially IP.
• To determine connectivity,
– Local broadcast
– Respond
– on-going protocol to estimate quality of the link
» Packet reliability (sequence numbers, acks)
• Note 802.15.4 acks only from a specific destination
» RSSI, LQI, …
AIIT Summer Course - D#
7/9/2007
9
Simple Address-Free Flooding Protocol
• Root broadcasts a “new” message to local
neighborhood
• Each node performs a simple rule
if (“new” incoming msg) then
take local action
retransmit modified msg
• No underlying routing structure required
– The connectivity over physical space determines it.
AIIT Summer Course - D#
7/9/2007
10
Route-Free “Flood”
1
1
0
AIIT Summer Course - D#
7/9/2007
11
Flooding
• Route free dissemination is extremely useful in
its own right
– Issue commands
– Network-wide discovery
– Join, …
• It is also the network primitive that most “ad
hoc” protocols used to determine a route
– Flood from source till destination is reached.
– Each node records the source of the flood packet
» This is the parent in the “routing tree”
– Reverse the links to form the path back
AIIT Summer Course - D#
7/9/2007
12
Data Collection
2
2
2
2
1
1
2
0
AIIT Summer Course - D#
7/9/2007
13
Multihop Routing
• Upon each transmission, one of the recipients
retransmits
– determined by source, by receiver, by …
– on the ‘edge of the cell’
AIIT Summer Course - D#
7/9/2007
14
The Problems
• Flood causes tremendous contention
– Many good links missed because of collistions
– Huge amount of noise
• Many links are not symmetric
AIIT Summer Course - D#
7/9/2007
15
Flood Dynamics
• Experimental Setup
–
–
–
–
13x13 grid of nodes
separation 2ft
flat open surface
Identical length antennas,
pointing vertically upwards.
– Fresh batteries on all nodes
– Identical orientation of all
nodes
– The region was clean of
external noise sources.
• Range of signal strength
settings
• Log many runs
Ganesan, Krishnamachari, Woo, Culler, Estrin and Wicker, Complex Behavior at Scale: An Experimental Study of
Low-Power Wireless Sensor Networks , UCLA Computer Science Technical Report UCLA/CSD-TR 02-0013
AIIT Summer Course - D#
7/9/2007
16
Final Tree
AIIT Summer Course - D#
7/9/2007
17
Factors
• Long asymmetric links are common
– Many children
• Nodes out of range may have overlapping cells
– hidden terminal effect
• Collisions => these nodes hear neither ‘parent’
– become stragglers
• As the tree propagates
– folds back on itself
– rebounds from the edge
– picking up these stragglers.
• Redundancy
– Geometric overlap => <41% additional area
Ni, S.Y., Tseng, Y.C., Chen, Y.S., Sheu, J.P.: The broadcast storm problem in a mobile ad hoc network. MobiCom'99
AIIT Summer Course - D#
7/9/2007
18
Robust Tree Building & Dissemination
•
•
•
•
•
Grow the tree slowly
Avoid Contention at every transmission
Avoid Redundant Transmissions
Adapt to huge range of density
Make sure it eventually gets to everyone
– Even if they are not listening
– Or arrive late
• With very simple mechanism
AIIT Summer Course - D#
7/9/2007
19
Trickle – better than flood
• Want the communication rate per unit area to be
constant, regardless of the density of nodes
– Lots of nodes, transmit infrequently
– Few node, transmit more frequently
• Nodes listen before transmitting
• Estimate density based on how many nodes you
hear from
– Arrival during timer wait extends timer
• If new value is disseminated by others, no need
for you to transmit it.
• Increase delay over time so ambient rate
approaches zero.
• Shorten delay when new epoch appears.
AIIT Summer Course - D#
7/9/2007
22
Collection
• Common use: monitoring
– Collection of nodes take periodic samples
– Stream data towards a root node
• Builds and maintains trees
• Root announces interest
– depth = 0
• Nodes listen
• When hear ‘neighbor’ with smaller depth
– start transmitting data to “best” lower neighbor
– set own depth to one greater (and include with data)
• Data transmission continuously reinforces & adjusts routes
• Aggregation within nodes or within the tree
AIIT Summer Course - D#
7/9/2007
23
Building Neighborhoods & Routes
•
•
•
•
Node transmits to some unknown set
Candidate nbrs are sources of incoming packets
Estimate of inbound link reliability
Occasionally announce inbound link states
– Provides reverse link estimate to outbound neighbors
– Basis for cost-based routing
• Cost-based Parent Selection
– depth(me) = MIN nbr(me) depth(i)
– loss(me) = MIN nbr(me) loss(i)*est(me,i)
– trans(me) = MIN nbr(me) trans(i)+etrans(me,i)
• What about nbrs that don’t fit in the table?
– FIFO, LRU, Frequency
Taming the Challenges of Reliable Multihop Routing in Sensor Networks,
AIIT
Summer
Course
- D# 2003.
7/9/2007
Alec Woo
and
David Culler,
SenSys.
24
Pragmatics
• Maintain at least two (preferably three) candidate
parents
– Link level retransmission and rerouting
– Use acks to determine quality of the link
– Throw in a new candidate from time to time.
• Do not record list of children
– Insufficient memory to build the table.
• Route update message on a trickle schedule
AIIT Summer Course - D#
7/9/2007
25
Question
• For such distance-vector dags, what pattern of
node movement is most difficult?
AIIT Summer Course - D#
7/9/2007
26
Epidemic NW protocols
• Goal: scalable, robust communication algorithms that adapt to changing
conditions with little state or protocol
• Basic operation:
– From time to time (based on local state and what you’ve heard) transmit a packet of
information to whomever hears the message
– From time to time, hear a packet which causes an update to local state
– Continuous process to ensure full reliability
• Adapt to density, coverage, interference, loss, schedule, …
AIIT Summer Course - D#
7/9/2007
27
Robust OTA Programming
• Every byte must (eventually) be correctly received
by all nodes!
•
Reliable Pipelined Epidemic Distribution of series of
pages
– Constrained storage hierarchy
» Packet (32 bytes) << RAM (4K) << program (128K) < external
flash (512K)
– Lossy links, Critical Contention
– Density-aware
– Robust to asymmetric links
– Dynamic adjustment of advertisements
– Minimize set of concurrent data broadcasts
– Spatial multiplexing
•
flash
…
Page Advertise, Request/Fix, Xfer
– Density-aware suppression and snoop on each
•
•
Packet CRC + Page CRC
159 Byte memory footprint
Request
Maintain
AIIT Summer Course - D#
7/9/2007
Transmit
28
OTA Programming
• Learn about the environment after deployment
– sensing range, network characteristics, etc.
AIIT Summer Course - D#
7/9/2007
29
OTA Programming
• Learn about the environment after deployment
– sensing range, network characteristics, etc.
AIIT Summer Course - D#
7/9/2007
30
OTA Programming
• Learn about the environment after deployment
– sensing data, network characteristics, etc.
• Embedded nature of sensor networks
• Network scales reaching thousands of nodes
• A necessity in debugging and testing cycle
AIIT Summer Course - D#
7/9/2007
31
What is Deluge?
• A reliable data dissemination protocol for program images over a
multihop network.
Program
01010
10101
01010
10110
10101
10101
01010
10101
•Combined with a bootloader (TOSBoot)
 Network Programming
AIIT Summer Course - D#
7/9/2007
32
Data Representation
•Program divided into pages, each consisting of N packets.
Program
101 110 010
110 010 000
101 000
111 011
Packets
1234
N
•Reduced RAM requirements
•Allows for spatial multiplexing
AIIT Summer Course - D#
7/9/2007
33
How Does Deluge Work?
(Glossing over many details)
•Nodes periodically advertise
– Suppress similar advertisements
I only have
version 1.
Version 2 here.
I only have
version 1.
AIIT Summer Course - D#
7/9/2007
34
How Does Deluge Work?
(Glossing over many details)
•Neighboring nodes request data
– Suppress similar requests
Send me page 1!
Send me
page 1!
AIIT Summer Course - D#
7/9/2007
35
How Does Deluge Work?
(Glossing over many details)
•Requested data is broadcast
Packet 12
of page 1!
AIIT Summer Course - D#
7/9/2007
36
How Does Deluge Work?
(Glossing over many details)
•Dropped packets are NACKed
Repeat packet 4
of page 1!
Repeat packet 32
of page 1!
AIIT Summer Course - D#
7/9/2007
37
How Does Deluge Work?
(Glossing over many details)
•Dropped packets are sent again
Packet 4
of page 1!
AIIT Summer Course - D#
7/9/2007
38
How Does Deluge Work?
(Glossing over many details)
•Advertise for propagation to next hop
Version 2 here.
I only have
version 1.
AIIT Summer Course - D#
7/9/2007
39
Spatial Multiplexing
•Propagate in “waves”
•Exploit limited radio range for
concurrent broadcasts.
•Reduced completion time
•o(d + Sobj) vs. o(d * Sobj)
Page 1
AIIT Summer Course - D#
7/9/2007
Page 0
40
Epidemic Propagation
• Epidemic propagation from
one source
AIIT Summer Course - D#
7/9/2007
41
Epidemic Propagation
•Epidemic propagation from one source or many
AIIT Summer Course - D#
7/9/2007
42
Deluge Features
• Epidemic propagation from one source or many
– Continuous propagation effort by all nodes
– Turn on/off radios at will
– Reach nodes with intermittent connectivity
Will find a path if it exists
•Aggressive message suppression
– Scales with density
– Ultra low quiescent traffic
AIIT Summer Course - D#
7/9/2007
43
Deluge Features
• Management
Program Name
Compile Time
UserID
Hostname
Platform
– Multiple program images
– Image metadata
– User confirmation on expensive operations
»Minimize operator error
ProgC
01010
10101
01010
10110
10101
10101
01010
10101
01010
10101
01010
10110
10101
10101
01010
10101
01010
10101
01010
10110
10101
10101
01010
10101
– TOSBoot as isolated code
– Verify CRCs
– Verify system voltage
CRC CRC CRC CRC
• TOSBoot
ProgB
CRC CRC CRC CRC
– Redundant CRCs
– Golden Image with write protect
– Load Golden Image
»Watchdog trigger
»Golden gesture
ProgA
CRC CRC CRC CRC
• Robustness
CRASH!
AIIT Summer Course - D#
7/9/2007
44
Deluge - Lessons Learned
• Advantages
–
–
–
–
–
–
Ease of reprogramming 100’s-1000’s of nodes
Does not erase node IDs
Golden Image is immensely useful
Quickly switch between images
More reliable than uisp or msp430-bsl
Deluge over 802.15.4 more efficient that 802.11!
•Disadvantages
– Ease of reprogramming 100’s-1000’s of nodes
AIIT Summer Course - D#
7/9/2007
45
Integrated, Density-Aware Dissemination
and Collection
Drip – packet dissemination layer
•
GW
Trickle neighborhood suppression
lowers bandwidth requirements
Trickle exponential retransmission
creates epidemic reliability
Provides “transport-layer” interface
•
•
PC
Drain – packet collection layer
GW
•
•
•
•
802.15.4 LQI for link estimation
Gateway initiates the tree-build
Fast, minimal RAM, evolvable
Reliability from link-layer ACKs and
exponential retry with long window
AIIT Summer Course - D#
7/9/2007
46