Evaluation of an Algorithm used in
Routing and Service Discovery Protocols
of Wireless Sensor Networks
−
The Trickle Algorithm
Markus Becker
ComNets, TZI, University Bremen, Germany
Outline
IETF Protocol Stack for Wireless Sensor Networks Routing Protocol for Low power and Lossy Networks Trickle Algorithm
Simulation Analytical Model Evaluation
The Internet Engineering Task Force protocol stack for
Wireless Sensor Networks
The Internet Engineering Task Force protocol stack for
Wireless Sensor Networks
USB
802.15.
4
80
2.3
WSN node Border Router Node Border Router Host Internet Host
6LoWPAN: IPv6 over Low power Wireless Personal Area Network AM: Active Messaging
CoAP: Constrained Application Protocol IP: Internet Protocol
PPP: Point-to-Point Protocol
RPL: Routing Protocol for Low power and Lossy Networks TCP: Transmission Control Protocol
The Internet Engineering Task Force protocol stack for
Wireless Sensor Networks
PPP Interface USB 802.15. 4 80 2.3
WSN node Border Router Node Border Router Host Internet Host
6LoWPAN: IPv6 over Low power Wireless Personal Area Network AM: Active Messaging
CoAP: Constrained Application Protocol IP: Internet Protocol
MAC: Medium Access Control PHY: Physical Layer
PPP: Point-to-Point Protocol
RPL: Routing Protocol for Low power and Lossy Networks TCP: Transmission Control Protocol
UDP: User Datagram Protocol WSN: Wireless Sensor Network
The Internet Engineering Task Force protocol stack for
Wireless Sensor Networks
PPP Interface USB 802.15. 4 80 2.3
WSN node Border Router Node Proxy Internet Host
6LoWPAN: IPv6 over Low power Wireless Personal Area Network AM: Active Messaging
CoAP: Constrained Application Protocol IP: Internet Protocol
PPP: Point-to-Point Protocol
RPL: Routing Protocol for Low power and Lossy Networks TCP: Transmission Control Protocol
Routing Protocol for Low power and Lossy Networks
I IETF RFC 6206 and 6550...6554
I RFC 6206: The Trickle Algorithm
I RFC 6550: Routing Protocol RPL
I RFC 6551: Routing Metrics
I RFC 6552: Objective Function
I RFC 6553: IPv6 Option for RPL
I RFC 6554: IPv6 Routing Header for RPL
I Low power and Lossy Networks (LLN) consist Border
Router (BR), Router (R) and Host (H) nodes
I H choose only the default router
I RPL operates only within an LLN and terminates at BR
RPL: Upward Routes
I DIO: Destination-Oriented Directed Acyclic Graph
Information Object
I DIO announces upward routes (Routes to the BR)
Trickle Algorithm: Variables and Constants
I Variables
τ Communication interval length
T Timer value in range [τ /2,τ]
C Communication counter
I Constants
K Redundancy constant
τL Lowestτ
τH Highestτ
Note: Notation according to the original Trickle paper: P. Levis, N. Patel, D. Culler, S. Shenker: ’Trickle: A Self-Regulating Algorithm for Code Propagation and Maintenance in Wireless Sensor Networks’ in NSDI’04 Proceedings.
Trickle Algorithm: Rules
I τ expires
→Doubleτ, up toτH, pick a new T from range [τ /2,τ]
I T expires
→If C < K, transmit
I Received consistent data
→Increment C
I Received inconsistent data
Simulation Scenarios
I Line scenario with Closest
Pattern Matching Propagation Model (’Line-CPM’)
I Grid scenario (’Grid’)
I Varying number of nodes
I Varying inter-node
Simulation Execution
I TinyOS application with 6LoWPAN implementationblip
I Simulation toolTOSSIM
I blipextended for simulations
Analytical Models
I Number of Messages
Analytical Models
I Number of Messages
Trickle Algorithm
Trickle algorithm in Line-Direct scenario: τL 0 0. Hop 1. Hop 2. Hop 3. Hop
Analytical Model: Consistency Time
Modelling consistency time for the Line scenario
τL 2τL 3τL (1) τL 2τL 3τL 1 τL 2τL 3τL 1 τL 2τL 3τL 1 0. Hop: No Delay 1. Hop: Uniformly
distributed delay 2. Hop: Addition of 2 uniformly distributed delays -> Triangle 3. Hop: Addition of 1 uniformly distributed delay and triangle
Central limit theorem: mean of summation of i.i.d. random variables, each with finite mean and variance, will be approximately normally distributed
τL 2τL 3τL
(1/4)
1/4 1/4 1/4
τL 2τL 3τL
Analytical Model: Consistency Time
Modelling consistency time for the Line scenario
τL 2τL 3τL (1) τL 2τL 3τL 1 τL 2τL 3τL 1 τL 2τL 3τL 1 0. Hop: No Delay 1. Hop: Uniformly
distributed delay 2. Hop: Addition of 2 uniformly distributed delays -> Triangle 3. Hop: Addition of 1 uniformly distributed delay and triangle
Central limit theorem: mean of summation of i.i.d. random variables, each with finite mean and variance, will be approximately normally distributed
τL 2τL 3τL
(1/4)
1/4 1/4 1/4
Analytical Model: Consistency Time
The probability density function (pdf) of the time to consistency scenario can be modeled in detail by
p(t)= N1 N−1 P h=0 C−1 P c=0 N−1 P a=1 fh,c,a(t)·ph,c,a(t), where h: hops c: Trickle cycle
a: number of 1-hop ancestors closer to source N: total number of nodes
Analytical Model: Consistency Time
p(t)= N1 N−1 P h=0 C−1 P c=0 N−1 P a=1 fh,c,a(t)·ph,c,a(t), where fh,c,a=1(t)= δ(t) ,h=0, L−1{L{Θ(t−τL 2)−Θ(t−τL)}h} ,h≥1,c=0 Θ(t−τL·(2c+1−1)−τ2L ·2c) −Θ(t−τL·(2c+1−1)) ,h=1,c≥0 L−1{L{Θ(t−τL 2)−Θ(t−τL)}h−c· L{Θ(t−2τL)−Θ(t−3τL)}c} ,h>1,0<c<h.Θ(·)denotes the Heaviside step function. Ldenotes the
Laplace transform andL−1denotes the inverse Laplace
Analytical Model: Consistency Time
f
h,c,a(
t
)
0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 t [s] 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 p ( t ) Distributions ph,c,a(t) h=1, a=0 c= 0 1 2 3 4 0 2 4 6 8 10 12 14Time t [s]16 18 20 22 24 26 28 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 p ( t ) Distributions ph,c,a(t) c=0, a=0 h= 0 1 2 3 4 5 6 7 8Analytical Model: Consistency Time
f
h,c,a(
t
)
0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 Time t [s] 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 p ( t ) Distributions ph,c,a(t) c=0 h=0, a=0 h=0, a=1 h=0, a=2 h=1, a=0 h=1, a=1 h=1, a=2 h=2, a=0 h=2, a=1 h=2, a=2 h=3, a=0 h=3, a=1 h=3, a=2 h=4, a=0 h=4, a=1 h=4, a=2 h=5, a=0 h=5, a=1 h=5, a=2 h=6, a=0 h=6, a=1 h=6, a=2 h=7, a=0 h=7, a=1 h=7, a=2 h=8, a=0 h=8, a=1 h=8, a=2The distribution fora6=1
can be calculated from the cdf given by
1−(1−P(X ≤x))aof
Analytical Model: Consistency Time
f
h,c,a(
t
)
0 2 4 6 8 10 12 Time 14 t [s]16 18 20 22 24 26 28 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 p ( t ) Distributions ph,c,a(t) h=2, a=0 c= 0 1 2 3 4 5Figure:Probability Density Function
forh=2,a=0,cvaried 0 2 4 6 8 10 12 14Time t [s]16 18 20 22 24 26 28 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 p ( t ) Distributions ph,c,a(t) h=3, a=0 c= 0 1 2 3 4 5
Figure:Probability Density Function
Analytical Model: Consistency Time
p
h,c,a(t
)
PRR1 PRR1 PRR1 PRR2 PRR2 PRR3 0 20 40 60 Distance [m]80 100 120 140 160 180 0.00 0.05 0.10 0.20 0.30 0.40 0.50 0.60 0.70 0.80 0.90 0.951.00 PRRAlgorithm for Analytical Model
I calc_base_dists()I calc_prr() I calc_neigh(prr)
I calc_tx_outcomes(neighbors, prr)
I calc_hopcounts(prr, inject_node, trickle_k, neighbors, scenario)
I calc_hopcounts_next_cycles(hopcounts)
I calc_neighbors_hop_closer(hopcounts, prr, trickle_k) I calc_prob_mix_from_hopcount(hopcounts)
Simulation & Analytical Model: Parameters
The Trickle settings for the following results are:
I τL=2 s
I τH =32 s
Simulation & Analytical Model: Line 9, K = 1
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
No
de
s c
on
sis
te
nt
P ( T ≤ t )Model Time to Consistency (cdf)
(#Nodes: 9, K: 1)
Distance [m]
10
20
30
40
50
60
70
80
90
100
110
115
120
125
130
135
140
145
analytical
simulated
Simulation & Analytical Model: Line 9, K = 3
0 2 4 6 8 10 12 14 16 18 20 22 24 26 28
Model Time
t[s]
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
No
de
s c
on
sis
te
nt
P ( T ≤ t )Model Time to Consistency (cdf)
(#Nodes: 9, K: 3)
Distance [m]
10
20
30
40
50
60
70
80
90
100
110
115
120
125
130
135
140
145
analytical
simulated
Simulation & Analytical Model: Line 9, K = 9
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
No
de
s c
on
sis
te
nt
P ( T ≤ t )Model Time to Consistency (cdf)
(#Nodes: 9, K: 9)
Distance [m]
10
20
30
40
50
60
70
80
90
110
115
120
125
130
135
140
145
analytical
Simulation & Analytical Model: Line 16, K = 3
0 2 4 6 8 10 12 14 16 18 20 22 24 26 28
Model Time
t[s]
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
No
de
s c
on
sis
te
nt
P ( T ≤ t )Model Time to Consistency (cdf)
(#Nodes: 16, K: 3)
Distance [m]
10
20
30
40
50
60
70
80
90
100
110
115
120
125
130
135
140
145
analytical
simulated
Simulation & Analytical Model: Line 25, K = 3
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
No
de
s c
on
sis
te
nt
P ( T ≤ t )Model Time to Consistency (cdf)
(#Nodes: 25, K: 3)
Distance [m]
10
20
30
40
50
60
70
80
90
110
115
120
125
130
135
140
145
analytical
Simulation & Analytical Model: Grid 9, K = 3
0 2 4 6 8 10 12 14 16 18 20 22 24 26 28
Model Time
t[s]
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
No
de
s c
on
sis
te
nt
P ( T ≤ t )Model Time to Consistency (cdf)
(#Nodes: 9, K: 3)
Distance [m]
10
20
30
40
50
60
70
80
90
100
110
115
120
125
130
135
140
145
analytical
simulated
Simulation results and 95% confidence intervals
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 No de s c on sis te nt P ( T ≤ t ) 95 % Confidence IntervalModel Time to Consistency (cdf) (#Nodes: 9, K: 3) Distance [m] 10 20 30 40 50 60 70 80 90 100 110 115 120 125 130 135 140 145
Trickle/Push Comparison
Trickle Push
tpush= 3 s tpush= 5 s tpush= 39 s
t95% 29.4 s 27.9 s 36.4 s 169.1 s
tmax 34.9 s 33.0 s 47.0 s 240.5 s
Packets until consistent 176 714 196 415 Packets in steady state ≈2.61s 33.31s 201s 2.61s
I Trickle Settings: τL= 2s,τH = 32s,K=3
Conclusions & Outlook
I Conclusions
I Implemented and studied the Trickle algorithm
I Important algorithm for RPL and distribution of other information
I Distributes faster and more-efficient than fixed-interval pushing
I First analytical model of Trickle algorithm
I Model for delay distribution was shown here
I Model for number of sent packets exists as well
I Analytical delay model fits simulation results
I Outlook