Title: Trickle: Code Propagation and Maintenance
1Trickle Code Propagation and Maintenance
Neil Patel UC Berkeley
David Culler UC Berkeley
Scott Shenker UC Berkeley ICSI
Philip Levis UC Berkeley
2Retasking a Sensor Net
- Long lifetimes require retasking
- Spectrum of retasking mechanisms
- Binary images (MOAP, XnP, Deluge)
- High-level virtual programs (Maté, TinyDB)
- Parameter setting (Attribute, Global)
- Install on every node
- Packet loss and transient disconnection
- Periodically check that everyone has the right
code (advertise) - TinyDB tuples embed query ID
3Propagating Can Be Costly,
- Binaries 10-60KB
- Virtual programs 20-400B
- Parameters 8-30B
- To every node in a large, multihop network
4Knowing When Is Costlier
- Periodically checking that everyone has the right
code (advertisements) can cost more than the code
itself. - 64KB of data 1 packet/minute for a day
- 400B of data 1 packet/hour for a day
- 20B one packet!
5Problem Statement
- The first step is to detect when nodes need
updates (continuous process) - When there is no new code
- Maintenance cost should approach zero
- When there is new code
- Propagation should be rapid
6Relation to Deluge, SPIN, etc.
- When do you advertise code?
- How do you suppress control messages?
- Not a dissemination protocol
7Solution Trickle
- Simple, polite gossip algorithm
- Every once in a while, broadcast what code you
have, unless youve heard some other nodes
broadcast the same thing. - Behavior (simulation and deployment)
- Scalability thousand-fold density changes
- Maintenance a few sends per hour
- Propagation less than a minute
8Outline
- Introduction
- Trickle algorithm
- Maintenance
- Propagation
- Conclusion
9Trickle Assumptions
- Wireless broadcast medium
- Concise, comparable metadata
- Given A and B, know which has newer code
10Idea Communication
- As long as each mote communicates with one other,
needed updates will be detected - In a single cell, one transmission will detect
all needed updates - Communication is reception or transmission
- Maintain a communication rate
(receptions transmissions) lt k
11Trickle Algorithm
- Time interval of length t
- Redundancy constant k (e.g., 1, 2)
- Pick a time t from 0, t
- Maintain a counter c, initialized to zero
- At time t, broadcast code metadata if c lt k
- Increment c when you hear identical metadata to
your own - At end of t, pick a new t
12Example Trickle Execution
k1
c
0
1
2
0
3
0
t
time
transmission
suppressed transmission
reception
13Example Trickle Execution
k1
c
0
1
t1a
2
0
3
0
t
time
transmission
suppressed transmission
reception
14Example Trickle Execution
k1
c
0
1
t1a
2
1
3
0
t
time
transmission
suppressed transmission
reception
15Example Trickle Execution
k1
c
0
1
t1a
2
1
3
0
t3a
t
time
transmission
suppressed transmission
reception
16Example Trickle Execution
k1
c
0
1
t1a
2
2
3
0
t3a
t
time
transmission
suppressed transmission
reception
17Example Trickle Execution
k1
c
0
1
t1a
2
2
t2a
3
0
t3a
t
time
transmission
suppressed transmission
reception
18Example Trickle Execution
k1
c
0
1
t1a
2
0
t2a
3
0
t3a
t
time
transmission
suppressed transmission
reception
19Example Trickle Execution
k1
c
1
1
t1a
2
0
t2a
t2b
3
1
t3a
t
time
transmission
suppressed transmission
reception
20Example Trickle Execution
k1
c
1
1
t1a
2
0
t2a
t2b
3
1
t3a
t3b
t
time
transmission
suppressed transmission
reception
21Example Trickle Execution
k1
c
1
1
t1a
t1b
2
0
t2a
t2b
3
1
t3a
t3b
t
time
transmission
suppressed transmission
reception
22Outline
- Problem statement
- Trickle algorithm
- Maintenance
- Propagation
- Conclusion
23Maintenance
- Minimize maintenance cost (transmissions) when
there is no new code - Keep as close to k as possible
- Start with three assumptions, relax each
- Lossless network
- Perfect synchronization
- Single-hop
24Ideal Case
- k transmissions per interval
- First k nodes to transmit suppress all others
- Independent of density
25Loss
26Logarithmic Behavior of Loss
- Transmission increase is due to the probability
that one node has not heard n transmissions - Example 10 loss
- 1 in 10 nodes will not hear one transmission
- 1 in 100 nodes will not hear two transmissions
- 1 in 1000 nodes will not hear three, etc.
- Fundamental bound to maintaining per-interval
communication
27Synchronization
28Short Listen Effect
- Some nodes dont listen much (pick small t
values) - For example, B transmits three times
t
A
B
C
D
Time
transmission
suppressed transmission
reception
29Solution
- Add a listening period pick t from 0.5t, t
Listen-only period
30Effect of Listen Period
31Multi-Cell Case
- TOSSIM simulation
- No synchronization, loss from empirical model
- Nodes uniformly distributed in 50x50 area
- Logarithmic scaling holds
32Empirical Validation
(transmissions receptions)
- Redundancy
- Maté VM implementation
- k
intervals
33Outline
- Problem statement
- Trickle algorithm
- Maintenance
- Propagation
- Conclusion
34Choosing Intervals
- Large interval low cost, slow to discover
- Small interval high cost, quick to discover
- When theres new gossip, talk more
- When theres nothing new, talk less
35Speeding Propagation
- Adjust t tl, th
- When t expires, double t up to th
- When you hear newer metadata, set t to tl
- When you hear newer code, set t to tl
- When you hear older metadata, send an update
36Rate Change Illustration
Hear Newer Metadata
2tl
th
tl
th
th
2
Time
37Simulated Propagation
k1, tl1 second, th1 minute
38Empirical Propagation
- Deployed 19 nodes in office setting
- Instrumented nodes for accurate time measurements
- Introduce new code, log installation times
- k1, tl1 second, th1 minute
- 40 test runs
39Network Layout
40Empirical Results
41Changing th to 20 minutes
k1
42Conclusions
- Trickle efficiency scales logarithmically with
density - Can obtain rapid propagation with low maintenance
- At most 3 sends/hour, propagates in 30 seconds
- Uses beyond code propagation
- Changes to data such as routing tables
- E.g., predicates can scope distance
- Further examination of tl, th and k needed
43Questions
- Tech report available in back
44Sensor Network Behavior
45Multi-cell Case, Simulated
46(No Transcript)
47(No Transcript)
48(No Transcript)