The Trickle Algorithm Analysis, Use, and Implementation Philip Levis Computer Systems Lab Stanford University
Trickle Summary • An algorithm for establishing eventual consistency in a wireless network • Establishes consistency quickly • Imposes low overhead when consistent • Cost scales logarithmically with density • Requires very little RAM or code • Makes no topology assumptions 2 IETF 74
Consistency • Powerful primitive with many uses • Routing tree maintenance • Invariant: next hop has lower cost • Network configuration • Invariant: all have the most recent config • Neighbor discovery • Invariant: node is in all neighbor’s lists 3 IETF 74
Overview • Trickle operates over time intervals • No synchronization needed between nodes • In each interval, node optionally transmits • Transmits if it hasn’t heard transmissions that are consistent with its own • Dynamically scales interval lengths to have fast updates yet low cost when consistent 4 IETF 74
Suppression • Motivation: don’t waste messages (energy and channel) if all nodes agrees • Interval of length τ • At beginning of interval, counter c=0 • On consistent transmission, c++ • Node picks a time t in range [ τ /2 , τ ] • At t, transmit if c < k (redundancy constant) 5 IETF 74
Example Execution k =1 c A 0 t A1 t A2 B t B1 t B2 0 C t C1 t C2 0 τ time transmission suppressed transmission reception 6 IETF 74
Example Execution k =1 c A 0 t A1 t A2 B t B1 t B2 1 C t C1 t C2 0 τ time transmission suppressed transmission reception 7 IETF 74
Example Execution k =1 c A 0 t A1 t A2 B t B1 t B2 2 C t C1 t C2 0 τ time transmission suppressed transmission reception 8 IETF 74
Example Execution k =1 c A 0 t A1 t A2 B t B1 t B2 2 C t C1 t C2 0 τ time transmission suppressed transmission reception 9 IETF 74
Example Execution k =1 c A 0 t A1 t A2 B t B1 t B2 0 C t C1 t C2 0 τ time transmission suppressed transmission reception 10 IETF 74
Example Execution k =1 c A 1 t A1 t A2 B t B1 t B2 0 C t C1 t C2 1 τ time transmission suppressed transmission reception 11 IETF 74
Example Execution k =1 c A 1 t A1 t A2 B t B1 t B2 0 C t C1 t C2 1 τ time transmission suppressed transmission reception 12 IETF 74
Example Execution k =1 c A 1 t A1 t A2 B t B1 t B2 0 C t C1 t C2 1 τ time transmission suppressed transmission reception 13 IETF 74
log(L) (k=1) 12 Transmissions/Interval 60% 10 8 40% 6 20% 4 2 0% 0 1 2 4 8 16 32 64 128 256 Nodes 14 IETF 74
Logarithmic Behavior • 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 a per-node communication rate 15 IETF 74
Intervals (exponential timers) • Two constants: τ l << τ h • One variable: τ • Operate over time intervals of length τ • At end of interval, double τ up to τ h • On detecting an inconsistency, set τ to τ l • Consistent network has large intervals • Inconsistency leads to small intervals 16 IETF 74
Simulated Propagation • Inconsistency at lower left corner • 16 hop network • Time to reception in seconds • Set τ l = 1 sec • Set τ h = 1 min • 20s for 16 hops • Wave of activity 17 IETF 74
Example: Routing (distance vector) • Reset τ when • Receive a packet with a higher distance • Distance drops significantly • Use τ l =32ms, τ h =1 hour, compare with fixed beacons of 30s • Reduces control traffic by 75% • Reduces latency to repair loops by 99.9% 18 IETF 74
Details • Current implementations require • 4-7 bytes of RAM • 30-100 lines of code • Diversity addresses topology edge cases • Node diversity • Spatial diversity • Temporal diversity • Self-regulating and adapting 19 IETF 74
Summary • Trickle: algorithm for eventual consistency in a wireless network • Very simple, highly efficient • Many uses • Routing topology • Reliable broadcasts • Neighbor discovery 20 IETF 74
References • Philip Levis, Eric Brewer, David Culler, David Gay, Samuel Madden, Neil Patel, Joe Polastre, Scott Shenker, Robert Szewczyk, and Alec Woo. "The Emergence of a Networking Primitive in Wireless Sensor Networks." In Communications of the ACM, Volume 51, Issue 7, July 2008. Best starting point. • Jonathan W. Hui and David E. Culler. “IP is Dead, Long Live IP for Wireless Sensor Networks.” In Proceedings of the 6th International Conference on Embedded Networked Sensor Systems (SenSys), 2008. • Philip Levis, Neil Patel, David Culler, and Scott Shenker. "Trickle: A Self-Regulating Algorithm for Code Propagation and Maintenance in Wireless Sensor Networks." In Proceedings of the First USENIX/ACM Symposium on Networked Systems Design and Implementation (NSDI 2004). • Omprakash Gnawali, Rodrigo Fonseca, Kyle Jamieson, and Philip Levis. "Robust and Efficient Collection through Control and Data Plane Integration." Technical Report SING-08-02. 21 IETF 74
Questions 22 IETF 74
Draft Plans • Precise algorithm specification • Statement of how to reference algorithm in protocol specification documents • Consistency criteria • Constants: k, τ l , τ h • Discussion of interoperability concerns and performance implications of inconsistent constant values 23 IETF 74
Experimental Data 1 35000 CTP MultiHopLQI 30000 25000 20000 15000 10000 5000 0 0 1 2 3 4 5 Time(hours) 24 IETF 74
Experimental Data 2 25 IETF 74
Recommend
More recommend