The Trickle Algorithm Analysis, Use, and Implementation Philip - - PowerPoint PPT Presentation

the trickle algorithm
SMART_READER_LITE
LIVE PREVIEW

The Trickle Algorithm Analysis, Use, and Implementation Philip - - PowerPoint PPT Presentation

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


slide-1
SLIDE 1

The Trickle Algorithm

Analysis, Use, and Implementation

Philip Levis Computer Systems Lab Stanford University

slide-2
SLIDE 2

IETF 74

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

slide-3
SLIDE 3

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

slide-4
SLIDE 4

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

slide-5
SLIDE 5

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

slide-6
SLIDE 6

IETF 74

6

Example Execution

tA1 tA2

time

tB1 tB2

τ

tC1 tC2

B C

transmission suppressed transmission reception

A

k=1 c

slide-7
SLIDE 7

IETF 74

7

Example Execution

tA1 tA2

time

tB1 tB2

τ

tC1 tC2

B C

transmission suppressed transmission reception

A

k=1 c 1

slide-8
SLIDE 8

IETF 74

8

Example Execution

tA1 tA2

time

tB1 tB2

τ

tC1 tC2

B C

transmission suppressed transmission reception

A

k=1 c 2

slide-9
SLIDE 9

IETF 74

9

Example Execution

tA1 tA2

time

tB1 tB2

τ

tC1 tC2

B C

transmission suppressed transmission reception

A

k=1 c 2

slide-10
SLIDE 10

IETF 74

10

Example Execution

tA1 tA2

time

tB1 tB2

τ

tC1 tC2

B C

transmission suppressed transmission reception

A

k=1 c

slide-11
SLIDE 11

IETF 74

11

Example Execution

tA1 tA2

time

tB1 tB2

τ

tC1 tC2

B C

transmission suppressed transmission reception

A

k=1 c 1 1

slide-12
SLIDE 12

IETF 74

12

Example Execution

tA1 tA2

time

tB1 tB2

τ

tC1 tC2

B C

transmission suppressed transmission reception

A

k=1 c 1 1

slide-13
SLIDE 13

IETF 74

13

Example Execution

tA1 tA2

time

tB1 tB2

τ

tC1 tC2

B C

transmission suppressed transmission reception

A

k=1 c 1 1

slide-14
SLIDE 14

IETF 74

log(L)

(k=1)

1 2 4 8 16 32 64 128 256

Nodes

2 4 6 8 10 12 Transmissions/Interval 0% 20% 40% 60%

14

slide-15
SLIDE 15

IETF 74

15

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

slide-16
SLIDE 16

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

slide-17
SLIDE 17

IETF 74

17

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
slide-18
SLIDE 18

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

slide-19
SLIDE 19

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

slide-20
SLIDE 20

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

slide-21
SLIDE 21

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.

  • 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.

Best starting point.

21

slide-22
SLIDE 22

IETF 74

Questions

22

slide-23
SLIDE 23

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

slide-24
SLIDE 24

IETF 74

Experimental Data 1

24

5000 10000 15000 20000 25000 30000 35000 1 2 3 4 5 Time(hours) CTP MultiHopLQI

slide-25
SLIDE 25

IETF 74

Experimental Data 2

25