Trickle: Code Propagation and Maintenance in Wireless Sensor Networks Philip Levis Scott Shenker Neil Patel David Culler UC Berkeley UC Berkeley UC Berkeley UC Berkeley Intel Berkeley ICIR Intel Berkeley
Embedded Sensor Networks 36m 33m: 111 32m: 110 30m: 109,108,107 20m: 106,105,104 10m: 103, 102, 101
Sensor Network Behavior
Problem Statement • Sensor network characteristics – Long lifetimes – Embedded and unreachable – Large numbers – Transient, lossy networks • Changes to running code are inevitable • Need to efficiently – Rapidly propagate new code into a network – Cheaply maintain a consistent code image
Trickle • Simple, “polite gossip” algorithm • “Every once in a while, broadcast what code you have, unless you’ve 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
Outline • Problem statement • Trickle algorithm • Maintenance • Propagation • Future Work
Trickle Assumptions • Broadcast medium • Concise, comparable metadata • Metadata is the significant cost – 1 packet/minute for a day is 1440 messages – Equivalent to a 40K code image – Code will often be small: parameters, etc.
Communication • As long as each mote communicates with one other, inconsistencies will be found • Transmission or reception • Maintain a lower communication bound over time: ( receptions + transmissions ) <= k • The closer to k , the better (efficiency)
Trickle Algorithm • Time interval of length t • Redundancy constant k (e.g., 1, 2) • Pick a time t from [0, t ] • Maintain a counter c • At time t , transmit code metadata if c < k • Increment c when you hear identical metadata to your own • At end of t , pick a new t
Example Trickle Execution, k = 1 A t 1 t 2 B t 1 t 2 C t 1 t 2 t time transmission reception suppressed transmission
Outline • Problem statement • Trickle algorithm • Maintenance • Propagation • Future Work
Maintenance Evaluation • Start with three assumptions, relax each – Lossless cell – Perfect synchronization – Single cell • Single, lossless, synchronized cell – k transmissions per interval – First k nodes to transmit suppress all others – Independent of density • In experiments (unless said otherwise), k =1
Loss 12 10 Transmissions/Interval 8 60% 40% 6 20% 0% 4 2 0 1 2 4 8 16 32 64 128 256 Motes
Logarithmic 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
Synchronization 14 12 Transmissions/Interval 10 8 Not Synchronized Synchronized 6 4 2 0 1 2 4 8 16 32 63 128 256 Motes
Short Listen Effect • Lack of synchronization leads to the “short listen effect” • For example, B transmits three times: t A B C D Time
Solution • Add a listening period: t from [0.5 t , t ] Listen-only period
Effect of Listen Period 14 12 Transmissions/Interval 10 Not Synchronized 8 Synchronized 6 Listening 4 2 0 1 2 4 8 16 32 63 128 256 Motes
Multi-Cell Case • TOSSIM simulation – No synchronization – Loss sampled from empirical models – Nodes uniformly distributed in 50’x50’ area • Logarithmic scaling holds 16 14 Transmissions/Interval 12 10 8 6 4 2 0 1 2 4 8 16 32 64 128 256 Hidden Terminal Motes No Hidden Terminal
Empirical Validation • Redundancy: ( transmissions + receptions ) - k intervals Efficiency over Density 1.6 1.4 1.2 Efficiency 1 0.8 0.6 0.4 0.2 0 1 2 4 8 16 32 64 Empirical Motes Simulated
Outline • Problem statement • Trickle algorithm • Maintenance • Propagation • Future Work
Speeding Propagation • Adjust t : t l , t h • When t expires, double t up to t h • When you hear newer metadata, set t to t l • When you hear newer code, set t to t l • When you hear older metadata, send code – Blind transmission at 1, 3, and 7 seconds – Could use Trickle for suppression as well
Rate Change Illustration Hear Newer Metadata 2 t l t h t l t h t h 2 Time
Empirical Propagation • Deployed 19 nodes in office setting • Instrumented nodes for accurate time measurements • Introduce new code, log installation times • k=1, t l =1 second, t h =1 minute • 40 test runs
Network Layout
Empirical Results Time to Complete Propagation Propagation Time Distribution 70 35.00% 30.00% 60 25.00% 50 20.00% Time (seconds) Motes 40 15.00% 30 10.00% 20 5.00% 0.00% 10 0 5 10 15 20 25 30 35 40 45 Time (seconds) 0
Conclusions • 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 t l , t h and k needed
Questions
Multi-cell Case, Simulated 16 14 Transmissions/Interval 12 10 8 6 4 2 0 1 2 4 8 16 32 64 128 256 Hidden Terminal Motes No Hidden Terminal
Empirical Scaling • Nodes evenly spaced on a table • Very low signal strength for packet loss
Simulated Propagation • TOSSIM, 20x20 node grid • Change spacing between nodes • k=1, t l =1 second, t h =1 minute
Time To Reprogram, Tau, 5 Foot Spacing (seconds) 16-18 14-16 12-14 10-12 8-10 6-8 4-6 2-4 0-2
Time To Reprogram, Tau, 10 Foot Spacing (seconds) 18-20 16-18 14-16 12-14 10-12 8-10 6-8 4-6 2-4 0-2 Time
Time To Reprogram, Tau, 15 Foot Spacing (seconds) 45-50 40-45 35-40 30-35 25-30 20-25 15-20 10-15 5-10 0-5 Time
Time To Reprogram, Tau, 20 Foot Spacing (seconds) 56-64 48-56 40-48 32-40 24-32 16-24 8-16 0-8 Time
Changing t h to 20 minutes k=1 k=2 70 70 60 60 50 50 Time (seconds) Time (seconds) 40 40 30 30 20 20 10 10 0 0
Recommend
More recommend