idnits 2.17.1 draft-ietf-6tisch-msf-07.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. 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 (October 17, 2019) is 1646 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Looks like a reference, but probably isn't: '1' on line 617 -- Looks like a reference, but probably isn't: '3' on line 617 -- Looks like a reference, but probably isn't: '4' on line 617 -- Looks like a reference, but probably isn't: '2' on line 617 -- Looks like a reference, but probably isn't: '0' on line 617 -- Looks like a reference, but probably isn't: '5' on line 617 -- Looks like a reference, but probably isn't: '6' on line 617 -- Looks like a reference, but probably isn't: '7' on line 617 -- Looks like a reference, but probably isn't: '9' on line 617 == Outdated reference: A later version (-30) exists of draft-ietf-6tisch-architecture-26 ** Downref: Normative reference to an Informational draft: draft-ietf-6tisch-architecture (ref. 'I-D.ietf-6tisch-architecture') ** Downref: Normative reference to an Informational draft: draft-ietf-6tisch-dtsecurity-zerotouch-join (ref. 'I-D.ietf-6tisch-dtsecurity-zerotouch-join') == Outdated reference: A later version (-15) exists of draft-ietf-6tisch-minimal-security-12 ** Downref: Normative reference to an Informational draft: draft-richardson-6tisch-join-enhanced-beacon (ref. 'I-D.richardson-6tisch-join-enhanced-beacon') -- Possible downref: Non-RFC (?) normative reference: ref. 'IEEE802154-2015' Summary: 3 errors (**), 0 flaws (~~), 3 warnings (==), 11 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 6TiSCH T. Chang, Ed. 3 Internet-Draft M. Vucinic 4 Intended status: Standards Track Inria 5 Expires: April 19, 2020 X. Vilajosana 6 Universitat Oberta de Catalunya 7 S. Duquennoy 8 RISE SICS 9 D. Dujovne 10 Universidad Diego Portales 11 October 17, 2019 13 6TiSCH Minimal Scheduling Function (MSF) 14 draft-ietf-6tisch-msf-07 16 Abstract 18 This specification defines the 6TiSCH Minimal Scheduling Function 19 (MSF). This Scheduling Function describes both the behavior of a 20 node when joining the network, and how the communication schedule is 21 managed in a distributed fashion. MSF builds upon the 6TiSCH 22 Operation Sublayer Protocol (6P) and the Minimal Security Framework 23 for 6TiSCH. 25 Requirements Language 27 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 28 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 29 "OPTIONAL" in this document are to be interpreted as described in 30 [RFC2119]. 32 Status of This Memo 34 This Internet-Draft is submitted in full conformance with the 35 provisions of BCP 78 and BCP 79. 37 Internet-Drafts are working documents of the Internet Engineering 38 Task Force (IETF). Note that other groups may also distribute 39 working documents as Internet-Drafts. The list of current Internet- 40 Drafts is at https://datatracker.ietf.org/drafts/current/. 42 Internet-Drafts are draft documents valid for a maximum of six months 43 and may be updated, replaced, or obsoleted by other documents at any 44 time. It is inappropriate to use Internet-Drafts as reference 45 material or to cite them other than as "work in progress." 47 This Internet-Draft will expire on April 19, 2020. 49 Copyright Notice 51 Copyright (c) 2019 IETF Trust and the persons identified as the 52 document authors. All rights reserved. 54 This document is subject to BCP 78 and the IETF Trust's Legal 55 Provisions Relating to IETF Documents 56 (https://trustee.ietf.org/license-info) in effect on the date of 57 publication of this document. Please review these documents 58 carefully, as they describe your rights and restrictions with respect 59 to this document. Code Components extracted from this document must 60 include Simplified BSD License text as described in Section 4.e of 61 the Trust Legal Provisions and are provided without warranty as 62 described in the Simplified BSD License. 64 Table of Contents 66 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 67 2. Interface to the Minimal 6TiSCH Configuration . . . . . . . . 4 68 3. Autonomous Cells . . . . . . . . . . . . . . . . . . . . . . 4 69 4. Node Behavior at Boot . . . . . . . . . . . . . . . . . . . . 6 70 4.1. Start State . . . . . . . . . . . . . . . . . . . . . . . 6 71 4.2. Step 1 - Choosing Frequency . . . . . . . . . . . . . . . 6 72 4.3. Step 2 - Receiving EBs . . . . . . . . . . . . . . . . . 6 73 4.4. Step 3 - Setting up Autonomous Cells for the Join Process 7 74 4.5. Step 4 - Acquiring a RPL Rank . . . . . . . . . . . . . . 7 75 4.6. Step 5 - Setting up first Tx negotiated Cells . . . . . . 7 76 4.7. Step 6 - Send EBs and DIOs . . . . . . . . . . . . . . . 8 77 4.8. Step 7 - Neighbor Polling . . . . . . . . . . . . . . . . 8 78 4.9. End State . . . . . . . . . . . . . . . . . . . . . . . . 8 79 5. Rules for Adding/Deleting Cells . . . . . . . . . . . . . . . 8 80 5.1. Adapting to Traffic . . . . . . . . . . . . . . . . . . . 9 81 5.2. Switching Parent . . . . . . . . . . . . . . . . . . . . 11 82 5.3. Handling Schedule Collisions . . . . . . . . . . . . . . 11 83 6. 6P SIGNAL command . . . . . . . . . . . . . . . . . . . . . . 12 84 7. Scheduling Function Identifier . . . . . . . . . . . . . . . 12 85 8. Rules for CellList . . . . . . . . . . . . . . . . . . . . . 12 86 9. 6P Timeout Value . . . . . . . . . . . . . . . . . . . . . . 13 87 10. Rule for Ordering Cells . . . . . . . . . . . . . . . . . . . 13 88 11. Meaning of the Metadata Field . . . . . . . . . . . . . . . . 14 89 12. 6P Error Handling . . . . . . . . . . . . . . . . . . . . . . 14 90 13. Schedule Inconsistency Handling . . . . . . . . . . . . . . . 14 91 14. MSF Constants . . . . . . . . . . . . . . . . . . . . . . . . 15 92 15. MSF Statistics . . . . . . . . . . . . . . . . . . . . . . . 15 93 16. Security Considerations . . . . . . . . . . . . . . . . . . . 15 94 17. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 16 95 17.1. MSF Scheduling Function Identifiers . . . . . . . . . . 16 96 18. References . . . . . . . . . . . . . . . . . . . . . . . . . 16 97 18.1. Normative References . . . . . . . . . . . . . . . . . . 16 98 18.2. Informative References . . . . . . . . . . . . . . . . . 17 99 Appendix A. Contributors . . . . . . . . . . . . . . . . . . . . 17 100 Appendix B. Example of Implementation of SAX hash function . . . 17 101 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 18 103 1. Introduction 105 The 6TiSCH Minimal Scheduling Function (MSF), defined in this 106 specification, is a 6TiSCH Scheduling Function (SF). The role of an 107 SF is entirely defined in [RFC8480]. This specification complements 108 [RFC8480] by providing the rules of when to add/delete cells in the 109 communication schedule. This specification satisfies all the 110 requirements for an SF listed in Section 4.2 of [RFC8480]. 112 MSF builds on top of the following specifications: the Minimal IPv6 113 over the TSCH Mode of IEEE 802.15.4e (6TiSCH) Configuration 114 [RFC8180], the 6TiSCH Operation Sublayer Protocol (6P) [RFC8480], and 115 the Minimal Security Framework for 6TiSCH 116 [I-D.ietf-6tisch-minimal-security]. 118 MSF defines both the behavior of a node when joining the network, and 119 how the communication schedule is managed in a distributed fashion. 120 When a node running MSF boots up, it joins the network by following 121 the 6 steps described in Section 4. The end state of the join 122 process is that the node is synchronized to the network, has mutually 123 authenticated to the network, has identified a preferred routing 124 parent, and has scheduled one default negotiated cell (defined in 125 Section 5.1) to/from its preferred routing parent. After the join 126 process, the node can continuously add/delete/relocate cells, as 127 described in Section 5. It does so for 3 reasons: to match the link- 128 layer resources to the traffic, to handle changing parent, to handle 129 a schedule collision. 131 MSF is designed to operate in a wide range of application domains. 132 It is optimized for applications with regular upstream traffic (from 133 the nodes to the root). 135 This specification follows the recommended structure of an SF 136 specification, given in Appendix A of [RFC8480], with the following 137 adaptations: 139 o We have reordered some sections, in particular to have the section 140 on the node behavior at boot (Section 4) appear early in this 141 specification. 142 o We added sections on the interface to the minimal 6TiSCH 143 configuration (Section 2), the use of the SIGNAL command 144 (Section 6), the MSF constants (Section 14), the MSF statistics 145 (Section 15). 147 2. Interface to the Minimal 6TiSCH Configuration 149 A node implementing MSF SHOULD implement the Minimal 6TiSCH 150 Configuration [RFC8180], which defines the "minimal cell", a single 151 shared cell providing minimal connectivity between the nodes in the 152 network. The MSF implementation provided in this specification is 153 based on the implementation of the Minimal 6TiSCH Configuration. 154 However, an implementor MAY implement MSF without implementing 155 Minimal 6TiSCH Configuration. 157 MSF uses the minimal cell to exchange the following packets: 159 1. Enhanced Beacons (EBs), defined by [IEEE802154-2015]. These are 160 broadcast frames. 161 2. Broadcast DODAG Information Objects (DIOs), defined by [RFC6550]. 162 Unicast DIOs SHOULD NOT be sent on minimal cell. 164 To ensure there is enough bandwidth available on the minimal cell, a 165 node implementing MSF SHOULD enforce some rules for limiting the 166 traffic of broadcast frames. For example, a Trickle Timer defined in 167 [RFC6550] MAY be applied on DIOs. However, this behavior is 168 implementation-specific which is out of the scope of MSF. 170 MSF RECOMMENDS the use of 3 slotframes. MSF schedules autonomous 171 cells at Slotframe 1 (Section 3) and 6P negotiated cells at Slotframe 172 2 (Section 5) , while Slotframe 0 is used for the bootstrap traffic 173 as defined in the Minimal 6TiSCH Configuration. It is RECOMMENDED to 174 use the same slotframe length for Slotframe 0, 1 and 2. Thus it is 175 possible to avoid the scheduling collision between the autonomous 176 cells and 6P negotiated cells (Section 3). The default slotframe 177 length (SLOTFRAME_LENGTH) is RECOMMENDED for Slotframe 0, 1 and 2, 178 although any value can be advertised in the EBs. 180 3. Autonomous Cells 182 MSF nodes initialize Slotframe 1 with a set of default cells for 183 unicast communication with their neighbors. These cells are called 184 'autonomous cells', because they are maintained autonomously by each 185 node without negotiation through 6P. Cells scheduled by 6P 186 transaction are called 'negotiated cells' which are reserved on 187 Slotframe 2. How to schedule negotiated cells is detailed in 188 Section 5. There are two types of autonomous cells: 190 o Autonomous Rx Cell (AutoRxCell), one cell at a 191 [slotOffset,channelOffset] computed as a hash of the EUI64 of the 192 node itself (detailed next). Its cell options bits are assigned 193 as TX=0, RX=1, SHARED=0. 194 o Autonomous Tx Cell (AutoTxCell), one cell at a 195 [slotOffset,channelOffset] computed as a hash of the layer 2 EUI64 196 destination address in the frame to be transmitted (detailed in 197 Section 4.4). Its cell options bits are assigned as TX=1, RX=0, 198 SHARED=1. 200 To compute a [slotOffset,channelOffset] from an EUI64 address, nodes 201 MUST use the hash function SAX [SAX-DASFAA]. The coordinates are 202 computed to distribute the cells across all channel offsets, and all 203 but the first time offsets of Slotframe 1. The first time offset is 204 skipped to avoid colliding with the minimal cell in Slotframe 0. The 205 slot coordinates derived from a given EUI64 address are computed as 206 follows: 208 o slotOffset(MAC) = 1 + hash(EUI64, length(Slotframe_1) - 1) 209 o channelOffset(MAC) = hash(EUI64, NUM_CH_OFFSET) 211 The second input parameter defines the maximum return value of the 212 hash function. Other optional parameters defined in SAX determine 213 the performance of SAX hash function. Those parameters could be 214 broadcasted in EB frame or pre-configured. For interoperability 215 purposes, an example how the hash function is implemented is detailed 216 in Appendix B. 218 AutoTxCell is not permanently installed in the schedule but added/ 219 deleted on demand when there is a frame to sent. Throughout the 220 network lifetime, nodes maintain the autonomous cells as follows: 222 o Add an AutoTxCell to the layer 2 destination address which is 223 indicated in a frame when there is no 6P negotiated Tx cell in 224 schedule for that frame to transmit. 225 o Remove an AutoTxCell when: 227 * there is no frame to transmit on that cell, or 228 * there is at least one 6P negotiated Tx cell in the schedule for 229 the frames to transmit. 230 o The AutoRxCell MUST always remain scheduled after synchronized. 231 o 6P CLEAR MUST NOT erase any autonomous cells. 233 Because of hash collisions, there will be cases that the AutoTxCell 234 and AutoRxCell are scheduled at the same slot offset and/or channel 235 offset. In such cases, AutoTxCell always take precedence over 236 AutoRxCell. In case of conflicting with a negotiated cell, 237 autonomous cells take precedence over negotiated cell, which is 238 stated in [IEEE802154-2015]. However, when the Slotframe 0, 1 and 2 239 use the same length value, it is possible for negotiated cell to 240 avoid the collision with AutoRxCell. 242 4. Node Behavior at Boot 244 This section details the behavior the node SHOULD follow from the 245 moment it is switched on, until it has successfully joined the 246 network. Section 4.1 details the start state; Section 4.9 details 247 the end state. The other sections detail the 6 steps of the joining 248 process. We use the term "pledge" and "joined node", as defined in 249 [I-D.ietf-6tisch-minimal-security]. 251 4.1. Start State 253 A node implementing MSF SHOULD implement the Minimal Security 254 Framework for 6TiSCH [I-D.ietf-6tisch-minimal-security]. As a 255 corollary, this means that a pledge, before being switched on, may be 256 pre-configured with the Pre-Shared Key (PSK) for joining, as well as 257 any other configuration detailed in 258 ([I-D.ietf-6tisch-minimal-security]). This is not necessary if the 259 node implements a security solution not based on PSKs, such as 260 ([I-D.ietf-6tisch-dtsecurity-zerotouch-join]). 262 4.2. Step 1 - Choosing Frequency 264 When switched on, the pledge SHOULD randomly choose a frequency among 265 the available frequencies, and start listening for EBs on that 266 frequency. 268 4.3. Step 2 - Receiving EBs 270 Upon receiving the first EB, the pledge SHOULD continue listening for 271 additional EBs to learn: 273 1. the number of neighbors N in its vicinity 274 2. which neighbor to choose as a Join Proxy (JP) for the joining 275 process 277 While the exact behavior is implementation-specific, it is 278 RECOMMENDED that after having received the first EB, a node keeps 279 listen for at most MAX_EB_DELAY seconds until it has received EBs 280 from NUM_NEIGHBOURS_TO_WAIT distinct neighbors, which is defined in 281 [RFC8180]. 283 During this step, the pledge SHOULD NOT synchronize until it received 284 enough EB from the network it wishes to join. How to decide whether 285 an EB originates from a node from the network it wishes to join is 286 implementation-specific, but MAY involve filtering EBs by the PAN ID 287 field it contains, the presence and contents of the IE defined in 288 [I-D.richardson-6tisch-join-enhanced-beacon], or the key used to 289 authenticate it. 291 The decision of which neighbor to use as a JP is implementation- 292 specific, and discussed in [I-D.ietf-6tisch-minimal-security]. 294 4.4. Step 3 - Setting up Autonomous Cells for the Join Process 296 After selected a JP, a node generates a Join Request and installs an 297 AutoTxCell to the JP. The Join Request is then sent by the pledge to 298 its JP over the AutoTxCell. The AutoTxCell is removed by the pledge 299 when the Join Request is sent out. The JP receives the Join Request 300 through its AutoRxCell. Then it forwards the Join Request to the 301 JRC, possibly over multiple hops, over the 6P negotiated Tx cells. 302 Similarly, the JRC sends the Join Response to the JP, possibly over 303 multiple hops, over AutoTxCells or the 6P negotiated Tx cells. When 304 JP received the Join Response from the JRC, it installs an AutoTxCell 305 to the pledge and sends that Join Response to the pledge over 306 AutoTxCell. The AutoTxCell is removed by the JP when the Join 307 Response is sent out. The pledge receives the Join Response from its 308 AutoRxCell, thereby learns the keying material used in the network, 309 as well as other configurations, and becomes a "joined node". 311 When 6LoWPAN Neighbor Dicovery ([RFC8505]) (ND) is implemented, the 312 unicast packets used by ND are sent on the AutoTxCell. The specific 313 process how the ND works during the Join process is detailed in 314 [I-D.ietf-6tisch-architecture]. 316 4.5. Step 4 - Acquiring a RPL Rank 318 Per [RFC6550], the joined node receives DIOs, computes its own Rank, 319 and selects a preferred parent. 321 4.6. Step 5 - Setting up first Tx negotiated Cells 323 After selected a preferred parent, the joined node MUST generate a 6P 324 ADD Request and install an AutoTxCell to that parent. The 6P ADD 325 Request is sent out through the AutoTxCell with the following fields: 327 o CellOptions: set to TX=1,RX=0,SHARED=0 328 o NumCells: set to 1 329 o CellList: at least 5 cells, chosen according to Section Section 8 331 The joined node removes the AutoTxCell to parent when the 6P Request 332 is send out. Its parent receives the 6P ADD Request from its 333 AutoRxCell. Then it generates a 6P ADD Response and installs an 334 AutoTxCell to the joined node. When the parent sends out the 6P ADD 335 Response, it MUST remove that AutoTxCell. The joined node receives 336 the 6P ADD Response from its AutoRxCell and completes the 6P 337 transcation. In case the 6P ADD transaction failed, the node MUST 338 issue another 6P ADD Request and repeat until the Tx cell is 339 installed to the parent. 341 4.7. Step 6 - Send EBs and DIOs 343 The node SHOULD start sending EBs and DIOs on the minimal cell, while 344 following the transmit rules for broadcast frames from Section 2. 346 4.8. Step 7 - Neighbor Polling 348 The node SHOULD send some form of keep-alive messages to all its 349 neighbors it has negotiated cell with. The node sends a keep-alive 350 message to the neighbor if no frames is received from that neighbor 351 within a period, which is defined as KA_PERIOD. This mechanism is 352 used to poll its children to ensure the child is still reachable. If 353 the keep-alive message to a child fails at the link layer (i.e. the 354 maximum number of link-layer retries is reached), the node SHOULD 355 declare the child as unreachable. This can happen for example when 356 the child node is switched off. 358 When a neighbor is declared unreachable, the node MUST remove all 359 negotiated cells with that neighbor from its own schedule. In 360 addition, it MAY issue a 6P CLEAR to that neighbor (which can fail at 361 the link-layer). The node MAY be removed from the neighbor table. 363 4.9. End State 365 For a new node, the end state of the joining process is: 367 o it is synchronized to the network 368 o it is using the link-layer keying material it learned through the 369 secure joining process 370 o it has identified its preferred routing parent 371 o it has one AutRxCell 372 o it has one negotiated Tx cell to its parent 373 o it starts to send DIOs, potentially serving as a router for other 374 nodes' traffic 375 o it starts to send EBs, potentially serving as a JP for new pledge 377 5. Rules for Adding/Deleting Cells 379 Once a node has joined the 6TiSCH network, it adds/deletes/relocates 380 cells with its preferred parent for three reasons: 382 o to match the link-layer resources to the traffic between the node 383 and its preferred parent (Section 5.1) 384 o to handle switching preferred parent or(Section 5.2) 385 o to handle a schedule collision (Section 5.3) 387 Those cells are called 'negotiated cells' as they are scheduled 388 through 6P, negotiated with their parents. Without specific 389 declaring, all cells mentioned in this section are negotiated cells 390 and they are installed at Slotframe 2. 392 5.1. Adapting to Traffic 394 A node implementing MSF MUST implement the behavior described in this 395 section. 397 The goal of MSF is to manage the communication schedule in the 6TiSCH 398 schedule in a distributed manner. For a node, this translates into 399 monitoring the current usage of the cells it has to its preferred 400 parent: 402 o If the node determines that the number of link-layer frames it is 403 attempting to exchange with its preferred parent per unit of time 404 is larger than the capacity offered by the TSCH negotiated cells 405 it has scheduled with it, the node issues a 6P ADD command to its 406 preferred parent to add cells to the TSCH schedule. 407 o If the traffic is lower than the capacity, the node issues a 6P 408 DELETE command to its preferred parent to delete cells from the 409 TSCH schedule. 411 The node MUST maintain the following counters for its preferred 412 parent: 414 NumCellsElapsed : Counts the number of negotiated cells that have 415 elapsed since the counter was initialized. This counter is 416 initialized at 0. When the current cell is declared as a 417 negotiated cell to the preferred parent, NumCellsElapsed is 418 incremented by exactly 1, regardless of whether the cell is used 419 to transmit/receive a frame. 420 NumCellsUsed: Counts the number of negotiated cells that have been 421 used. This counter is initialized at 0. NumCellsUsed is 422 incremented by exactly 1 when, during a negotiated cell to the 423 preferred parent, either of the following happens: 425 * The node sends a frame to its preferred parent. The counter 426 increments regardless of whether a link-layer acknowledgment 427 was received or not. 429 * The node receives a frame from its preferred parent. The 430 counter increments regardless of whether the frame is a valid 431 IEEE802.15.4 frame or not. 433 The cell option of the cell listed CellList in 6P Request SHOULD be 434 either Tx=1 only or Rx=1 only. Both NumCellsElapsed and NumCellsUsed 435 counters can be used to both type of negotiated cells. 437 As there is no negotiated Rx Cell installed at initial, the AutRxCell 438 is taken into account as well for downstream traffic adaptation. 439 Hence by default, each node at least has one Rx cell in schedule for 440 counting the NumCellsElapsed and NumCellsUsed of dwonstream traffic. 442 Implementors MAY choose to create the same counters for each 443 neighbor, and add them as additional statistics in the neighbor 444 table. 446 The counters are used as follows: 448 1. Both NumCellsElapsed and NumCellsUsed are initialized to 0 when 449 the node boots. 450 2. When the value of NumCellsElapsed reaches MAX_NUMCELLS: 452 * If NumCellsUsed > LIM_NUMCELLSUSED_HIGH, trigger 6P to add a 453 single cell to the preferred parent 454 * If NumCellsUsed < LIM_NUMCELLSUSED_LOW, trigger 6P to remove a 455 single cell to the preferred parent 456 * Reset both NumCellsElapsed and NumCellsUsed to 0 and go to 457 step 2. 459 The value of MAX_NUMCELLS is chosen according to the traffic type of 460 the network. Generally speaking, the larger the value MAX_NUMCELLS 461 is, the more accurate the cell usage is calculated. The 6P traffic 462 overhead using a larger value of MAX_NUMCELLS could be reduced as 463 well. Meanwhile, the latency won't increaase much by using a larger 464 value of MAX_NUMCELLS for periodic traffic type. For burst traffic 465 type, larger value of MAX_NUMCELLS indeed introduces higher latency. 466 The latency caused by slight changes of traffic load can be absolved 467 by the additional scheduled cells. In this sense, MSF is a 468 scheduling function trading latency with energy by scheduling more 469 cells than needed. It is recommended to set MAX_NUMCELLS value at 470 least 4 times than the maximum link traffic load of the network in 471 packets per slotframe. For example, a 2 packets/slotframe traffic 472 load results an average 4 cells scheduled, using the value of double 473 number of scheduled cells (which is 8) as MAX_NUMCELLS gives a good 474 resolution on cell usage calculation. 476 5.2. Switching Parent 478 A node implementing MSF SHOULD implement the behavior described in 479 this section. 481 Part of its normal operation, the RPL routing protocol can have a 482 node switch preferred parent. The procedure for switching from the 483 old preferred parent to the new preferred parent is: 485 1. the node counts the number of negotiated cells it has per 486 slotframe to the old preferred parent 487 2. the node triggers one or more 6P ADD commands to schedule the 488 same number of negotiated cells with same cell options to the new 489 preferred parent 490 3. when that successfully completes, the node issues a 6P CLEAR 491 command to its old preferred parent 493 5.3. Handling Schedule Collisions 495 A node implementing MSF SHOULD implement the behavior described in 496 this section. The "MUST" statements in this section hence only apply 497 if the node implements schedule collision handling. 499 Since scheduling is entirely distributed, there is a non-zero 500 probability that two pairs of nearby neighbor nodes schedule a 501 negotiated cell at the same [slotOffset,channelOffset] location in 502 the TSCH schedule. In that case, data exchanged by the two pairs may 503 collide on that cell. We call this case a "schedule collision". 505 The node MUST maintain the following counters for each managed 506 unicast cell to its preferred parent: 508 NumTx: Counts the number of transmission attempts on that cell. 509 Each time the node attempts to transmit a frame on that cell, 510 NumTx is incremented by exactly 1. 511 NumTxAck: Counts the number of successful transmission attempts on 512 that cell. Each time the node receives an acknowledgment for a 513 transmission attempt, NumTxAck is incremented by exactly 1. 515 Implementors MAY choose to maintain the same counters for each 516 negotiated cell in the schedule. 518 Since both NumTx and NumTxAck are initialized to 0, we necessarily 519 have NumTxAck <= NumTx. We call Packet Delivery Ratio (PDR) the 520 ratio NumTxAck/NumTx; and represent it as a percentage. A cell with 521 PDR=50% means that half of the frames transmitted are not 522 acknowledged (and need to be retransmitted). 524 Each time the node switches preferred parent (or during the join 525 process when the node selects a preferred parent for the first time), 526 both NumTx and NumTxAck MUST be reset to 0. They increment over 527 time, as the schedule is executed and the node sends frames to its 528 preferred parent. When NumTx reaches MAX_NUMTX, both NumTx and 529 NumTxAck MUST be divided by 2. That is, for example, from NumTx=256 530 and NumTxAck=128, they become NumTx=128 and NumTxAck=64. This 531 operation does not change the value of the PDR, but allows the 532 counters to keep incrementing. The value of MAX_NUMTX is 533 implementation-specific. 535 The key for detecting a schedule collision is that, if a node has 536 several cells to the same preferred parent, all cells should exhibit 537 the same PDR. A cell which exhibits a PDR significantly lower than 538 the others indicates than there are collisions on that cell. 540 Every HOUSEKEEPINGCOLLISION_PERIOD, the node executes the following 541 steps: 543 1. It computes, for each managed unicast cell with its preferred 544 parent (not for the autonomous cell), that cell's PDR. 545 2. Any cell that hasn't yet had NumTx divided by 2 since it was last 546 reset is skipped in steps 3 and 4. This avoids triggering cell 547 relocation when the values of NumTx and NumTxAck are not 548 statistically significant yet. 549 3. It identifies the cell with the highest PDR. 550 4. For any other cell, it compares its PDR against that of the cell 551 with the highest PDR. If the difference is larger than 552 RELOCATE_PDRTHRES, it triggers the relocation of that cell using 553 a 6P RELOCATE command. 555 6. 6P SIGNAL command 557 The 6P SIGNAL command is not used by MSF. 559 7. Scheduling Function Identifier 561 The Scheduling Function Identifier (SFID) of MSF is 562 IANA_6TISCH_SFID_MSF. 564 8. Rules for CellList 566 MSF uses 2-step 6P Transactions exclusively. 6P Transactions are 567 only initiated by a node towards its preferred parent. As a result, 568 the cells to put in the CellList of a 6P ADD command, and in the 569 candidate CellList of a RELOCATE command, are chosen by the node 570 initiating the 6P Transaction. In both cases, the same rules apply: 572 o The CellList is RECOMMENDED to have 5 or more cells. 573 o Each cell in the CellList MUST have a different slotOffset value. 574 o For each cell in the CellList, the node MUST NOT have any 575 scheduled cell on the same slotOffset. 576 o The slotOffset value of any cell in the CellList MUST NOT be the 577 same as the slotOffset of the minimal cell (slotOffset=0). 578 o The slotOffset of a cell in the CellList SHOULD be randomly and 579 uniformly chosen among all the slotOffset values that satisfy the 580 restrictions above. 581 o The channelOffset of a cell in the CellList SHOULD be randomly and 582 uniformly chosen in [0..numFrequencies], where numFrequencies 583 represents the number of frequencies a node can communicate on. 585 As a consequence of randomly cell selection, there is a non-zero 586 chance that nodes in the vicinity installed cells with same 587 slotOffset and channelOffset. An implementer MAY implement a 588 strategy to monitor the candidate cells before adding them in 589 CellList to avoid collision. For example, a node MAY maintain a 590 candidate cell pool for the CellList. The candidate cells in the 591 pool are pre-configured as Rx cells to promiscuously listen to detect 592 transmissions on those cells. If IEEE802.15.4 transmissions are 593 observed on one cell over multiple iterations of the schedule, that 594 cell is probably used by a TSCH neighbor. It is moved out from the 595 pool and a new cell is selected as a candidate cell. The cells in 596 CellList are picked from the candidate pool directly when required. 598 9. 6P Timeout Value 600 It is calculated for the worst case that a 6P response is received, 601 which means the 6P response is sent out successfully at the very 602 latest retransmission. And for each retransmission, it backs-off 603 with largest value. Hence the 6P timeout value is calculated as 604 ((2^MAXBE)-1)*MAXRETRIES*SLOTFRAME_LENGTH, where: 606 o MAXBE is the maximum backoff exponent used 607 o MAXRETRIES is the maximum retransmission times 608 o SLOTFRAME_LENGTH represents the length of slotframe 610 10. Rule for Ordering Cells 612 Cells are ordered slotOffset first, channelOffset second. 614 The following sequence is correctly ordered (each element represents 615 the [slottOffset,channelOffset] of a cell in the schedule): 617 [1,3],[1,4],[2,0],[5,3],[6,0],[6,3],[7,9] 619 11. Meaning of the Metadata Field 621 The Metadata field is not used by MSF. 623 12. 6P Error Handling 625 Section 6.2.4 of [RFC8480] lists the 6P Return Codes. Figure 1 lists 626 the same error codes, and the behavior a node implementing MSF SHOULD 627 follow. 629 +-----------------+----------------------+ 630 | Code | RECOMMENDED behavior | 631 +-----------------+----------------------+ 632 | RC_SUCCESS | nothing | 633 | RC_EOL | nothing | 634 | RC_ERR | quarantine | 635 | RC_RESET | quarantine | 636 | RC_ERR_VERSION | quarantine | 637 | RC_ERR_SFID | quarantine | 638 | RC_ERR_SEQNUM | clear | 639 | RC_ERR_CELLLIST | clear | 640 | RC_ERR_BUSY | waitretry | 641 | RC_ERR_LOCKED | waitretry | 642 +-----------------+----------------------+ 644 Figure 1: Recommended behavior for each 6P Error Code. 646 The meaning of each behavior from Figure 1 is: 648 nothing: Indicates that this Return Code is not an error. No error 649 handling behavior is triggered. 650 clear: Abort the 6P Transaction. Issue a 6P CLEAR command to that 651 neighbor (this command may fail at the link layer). Remove all 652 cells scheduled with that neighbor from the local schedule. Keep 653 that node in the neighbor and routing tables. 654 quarantine: Same behavior as for "clear". In addition, remove the 655 node from the neighbor and routing tables. Place the node's 656 identifier in a quarantine list for QUARANTINE_DURATION. When in 657 quarantine, drop all frames received from that node. 658 waitretry: Abort the 6P Transaction. Wait for a duration randomly 659 and uniformly chosen in [WAITDURATION_MIN,WAITDURATION_MAX]. 660 Retry the same transaction. 662 13. Schedule Inconsistency Handling 664 The behavior when schedule inconsistency is detected is explained in 665 Figure 1, for 6P Return Code RC_ERR_SEQNUM. 667 14. MSF Constants 669 Figure 2 lists MSF Constants and their RECOMMENDED values. 671 +------------------------------+-------------------+ 672 | Name | RECOMMENDED value | 673 +------------------------------+-------------------+ 674 | NUM_CH_OFFSET | 16 | 675 | KA_PERIOD | 1 min | 676 | LIM_NUMCELLSUSED_HIGH | 75 % | 677 | LIM_NUMCELLSUSED_LOW | 25 % | 678 | HOUSEKEEPINGCOLLISION_PERIOD | 1 min | 679 | RELOCATE_PDRTHRES | 50 % | 680 | SLOTFRAME_LENGTH | 101 slots | 681 | QUARANTINE_DURATION | 5 min | 682 | WAITDURATION_MIN | 30 s | 683 | WAITDURATION_MAX | 60 s | 684 +------------------------------+-------------------+ 686 Figure 2: MSF Constants and their RECOMMENDED values. 688 15. MSF Statistics 690 Figure 3 lists MSF Statistics and their RECOMMENDED width. 692 +-----------------+-------------------+ 693 | Name | RECOMMENDED width | 694 +-----------------+-------------------+ 695 | NumCellsElapsed | 1 byte | 696 | NumCellsUsed | 1 byte | 697 | NumTx | 1 byte | 698 | NumTxAck | 1 byte | 699 +-----------------+-------------------+ 701 Figure 3: MSF Statistics and their RECOMMENDED width. 703 16. Security Considerations 705 MSF defines a series of "rules" for the node to follow. It triggers 706 several actions, that are carried out by the protocols defined in the 707 following specifications: the Minimal IPv6 over the TSCH Mode of IEEE 708 802.15.4e (6TiSCH) Configuration [RFC8180], the 6TiSCH Operation 709 Sublayer Protocol (6P) [RFC8480], and the Minimal Security Framework 710 for 6TiSCH [I-D.ietf-6tisch-minimal-security]. In particular, MSF 711 does not define a new protocol or packet format. 713 MSF relies entirely on the security mechanisms defined in the 714 specifications listed above. 716 17. IANA Considerations 718 17.1. MSF Scheduling Function Identifiers 720 This document adds the following number to the "6P Scheduling 721 Function Identifiers" sub-registry, part of the "IPv6 over the TSCH 722 mode of IEEE 802.15.4e (6TiSCH) parameters" registry, as defined by 723 [RFC8480]: 725 +----------------------+-----------------------------+-------------+ 726 | SFID | Name | Reference | 727 +----------------------+-----------------------------+-------------+ 728 | IANA_6TISCH_SFID_MSF | Minimal Scheduling Function | RFC_THIS | 729 | | (MSF) | | 730 +----------------------+-----------------------------+-------------+ 732 Figure 4: IETF IE Subtype '6P'. 734 18. References 736 18.1. Normative References 738 [I-D.ietf-6tisch-architecture] 739 Thubert, P., "An Architecture for IPv6 over the TSCH mode 740 of IEEE 802.15.4", draft-ietf-6tisch-architecture-26 (work 741 in progress), August 2019. 743 [I-D.ietf-6tisch-dtsecurity-zerotouch-join] 744 Richardson, M., "6tisch Zero-Touch Secure Join protocol", 745 draft-ietf-6tisch-dtsecurity-zerotouch-join-04 (work in 746 progress), July 2019. 748 [I-D.ietf-6tisch-minimal-security] 749 Vucinic, M., Simon, J., Pister, K., and M. Richardson, 750 "Minimal Security Framework for 6TiSCH", draft-ietf- 751 6tisch-minimal-security-12 (work in progress), July 2019. 753 [I-D.richardson-6tisch-join-enhanced-beacon] 754 Dujovne, D. and M. Richardson, "IEEE802.15.4 Informational 755 Element encapsulation of 6tisch Join Information", draft- 756 richardson-6tisch-join-enhanced-beacon-03 (work in 757 progress), January 2018. 759 [IEEE802154-2015] 760 IEEE standard for Information Technology, "IEEE Std 761 802.15.4-2015 Standard for Low-Rate Wireless Personal Area 762 Networks (WPANs)", December 2015. 764 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 765 Requirement Levels", BCP 14, RFC 2119, 766 DOI 10.17487/RFC2119, March 1997, 767 . 769 [RFC6550] Winter, T., Ed., Thubert, P., Ed., Brandt, A., Hui, J., 770 Kelsey, R., Levis, P., Pister, K., Struik, R., Vasseur, 771 JP., and R. Alexander, "RPL: IPv6 Routing Protocol for 772 Low-Power and Lossy Networks", RFC 6550, 773 DOI 10.17487/RFC6550, March 2012, 774 . 776 [RFC8180] Vilajosana, X., Ed., Pister, K., and T. Watteyne, "Minimal 777 IPv6 over the TSCH Mode of IEEE 802.15.4e (6TiSCH) 778 Configuration", BCP 210, RFC 8180, DOI 10.17487/RFC8180, 779 May 2017, . 781 [RFC8480] Wang, Q., Ed., Vilajosana, X., and T. Watteyne, "6TiSCH 782 Operation Sublayer (6top) Protocol (6P)", RFC 8480, 783 DOI 10.17487/RFC8480, November 2018, 784 . 786 [RFC8505] Thubert, P., Ed., Nordmark, E., Chakrabarti, S., and C. 787 Perkins, "Registration Extensions for IPv6 over Low-Power 788 Wireless Personal Area Network (6LoWPAN) Neighbor 789 Discovery", RFC 8505, DOI 10.17487/RFC8505, November 2018, 790 . 792 18.2. Informative References 794 [SAX-DASFAA] 795 Ramakrishna, M. and J. Zobel, "Performance in Practice of 796 String Hashing Functions", DASFAA , 1997. 798 Appendix A. Contributors 800 Beshr Al Nahas (Chalmers University, beshr@chalmers.se) Olaf 801 Landsiedel (Chalmers University, olafl@chalmers.se) Yasuyuki Tanaka 802 (Inria-Paris, yasuyuki.tanaka@inria.fr) 804 Appendix B. Example of Implementation of SAX hash function 806 For the consideration of interoperability, this section provides an 807 example of implemention SAX hash function [SAX-DASFAA]. The input 808 parameters of the function are: 810 o T, which is the hashing table length 811 o c, which is the characters of string s, to be hashed 812 In MSF, the T is replaced by the length slotframe 1. String s is 813 replaced by the mote EUI64 address. The characters of the string c0, 814 c1, ..., c7 are the 8 bytes of EUI64 address. 816 The SAX hash function requires shift operation which is defined as 817 follow: 819 o L_shift(v,b), which refers to left shift variable v by b bits 820 o R_shift(v,b), which refers to right shift variable v by b bits 822 The steps to calculate the hash value of SAX hash function are: 824 1. initialize variable h to h0 and variable i to 0, where h is the 825 intermediate hash value and i is the index of the bytes of EUI64 826 address 827 2. sum the value of L_shift(h,l_bit), R_shift(h,r_bit) and ci 828 3. calculate the result of exclusive or between the sum value in 829 Step 2 and h 830 4. modulo the result of Step 3 by T 831 5. assign the result of Step 4 to h 832 6. increase i by 1 833 7. repeat Step2 to Step 6 until i reaches to 8 834 8. assign the result of Step 5 to h 836 The value of variable h the hash value of SAX hash function. 838 For interoperability purposes, the values of h0, l_bit and r_bit in 839 Step 1 and 2 are configured as: 841 o h0 = 0 842 o l_bit = 0 843 o r_bit = 1 845 The appropriate values of l_bit and r_bit could vary depending on the 846 the set of motes' EUI64 address. How to find those values is out of 847 the scope of this specification. 849 Authors' Addresses 851 Tengfei Chang (editor) 852 Inria 853 2 rue Simone Iff 854 Paris 75012 855 France 857 Email: tengfei.chang@inria.fr 858 Malisa Vucinic 859 Inria 860 2 rue Simone Iff 861 Paris 75012 862 France 864 Email: malisa.vucinic@inria.fr 866 Xavier Vilajosana 867 Universitat Oberta de Catalunya 868 156 Rambla Poblenou 869 Barcelona, Catalonia 08018 870 Spain 872 Email: xvilajosana@uoc.edu 874 Simon Duquennoy 875 RISE SICS 876 Isafjordsgatan 22 877 164 29 Kista 878 Sweden 880 Email: simon.duquennoy@ri.se 882 Diego Dujovne 883 Universidad Diego Portales 884 Escuela de Informatica y Telecomunicaciones 885 Av. Ejercito 441 886 Santiago, Region Metropolitana 887 Chile 889 Phone: +56 (2) 676-8121 890 Email: diego.dujovne@mail.udp.cl