idnits 2.17.1 draft-ietf-roll-trickle-00.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** You're using the IETF Trust Provisions' Section 6.b License Notice from 12 Sep 2009 rather than the newer Notice from 28 Dec 2009. (See https://trustee.ietf.org/license-info/) Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (March 23, 2010) is 5147 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- No issues found here. Summary: 1 error (**), 0 flaws (~~), 1 warning (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Networking Working Group P. Levis 3 Internet-Draft Stanford University 4 Intended status: Informational T. Clausen 5 Expires: September 24, 2010 LIX, Ecole Polytechnique 6 March 23, 2010 8 The Trickle Algorithm 9 draft-ietf-roll-trickle-00 11 Abstract 13 The Trickle algorithm allows wireless nodes to exchange information 14 in a highly robust, energy efficient, simple, and scalable manner. 15 Dynamically adjusting transmission windows allows Trickle to spread 16 new information on the scale of link-layer transmission times while 17 sending only a few messages per hour when information does not 18 change. A simple suppression nechanism and transmission point 19 selection allows Trickle's communication rate to scale 20 logarithmically with density. This document describes Trickle and 21 considerations in its use. 23 Status of this Memo 25 This Internet-Draft is submitted to IETF in full conformance with the 26 provisions of BCP 78 and BCP 79. 28 Internet-Drafts are working documents of the Internet Engineering 29 Task Force (IETF), its areas, and its working groups. Note that 30 other groups may also distribute working documents as Internet- 31 Drafts. 33 Internet-Drafts are draft documents valid for a maximum of six months 34 and may be updated, replaced, or obsoleted by other documents at any 35 time. It is inappropriate to use Internet-Drafts as reference 36 material or to cite them other than as "work in progress." 38 The list of current Internet-Drafts can be accessed at 39 http://www.ietf.org/ietf/1id-abstracts.txt. 41 The list of Internet-Draft Shadow Directories can be accessed at 42 http://www.ietf.org/shadow.html. 44 This Internet-Draft will expire on September 24, 2010. 46 Copyright Notice 48 Copyright (c) 2010 IETF Trust and the persons identified as the 49 document authors. All rights reserved. 51 This document is subject to BCP 78 and the IETF Trust's Legal 52 Provisions Relating to IETF Documents 53 (http://trustee.ietf.org/license-info) in effect on the date of 54 publication of this document. Please review these documents 55 carefully, as they describe your rights and restrictions with respect 56 to this document. Code Components extracted from this document must 57 include Simplified BSD License text as described in Section 4.e of 58 the Trust Legal Provisions and are provided without warranty as 59 described in the BSD License. 61 Table of Contents 63 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 64 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . 3 65 3. Trickle Algorithm Overview . . . . . . . . . . . . . . . . . . 3 66 4. Trickle Algorithm . . . . . . . . . . . . . . . . . . . . . . . 4 67 4.1. Parameters and Variables . . . . . . . . . . . . . . . . . 4 68 4.2. Algorithm Description . . . . . . . . . . . . . . . . . . . 5 69 5. Using Trickle . . . . . . . . . . . . . . . . . . . . . . . . . 6 70 6. Operational Considerations . . . . . . . . . . . . . . . . . . 6 71 6.1. Mismatched redundancy constants . . . . . . . . . . . . . . 6 72 6.2. Mismatched Imin . . . . . . . . . . . . . . . . . . . . . . 6 73 6.3. Mismatched Imax . . . . . . . . . . . . . . . . . . . . . . 7 74 6.4. Mismatched definitions . . . . . . . . . . . . . . . . . . 7 75 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 7 76 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 7 77 9. Security Considerations . . . . . . . . . . . . . . . . . . . . 7 78 10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 7 79 10.1. Normative References . . . . . . . . . . . . . . . . . . . 7 80 10.2. Informative References . . . . . . . . . . . . . . . . . . 8 81 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 8 83 1. Introduction 85 The Trickle algorithm is designed for wireless networks. It 86 establishes a density-aware local broadcast with an underlying 87 consistency model that guides when a node communicates. When a 88 node's data does not agree with its neighbors, it communicates 89 quickly to resolve the inconsistency. When nodes agree, they slow 90 their communicationrate exponentially, such that in a stable state 91 nodes send at most a few packets per hour. Instead of flooding a 92 network with packets, the algorithm controls the send rate so each 93 node hears a small trickle of packets, just enough to stay 94 consistent. Furthermore, by relying only on local broadcasts, 95 Trickle handles network re-population, is robust to network 96 transience, loss, and disconnection, and requires very little state 97 (implementations use 4-11 bytes). 99 While Trickle was originally designed for reprogramming protocols 100 (where the data is the code of the program being updated), experience 101 has shown it to be a powerful mechanism that can be applied to wide 102 range of protocol design problems. For example, routing protocols 103 such as RPL use Trickle to ensure that nodes in a given neighborhood 104 have consistent, loop-free routes. When the topology is consistent, 105 nodes occasionally gossip to check that they still agree, and when 106 the topology changes they gossip more frequently, until they reach 107 consistency again. 109 This document describes the Trickle algorithm and provides guidelines 110 for its use. It also states requirements for protocol specifications 111 that use Trickle. This document does not provide results on 112 Trickle's performance or behavior, nor does it explain the 113 algorithm's design in detail: interested readers should refer to 114 [Levis08]. 116 2. Terminology 118 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 119 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 120 "OPTIONAL" in this document are to be interpreted as described in RFC 121 2119 [RFC2119]. 123 3. Trickle Algorithm Overview 125 Trickle's basic primitive is simple: every so often, a mote transmits 126 code metadata if it has not heard a few other motes transmit the same 127 thing. This allows Trickle to scale to thousand-fold variations in 128 network density, quickly propagate updates, distribute transmission 129 load evenly, be robust to transient disconnections, handle network 130 repopulations, and impose a maintenance overhead on the order of a 131 few packets per hour. 133 Trickle sends all messages to the local broadcast address. There are 134 two possible results to a Trickle broadcast: either every mote that 135 hears the message is up to date, or a recipient detects the need for 136 an update. Detection can be the result of either an out-of-date mote 137 hearing someone has new code, or an updated mote hearing someone has 138 old code. As long as every mote communicates somehow - either 139 receives or transmits - the need for an update will be detected. 141 For example, consider a simple case where "up to date" is defined by 142 version numbers (e.g., network configuration). If node A broadcasts 143 that it has version V, but B has version V+1, then B knows that A 144 needs an update. Similarly, if B broadcasts that it has V+1, A knows 145 that it needs an update. If B broadcasts updates, then all of its 146 neighbors can receive them without having to advertise their need. 147 Some of these recipients might not even have heard A's transmission. 149 In this example, it does not matter who first transmits, A or B; 150 either case will detect the inconsistency. All that matters is that 151 some nodes communicate with one another at some nonzero rate. As 152 long as the network is connected and there is some minimum 153 communication rate for each node, the network will reach eventual 154 consistency. 156 The fact that communication can be either transmission or reception 157 enables Trickle to operate in sparse as well as dense networks. A 158 single, disconnected node must transmit at the communication rate. 159 In a lossless, single-hop network of size n, the sum of transmissions 160 over the network is the communication rate, so for each node it is 161 1/n. Sparser networks require more transmissions per mote, but 162 utilization of the radio channel over space will not increase. This 163 is an important property in wireless networks, where the channel is a 164 valuable shared resource. Additionally, reducing transmissions in 165 dense networks conserves system energy. 167 4. Trickle Algorithm 169 This section describes the Trickle algorithm. 171 4.1. Parameters and Variables 173 A Trickle timer has three configuration parameters: the minimum 174 interval size Imin, the maximum interval size Imax, and a redundancy 175 constant k: 177 o The minimum interval size is defined in units of time (e.g., 178 milliseconds, seconds). For example, a protocol might define the 179 minimum interval as 100 milliseconds. 181 o The maximum interval size is described as a number of doublings of 182 the minimum interval size (the base-2 log(max/min)). For example, 183 a protocol might define the maximum interval as 16. If the 184 minimum interval is 100ms, then the maximum interval is 100ms * 185 65536, 6,553.6 seconds, or approximately 109 minutes. 187 o The redundancy constant is a natural number (an integer greater 188 than zero). 190 In addition to these three parameters, Trickle maintains three 191 variables: 193 o I, the current interval size 195 o t, a time within the current interval, and 197 o c, a counter. 199 4.2. Algorithm Description 201 The Trickle algorithm has five rules: 203 1. When an interval begins, Trickle resets c to 0 and sets t to a 204 random point in the interval, taken from the range [I/2, I). 206 2. Whenever Trickle hears a transmission that is "consistent," it 207 increments counter c. 209 3. At time t, Trickle transmits if and only if counter c is less 210 than the redundancy constant k. 212 4. When an interval expires, Trickle doubles the interval length. 213 If this new interval length would be longer than Imax, Trickle 214 sets the interval length I to be Imax. 216 5. If Trickle hears a transmission that is "inconsistent" and I is 217 greater than Imin, Trickle resets I to Imin, and begins a new 218 interval. 220 The terms consistent and inconsistent are in quotes because their 221 meaning depends on the use of Trickle. 223 5. Using Trickle 225 A protocol specification that uses Trickle should specify: 227 o Default values for Imin, Imax, and k. Because link layers can 228 vary widely in their properties, the default value of Imin should 229 be specified in terms of the worst-case latency of a link layer 230 transmission. For example, a specification should say "the 231 default value of Imin is 4 times the worst case link layer 232 latency" and should not say "the default value of Imin is 500 233 milliseconds." Worst case latency is the time until the first 234 link-layer transmission of the frame assuming an idle channel 235 (does not include backoff, virtual carrier sense, etc.). 237 o What constitutes a "consistent" transmission. 239 o What constitutes an "inconsistent" transmission. 241 6. Operational Considerations 243 It is RECOMMENDED that a protocol which uses Trickle include 244 mechanisms to inform nodes of configuration parameters at runtime. 245 However, it is not always possible to do so. In the cases where 246 different nodes have different configuration parameters, Trickle may 247 have unintended behaviors. This section outlines some of those 248 behaviors as an educational exercise. 250 6.1. Mismatched redundancy constants 252 If nodes do not agree on the redundancy constant k, then nodes with 253 higher values of k will transmit more often than nodes with lower 254 values of k. In some cases, this increased load can be independent 255 of the density. For example, consider a network where all nodes but 256 one have k=1, and this one node has k=2. The different node can end 257 up transmitting on every interval: it is maintaining a communication 258 rate of 2 with only itself. Hence, the danger of mismatched k values 259 is uneven transmission load that can deplete the energy of some 260 nodes. 262 6.2. Mismatched Imin 264 If nodes do not agree on Imin, then some nodes, on hearing 265 inconsistent messages, will transmit sooner than others. These 266 faster nodes will have their intervals grow to similar size as the 267 slower nodes within a single slow interval time, but in that period 268 may suppress the slower nodes. However, such suppression will end 269 after the first slow interval, when the nodes generally agree on the 270 interval size. Hence, mismatched Imin values are usually not a 271 significant concern. 273 6.3. Mismatched Imax 275 If nodes do not agree on Imax, then this can cause long-term problems 276 with transmission load. Nodes with small Imax values will transmit 277 faster, suppressing those with larger Imax values. The nodes will 278 larger Imax values, always suppressed, will never transmit. In the 279 base case, when the network is consistent, this can cause long-term 280 inequities in energy cost. 282 6.4. Mismatched definitions 284 If nodes do not agree on what constitutes a consistent or 285 inconsistent transmission, then Trickle may fail to operate properly. 286 For example, if a receiver thinks a transmission is consistent, but 287 the transmitter (if in the receivers situation) would have thought it 288 inconsistent, then the receiver will not respond properly and inform 289 the transmitter. This can lead the network to not reach a consistent 290 state. For this reason, unlike the configuration constants k, Imin, 291 and Imax, consistency definitions should be clearly stated in the 292 protocol and should not be configured at runtime. 294 7. Acknowledgements 296 8. IANA Considerations 298 This document has no IANA considerations.. 300 9. Security Considerations 302 This document has no security considerations. 304 10. References 306 10.1. Normative References 308 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 309 Requirement Levels", BCP 14, RFC 2119, March 1997. 311 10.2. Informative References 313 [Levis08] Levis, P., Brewer, E., Culler, D., Gay, D., Madden, S., 314 Patel, N., Polastre, J., Shenker, S., Szewczyk, R., and A. 315 Woo, "The Emergence of a Networking Primitive in Wireless 316 Sensor Networks", Communications of the ACM, v.51 n.7, 317 July 2008, 318 . 320 Authors' Addresses 322 Philip Levis 323 Stanford University 324 358 Gates Hall, Stanford University 325 Stanford, CA 94305 326 USA 328 Phone: +1 650 725 9064 329 Email: pal@cs.stanford.edu 331 Thomas Heide Clausen 332 LIX, Ecole Polytechnique 334 Phone: +33 6 6058 9349 335 Email: T.Clausen@computer.org