idnits 2.17.1 draft-ietf-6tisch-msf-05.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 (July 8, 2019) is 1754 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 600 -- Looks like a reference, but probably isn't: '3' on line 600 -- Looks like a reference, but probably isn't: '4' on line 600 -- Looks like a reference, but probably isn't: '2' on line 600 -- Looks like a reference, but probably isn't: '0' on line 600 -- Looks like a reference, but probably isn't: '5' on line 600 -- Looks like a reference, but probably isn't: '6' on line 600 -- Looks like a reference, but probably isn't: '7' on line 600 -- Looks like a reference, but probably isn't: '9' on line 600 == Outdated reference: A later version (-30) exists of draft-ietf-6tisch-architecture-24 ** Downref: Normative reference to an Informational draft: draft-ietf-6tisch-architecture (ref. 'I-D.ietf-6tisch-architecture') == Outdated reference: A later version (-04) exists of draft-ietf-6tisch-dtsecurity-zerotouch-join-03 ** 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-11 ** 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 (~~), 4 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: January 9, 2020 X. Vilajosana 6 Universitat Oberta de Catalunya 7 S. Duquennoy 8 RISE SICS 9 D. Dujovne 10 Universidad Diego Portales 11 July 8, 2019 13 6TiSCH Minimal Scheduling Function (MSF) 14 draft-ietf-6tisch-msf-05 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 January 9, 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 and Rx negotiated Cells . . 7 76 4.7. Step 6 - Send EBs and DIOs . . . . . . . . . . . . . . . 8 77 4.8. End State . . . . . . . . . . . . . . . . . . . . . . . . 8 78 5. Rules for Adding/Deleting Cells . . . . . . . . . . . . . . . 8 79 5.1. Adapting to Traffic . . . . . . . . . . . . . . . . . . . 9 80 5.2. Switching Parent . . . . . . . . . . . . . . . . . . . . 10 81 5.3. Handling Schedule Collisions . . . . . . . . . . . . . . 11 82 6. 6P SIGNAL command . . . . . . . . . . . . . . . . . . . . . . 12 83 7. Scheduling Function Identifier . . . . . . . . . . . . . . . 12 84 8. Rules for CellList . . . . . . . . . . . . . . . . . . . . . 12 85 9. 6P Timeout Value . . . . . . . . . . . . . . . . . . . . . . 13 86 10. Rule for Ordering Cells . . . . . . . . . . . . . . . . . . . 13 87 11. Meaning of the Metadata Field . . . . . . . . . . . . . . . . 13 88 12. 6P Error Handling . . . . . . . . . . . . . . . . . . . . . . 13 89 13. Schedule Inconsistency Handling . . . . . . . . . . . . . . . 14 90 14. MSF Constants . . . . . . . . . . . . . . . . . . . . . . . . 14 91 15. MSF Statistics . . . . . . . . . . . . . . . . . . . . . . . 15 92 16. Security Considerations . . . . . . . . . . . . . . . . . . . 15 93 17. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 16 94 17.1. MSF Scheduling Function Identifiers . . . . . . . . . . 16 95 18. References . . . . . . . . . . . . . . . . . . . . . . . . . 16 96 18.1. Normative References . . . . . . . . . . . . . . . . . . 16 97 18.2. Informative References . . . . . . . . . . . . . . . . . 17 98 Appendix A. Contributors . . . . . . . . . . . . . . . . . . . . 17 99 Appendix B. Example of Implementation of SAX hash function . . . 17 100 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 18 102 1. Introduction 104 The 6TiSCH Minimal Scheduling Function (MSF), defined in this 105 specification, is a 6TiSCH Scheduling Function (SF). The role of an 106 SF is entirely defined in [RFC8480]. This specification complements 107 [RFC8480] by providing the rules of when to add/delete cells in the 108 communication schedule. This specification satisfies all the 109 requirements for an SF listed in Section 4.2 of [RFC8480]. 111 MSF builds on top of the following specifications: the Minimal IPv6 112 over the TSCH Mode of IEEE 802.15.4e (6TiSCH) Configuration 113 [RFC8180], the 6TiSCH Operation Sublayer Protocol (6P) [RFC8480], and 114 the Minimal Security Framework for 6TiSCH 115 [I-D.ietf-6tisch-minimal-security]. 117 MSF defines both the behavior of a node when joining the network, and 118 how the communication schedule is managed in a distributed fashion. 119 When a node running MSF boots up, it joins the network by following 120 the 7 steps described in Section 4. The end state of the join 121 process is that the node is synchronized to the network, has mutually 122 authenticated to the network, has identified a preferred routing 123 parent, and has scheduled one default negotiated cell (defined in 124 Section 5.1) to/from its preferred routing parent. After the join 125 process, the node can continuously add/delete/relocate cells, as 126 described in Section 5. It does so for 3 reasons: to match the link- 127 layer resources to the traffic, to handle changing parent, to handle 128 a schedule collision. 130 MSF is designed to operate in a wide range of application domains. 131 It is optimized for applications with regular upstream traffic (from 132 the nodes to the root). 134 This specification follows the recommended structure of an SF 135 specification, given in Appendix A of [RFC8480], with the following 136 adaptations: 138 o We have reordered some sections, in particular to have the section 139 on the node behavior at boot (Section 4) appear early in this 140 specification. 141 o We added sections on the interface to the minimal 6TiSCH 142 configuration (Section 2), the use of the SIGNAL command 143 (Section 6), the MSF constants (Section 14), the MSF statistics 144 (Section 15). 146 o This specification does not include an examples section. 148 2. Interface to the Minimal 6TiSCH Configuration 150 A node implementing MSF SHOULD implement the Minimal 6TiSCH 151 Configuration [RFC8180], which defines the "minimal cell", a single 152 shared cell providing minimal connectivity between the nodes in the 153 network. The MSF implementation provided in this specification is 154 based on the implementation of the Minimal 6TiSCH Configuration. 155 However, an implementor MAY implement MSF without implementing 156 Minimal 6TiSCH Configuration. 158 MSF uses the minimal cell to exchange the following packets: 160 1. Enhanced Beacons (EBs), defined by [IEEE802154-2015]. These are 161 broadcast frames. 162 2. Broadcast DODAG Information Objects (DIOs), defined by [RFC6550]. 163 Unicast DIOs SHOULD NOT be sent on minimal cell. 165 To ensure there is enough bandwidth available on the minimal cell, a 166 node implementing MSF SHOULD enforce some rules for limiting the 167 traffic of broadcast frames. For example, a Trickle Timer defined in 168 [RFC6550] MAY be applied on DIOs. However, this behavior is 169 implementation-specific which is out of the scope of MSF. 171 MSF RECOMMENDS the use of 3 slotframes. MSF schedules autonomous 172 cells at Slotframe 1 (Section 3) and 6P negotiated cells at Slotframe 173 2 (Section 5) , while Slotframe 0 is used for the bootstrap traffic 174 as defined in the Minimal 6TiSCH Configuration. It is RECOMMENDED to 175 use the same slotframe length for Slotframe 0, 1 and 2. Thus it is 176 possible to avoid the scheduling collision between the autonomous 177 cells and 6P negotiated cells (Section 3). The default slotframe 178 length (SLOTFRAME_LENGTH) is RECOMMENDED for Slotframe 0, 1 and 2, 179 although any value can be advertised in the EBs. 181 3. Autonomous Cells 183 MSF nodes initialize Slotframe 1 with a set of default cells for 184 unicast communication with their neighbors. These cells are called 185 'autonomous cells', because they are maintained autonomously by each 186 node without negotiation through 6P. Cells scheduled by 6P 187 transaction are called 'negotiated cells' which are reserved on 188 Slotframe 2. How to schedule negotiated cells is detailed in 189 Section 5. There are two types of autonomous cells: 191 o Autonomous Rx Cell (AutoRxCell), one cell at a 192 [slotOffset,channelOffset] computed as a hash of the EUI64 of the 193 node itself (detailed next). Its cell options bits are assigned 194 as TX=0, RX=1, SHARED=0. 195 o Autonomous Tx Cell (AutoTxCell), one cell at a 196 [slotOffset,channelOffset] computed as a hash of the layer 2 EUI64 197 destination address in the frame to be transmitted (detailed in 198 Section 4.4). Its cell options bits are assigned as TX=1, RX=0, 199 SHARED=1. 201 To compute a [slotOffset,channelOffset] from an EUI64 address, nodes 202 MUST use the hash function SAX [SAX-DASFAA]. The coordinates are 203 computed to distribute the cells across all channel offsets, and all 204 but the first time offsets of Slotframe 1. The first time offset is 205 skipped to avoid colliding with the minimal cell in Slotframe 0. The 206 slot coordinates derived from a given EUI64 address are computed as 207 follows: 209 o slotOffset(MAC) = 1 + hash(EUI64, length(Slotframe_1) - 1) 210 o channelOffset(MAC) = hash(EUI64, NUM_CH_OFFSET) 212 The second input parameter defines the maximum return value of the 213 hash function. Other optional parameters defined in SAX determine 214 the performance of SAX hash function. Those parameters could be 215 broadcasted in EB frame or pre-configured. For interoperability 216 purposes, an example how the hash function is implemented is detailed 217 in Appendix B. 219 AutoTxCell is not permanent in the schedule but added/deleted on 220 demand when there is a frame to sent. Throughout the network 221 lifetime, nodes maintain the autonomous cells as follows: 223 o Add an AutoTxCell to the layer 2 destination address which is 224 indicated in a frame when: 226 * there is no 6P negotiated Tx cell in schedule for that frame to 227 transmit, and 228 * the frame is used for protocol management purposes , such as 229 Join Request/Response, 6P Request/Response and any link-local 230 communication for RPL routing control. 231 o Remove an AutoTxCell when: 233 * there is no frame for protocol management purposes to transmit, 234 or 235 * there is at least one 6P negotiated Tx cell in the schedule to 236 transmit a management purpose frame. 237 o The AutoRxCell MUST always remain scheduled after synchronized. 238 o 6P CLEAR MUST NOT erase any autonomous cells. 240 Because of hash collisions, there will be cases when the AutoTxCell 241 and AutoRxCell are scheduled at the same slot offset and/or channel 242 offset. In such cases, AutoTxCell always take precedence over 243 AutoRxCell. In case of conflicting with a negotiated cell, 244 autonomous cells take precedence over negotiated cell, which is 245 stated in [IEEE802154-2015]. However, when the Slotframe 0, 1 and 2 246 use the same length value, it is possible for negotiated cell to 247 avoid the collision with AutoRxCell. 249 4. Node Behavior at Boot 251 This section details the behavior the node SHOULD follow from the 252 moment it is switched on, until it has successfully joined the 253 network. Section 4.1 details the start state; Section 4.8 details 254 the end state. The other sections detail the 6 steps of the joining 255 process. We use the term "pledge" and "joined node", as defined in 256 [I-D.ietf-6tisch-minimal-security]. 258 4.1. Start State 260 A node implementing MSF SHOULD implement the Minimal Security 261 Framework for 6TiSCH [I-D.ietf-6tisch-minimal-security]. As a 262 corollary, this means that a pledge, before being switched on, may be 263 pre-configured with the Pre-Shared Key (PSK) for joining, as well as 264 any other configuration detailed in 265 ([I-D.ietf-6tisch-minimal-security]). This is not needed if the node 266 implements a security solution not based on PSKs, such as 267 ([I-D.ietf-6tisch-dtsecurity-zerotouch-join]). 269 4.2. Step 1 - Choosing Frequency 271 When switched on, the pledge SHOULD randomly choose a frequency among 272 the available frequencies, and start listening for EBs on that 273 frequency. 275 4.3. Step 2 - Receiving EBs 277 Upon receiving the first EB, the pledge SHOULD continue listening for 278 additional EBs to learn: 280 1. the number of neighbors N in its vicinity 281 2. which neighbor to choose as a Join Proxy (JP) for the joining 282 process 284 While the exact behavior is implementation-specific, the RECOMMENDED 285 behavior is to follow [RFC8180], and listen until EBs sent by 286 NUM_NEIGHBOURS_TO_WAIT nodes (defined in [RFC8180]) have been 287 received. 289 During this step, the pledge SHOULD NOT synchronize until it received 290 enough EB from the network it wishes to join. How to decide whether 291 an EB originates from a node from the network it wishes to join is 292 implementation-specific, but MAY involve filtering EBs by the PAN ID 293 field it contains, the presence and contents of the IE defined in 294 [I-D.richardson-6tisch-join-enhanced-beacon], or the key used to 295 authenticate it. 297 The decision of which neighbor to use as a JP is implementation- 298 specific, and discussed in [I-D.ietf-6tisch-minimal-security]. 300 4.4. Step 3 - Setting up Autonomous Cells for the Join Process 302 After selected a JP, a node generates a Join Request and installs an 303 AutoTxCell to the JP. A Join Request is then sent by the pledge to 304 its JP over the AutoTxCell. The AutoTxCell is removed by the pledge 305 when the Join Request is sent out. The JP receives the Join Request 306 through its AutoRxCell. Then it forwards the Join Request to the 307 JRC, possibly over multiple hops, over the 6P negotiated Tx cell. 308 Similarly, the JRC sends the Join Response to the JP, possibly over 309 multiple hops, over the 6P negotiated Tx cell. When JP received the 310 Join Response from the JRC, it installs an AutoTxCell to the pledge 311 and sends that Join Response to the pledge over AutoTxCell. The 312 AutoTxCell is removed by the JP when the Join Response is sent out. 313 The pledge receives the Join Response from its AutoRxCell, thereby 314 learns the keying material used in the network, as well as other 315 configurations, and becomes a "joined node". 317 When 6LoWPAN Neighbor Dicovery ([RFC8505]) (ND) is implemented, the 318 unicast packets used by ND are sent on the AutoTxCell. The specific 319 process how the ND works during the Join process is detailed in 320 [I-D.ietf-6tisch-architecture]. 322 4.5. Step 4 - Acquiring a RPL Rank 324 Per [RFC6550], the joined node receives DIOs, computes its own Rank, 325 and selects a preferred parent. 327 4.6. Step 5 - Setting up first Tx and Rx negotiated Cells 329 After selected a preferred parent, the joined node MUST generate a 6P 330 ADD Request and install an AutoTxCell to that parent. The 6P ADD 331 Request is sent out through the AutoTxCell with the following fields: 333 o CellOptions: set to TX=1,RX=0,SHARED=0 334 o NumCells: set to 1 335 o CellList: at least 5 cells, chosen according to Section Section 8 336 The joined node removes the AutoTxCell to parent when the 6P command 337 is send out. Its parent receives the 6P ADD Request from its 338 AutoRxCell. Then it generates a 6P ADD Response and installs an 339 AutoTxCell to the joined node. When the parent sends out the 6P ADD 340 Response, it MUST remove that AutoTxCell. The joined node receives 341 the 6P ADD Response from its AutoRxCell and completes the 6P 342 transcation. In case the 6P ADD transaction failed, the node MUST 343 issue another 6P ADD command and repeat until the Tx cell is 344 installed to the parent. 346 After the first negotiated Tx Cell is installed, the joined node 347 SHOULD send another 6P ADD Request with the following fields: 349 o CellOptions: set to TX=0,RX=1,SHARED=0 350 o NumCells: set to 1 351 o CellList: at least 5 cells, chosen according to Section Section 8 353 The process to install a negotiated Rx cell is the similar with the 354 process to install a negotiated Tx cell. The only difference is that 355 the 6P ADD Request is sent on the negotiated Tx cell installed 356 previously, instead of the AutoTxCell. 358 4.7. Step 6 - Send EBs and DIOs 360 The node SHOULD start sending EBs and DIOs on the minimal cell, while 361 following the transmit rules for broadcast frames from Section 2. 363 4.8. 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 one AutRxCell 372 o it has one negotiated Tx cell and one negotiated Rx cell to its 373 parent 374 o it starts to send DIOs, potentially serving as a router for other 375 nodes' traffic 376 o it starts to send EBs, potentially serving as a JP for new pledge 378 5. Rules for Adding/Deleting Cells 380 Once a node has joined the 6TiSCH network, it adds/deletes/relocates 381 cells with its preferred parent for three reasons: 383 o to match the link-layer resources to the traffic between the node 384 and its preferred parent (Section 5.1) 385 o to handle switching preferred parent or(Section 5.2) 386 o to handle a schedule collision (Section 5.3) 388 Those cells are called 'negotiated cells' as they are scheduled 389 through 6P, negotiated with their parents. Without specific 390 declaring, all cells mentioned in this section are negotiated cells 391 and they are installed at Slotframe 2. 393 5.1. Adapting to Traffic 395 A node implementing MSF MUST implement the behavior described in this 396 section. 398 The goal of MSF is to manage the communication schedule in the 6TiSCH 399 schedule in a distributed manner. For a node, this translates into 400 monitoring the current usage of the cells it has to its preferred 401 parent: 403 o If the node determines that the number of link-layer frames it is 404 attempting to exchange with its preferred parent per unit of time 405 is larger than the capacity offered by the TSCH negotiated cells 406 it has scheduled with it, the node issues a 6P ADD command to its 407 preferred parent to add cells to the TSCH schedule. 408 o If the traffic is lower than the capacity, the node issues a 6P 409 DELETE command to its preferred parent to delete cells from the 410 TSCH schedule. 412 The node MUST maintain the following counters for its preferred 413 parent: 415 NumCellsElapsed : Counts the number of negotiated cells that have 416 elapsed since the counter was initialized. This counter is 417 initialized at 0. Each time the TSCH state machine indicates 418 that the current cell is a negotiated cell to the preferred 419 parent, NumCellsElapsed is incremented by exactly 1, regardless 420 of whether the cell is used to transmit/receive a frame. 421 NumCellsUsed: Counts the number of negotiated cells that have been 422 used. This counter is initialized at 0. NumCellsUsed is 423 incremented by exactly 1 when, during a negotiated cell to the 424 preferred parent, either of the following happens: 426 * The node sends a frame to its preferred parent. The counter 427 increments regardless of whether a link-layer acknowledgment 428 was received or not. 430 * The node receives a frame from its preferred parent. The 431 counter increments regardless of whether the frame is a valid 432 IEEE802.15.4 frame or not. 434 The cell option of the cell listed CellList in 6P Request SHOULD be 435 either Tx=1 only or Rx=1 only. Both NumCellsElapsed and NumCellsUsed 436 counters can be used to both type of negotiated cells. 438 Implementors MAY choose to create the same counters for each 439 neighbor, and add them as additional statistics in the neighbor 440 table. 442 The counters are used as follows: 444 1. Both NumCellsElapsed and NumCellsUsed are initialized to 0 when 445 the node boots. 446 2. When the value of NumCellsElapsed reaches MAX_NUMCELLS: 448 * If NumCellsUsed > LIM_NUMCELLSUSED_HIGH, trigger 6P to add a 449 single cell to the preferred parent 450 * If NumCellsUsed < LIM_NUMCELLSUSED_LOW, trigger 6P to remove a 451 single cell to the preferred parent 452 * Reset both NumCellsElapsed and NumCellsUsed to 0 and go to 453 step 2. 455 The value of MAX_NUMCELLS is chosen according to the traffic type of 456 the network. Generally speaking, the larger the value MAX_NUMCELLS 457 is, the more accurate the cell usage is calculated. The 6P traffic 458 overhead using a larger value of MAX_NUMCELLS could be reduced as 459 well. Meanwhile, the latency won't increaase much by using a larger 460 value of MAX_NUMCELLS for periodic traffic type. For burst traffic 461 type, larger value of MAX_NUMCELLS indeed introduces higher latency. 462 The latency caused by slight changes of traffic load can be absolved 463 by the additional scheduled cells. In this sense, MSF is a 464 scheduling function trading latency with energy by scheduling more 465 cells than needed. It is recommended to set MAX_NUMCELLS value at 466 least 4 times than the maximum link traffic load of the network in 467 packets per slotframe. For example, a 2 packets/slotframe traffic 468 load results an average 4 cells scheduled, using the value of double 469 number of scheduled cells (which is 8) as MAX_NUMCELLS gives a good 470 resolution on cell usage calculation. 472 5.2. Switching Parent 474 A node implementing MSF SHOULD implement the behavior described in 475 this section. 477 Part of its normal operation, the RPL routing protocol can have a 478 node switch preferred parent. The procedure for switching from the 479 old preferred parent to the new preferred parent is: 481 1. the node counts the number of negotiated cells it has per 482 slotframe to the old preferred parent 483 2. the node triggers one or more 6P ADD commands to schedule the 484 same number of negotiated cells to the new preferred parent 485 3. when that successfully completes, the node issues a 6P CLEAR 486 command to its old preferred parent 488 5.3. Handling Schedule Collisions 490 A node implementing MSF SHOULD implement the behavior described in 491 this section. The "MUST" statements in this section hence only apply 492 if the node implements schedule collision handling. 494 Since scheduling is entirely distributed, there is a non-zero 495 probability that two pairs of nearby neighbor nodes schedule a 496 negotiated cell at the same [slotOffset,channelOffset] location in 497 the TSCH schedule. In that case, data exchanged by the two pairs may 498 collide on that cell. We call this case a "schedule collision". 500 The node MUST maintain the following counters for each managed 501 unicast cell to its preferred parent: 503 NumTx: Counts the number of transmission attempts on that cell. 504 Each time the node attempts to transmit a frame on that cell, 505 NumTx is incremented by exactly 1. 506 NumTxAck: Counts the number of successful transmission attempts on 507 that cell. Each time the node receives an acknowledgment for a 508 transmission attempt, NumTxAck is incremented by exactly 1. 510 Implementors MAY choose to maintain the same counters for each 511 negotiated cell in the schedule. 513 Since both NumTx and NumTxAck are initialized to 0, we necessarily 514 have NumTxAck <= NumTx. We call Packet Delivery Ratio (PDR) the 515 ratio NumTxAck/NumTx; and represent it as a percentage. A cell with 516 PDR=50% means that half of the frames transmitted are not 517 acknowledged (and need to be retransmitted). 519 Each time the node switches preferred parent (or during the join 520 process when the node selects a preferred parent for the first time), 521 both NumTx and NumTxAck MUST be reset to 0. They increment over 522 time, as the schedule is executed and the node sends frames to its 523 preferred parent. When NumTx reaches MAX_NUMTX, both NumTx and 524 NumTxAck MUST be divided by 2. That is, for example, from NumTx=256 525 and NumTxAck=128, they become NumTx=128 and NumTxAck=64. This 526 operation does not change the value of the PDR, but allows the 527 counters to keep incrementing. The value of MAX_NUMTX is 528 implementation-specific. 530 The key for detecting a schedule collision is that, if a node has 531 several cells to the same preferred parent, all cells should exhibit 532 the same PDR. A cell which exhibits a PDR significantly lower than 533 the others indicates than there are collisions on that cell. 535 Every HOUSEKEEPINGCOLLISION_PERIOD, the node executes the following 536 steps: 538 1. It computes, for each managed unicast cell with its preferred 539 parent (not for the autonomous cell), that cell's PDR. 540 2. Any cell that hasn't yet had NumTx divided by 2 since it was last 541 reset is skipped in steps 3 and 4. This avoids triggering cell 542 relocation when the values of NumTx and NumTxAck are not 543 statistically significant yet. 544 3. It identifies the cell with the highest PDR. 545 4. For any other cell, it compares its PDR against that of the cell 546 with the highest PDR. If the difference is larger than 547 RELOCATE_PDRTHRES, it triggers the relocation of that cell using 548 a 6P RELOCATE command. 550 6. 6P SIGNAL command 552 The 6P SIGNAL command is not used by MSF. 554 7. Scheduling Function Identifier 556 The Scheduling Function Identifier (SFID) of MSF is 557 IANA_6TISCH_SFID_MSF. 559 8. Rules for CellList 561 MSF uses 2-step 6P Transactions exclusively. 6P Transactions are 562 only initiated by a node towards its preferred parent. As a result, 563 the cells to put in the CellList of a 6P ADD command, and in the 564 candidate CellList of a RELOCATE command, are chosen by the node 565 initiating the 6P Transaction. In both cases, the same rules apply: 567 o The CellList is RECOMMENDED to have 5 or more cells. 568 o Each cell in the CellList MUST have a different slotOffset value. 569 o For each cell in the CellList, the node MUST NOT have any 570 scheduled cell on the same slotOffset. 571 o The slotOffset value of any cell in the CellList MUST NOT be the 572 same as the slotOffset of the minimal cell (slotOffset=0). 574 o The slotOffset of a cell in the CellList SHOULD be randomly and 575 uniformly chosen among all the slotOffset values that satisfy the 576 restrictions above. 577 o The channelOffset of a cell in the CellList SHOULD be randomly and 578 uniformly chosen in [0..numFrequencies], where numFrequencies 579 represents the number of frequencies a node can communicate on. 581 9. 6P Timeout Value 583 It is calculated for the worst case that a 6P response is received, 584 which means the 6P response is sent out successfully at the very 585 latest retransmission. And for each retransmission, it backs-off 586 with largest value. Hence the 6P timeout value is calculated as 587 ((2^MAXBE)-1)*MAXRETRIES*SLOTFRAME_LENGTH, where: 589 o MAXBE is the maximum backoff exponent used 590 o MAXRETRIES is the maximum retransmission times 591 o SLOTFRAME_LENGTH represents the length of slotframe 593 10. Rule for Ordering Cells 595 Cells are ordered slotOffset first, channelOffset second. 597 The following sequence is correctly ordered (each element represents 598 the [slottOffset,channelOffset] of a cell in the schedule): 600 [1,3],[1,4],[2,0],[5,3],[6,0],[6,3],[7,9] 602 11. Meaning of the Metadata Field 604 The Metadata field is not used by MSF. 606 12. 6P Error Handling 608 Section 6.2.4 of [RFC8480] lists the 6P Return Codes. Figure 1 lists 609 the same error codes, and the behavior a node implementing MSF SHOULD 610 follow. 612 +-----------------+----------------------+ 613 | Code | RECOMMENDED behavior | 614 +-----------------+----------------------+ 615 | RC_SUCCESS | nothing | 616 | RC_EOL | nothing | 617 | RC_ERR | quarantine | 618 | RC_RESET | quarantine | 619 | RC_ERR_VERSION | quarantine | 620 | RC_ERR_SFID | quarantine | 621 | RC_ERR_SEQNUM | clear | 622 | RC_ERR_CELLLIST | clear | 623 | RC_ERR_BUSY | waitretry | 624 | RC_ERR_LOCKED | waitretry | 625 +-----------------+----------------------+ 627 Figure 1: Recommended behavior for each 6P Error Code. 629 The meaning of each behavior from Figure 1 is: 631 nothing: Indicates that this Return Code is not an error. No error 632 handling behavior is triggered. 633 clear: Abort the 6P Transaction. Issue a 6P CLEAR command to that 634 neighbor (this command may fail at the link layer). Remove all 635 cells scheduled with that neighbor from the local schedule. Keep 636 that node in the neighbor and routing tables. 637 quarantine: Same behavior as for "clear". In addition, remove the 638 node from the neighbor and routing tables. Place the node's 639 identifier in a quarantine list for QUARANTINE_DURATION. When in 640 quarantine, drop all frames received from that node. 641 waitretry: Abort the 6P Transaction. Wait for a duration randomly 642 and uniformly chosen in [WAITDURATION_MIN,WAITDURATION_MAX]. 643 Retry the same transaction. 645 13. Schedule Inconsistency Handling 647 The behavior when schedule inconsistency is detected is explained in 648 Figure 1, for 6P Return Code RC_ERR_SEQNUM. 650 14. MSF Constants 652 Figure 2 lists MSF Constants and their RECOMMENDED values. 654 +------------------------------+-------------------+ 655 | Name | RECOMMENDED value | 656 +------------------------------+-------------------+ 657 | NUM_CH_OFFSET | 16 | 658 | LIM_NUMCELLSUSED_HIGH | 75 % | 659 | LIM_NUMCELLSUSED_LOW | 25 % | 660 | HOUSEKEEPINGCOLLISION_PERIOD | 1 min | 661 | RELOCATE_PDRTHRES | 50 % | 662 | SLOTFRAME_LENGTH | 101 slots | 663 | QUARANTINE_DURATION | 5 min | 664 | WAITDURATION_MIN | 30 s | 665 | WAITDURATION_MAX | 60 s | 666 +------------------------------+-------------------+ 668 Figure 2: MSF Constants and their RECOMMENDED values. 670 15. MSF Statistics 672 Figure 3 lists MSF Statistics and their RECOMMENDED width. 674 +-----------------+-------------------+ 675 | Name | RECOMMENDED width | 676 +-----------------+-------------------+ 677 | NumCellsElapsed | 1 byte | 678 | NumCellsUsed | 1 byte | 679 | NumTx | 1 byte | 680 | NumTxAck | 1 byte | 681 +-----------------+-------------------+ 683 Figure 3: MSF Statistics and their RECOMMENDED width. 685 16. Security Considerations 687 MSF defines a series of "rules" for the node to follow. It triggers 688 several actions, that are carried out by the protocols defined in the 689 following specifications: the Minimal IPv6 over the TSCH Mode of IEEE 690 802.15.4e (6TiSCH) Configuration [RFC8180], the 6TiSCH Operation 691 Sublayer Protocol (6P) [RFC8480], and the Minimal Security Framework 692 for 6TiSCH [I-D.ietf-6tisch-minimal-security]. In particular, MSF 693 does not define a new protocol or packet format. 695 MSF relies entirely on the security mechanisms defined in the 696 specifications listed above. 698 17. IANA Considerations 700 17.1. MSF Scheduling Function Identifiers 702 This document adds the following number to the "6P Scheduling 703 Function Identifiers" sub-registry, part of the "IPv6 over the TSCH 704 mode of IEEE 802.15.4e (6TiSCH) parameters" registry, as defined by 705 [RFC8480]: 707 +----------------------+-----------------------------+-------------+ 708 | SFID | Name | Reference | 709 +----------------------+-----------------------------+-------------+ 710 | IANA_6TISCH_SFID_MSF | Minimal Scheduling Function | RFC_THIS | 711 | | (MSF) | | 712 +----------------------+-----------------------------+-------------+ 714 Figure 4: IETF IE Subtype '6P'. 716 18. References 718 18.1. Normative References 720 [I-D.ietf-6tisch-architecture] 721 Thubert, P., "An Architecture for IPv6 over the TSCH mode 722 of IEEE 802.15.4", draft-ietf-6tisch-architecture-24 (work 723 in progress), July 2019. 725 [I-D.ietf-6tisch-dtsecurity-zerotouch-join] 726 Richardson, M., "6tisch Zero-Touch Secure Join protocol", 727 draft-ietf-6tisch-dtsecurity-zerotouch-join-03 (work in 728 progress), October 2018. 730 [I-D.ietf-6tisch-minimal-security] 731 Vucinic, M., Simon, J., Pister, K., and M. Richardson, 732 "Minimal Security Framework for 6TiSCH", draft-ietf- 733 6tisch-minimal-security-11 (work in progress), June 2019. 735 [I-D.richardson-6tisch-join-enhanced-beacon] 736 Dujovne, D. and M. Richardson, "IEEE802.15.4 Informational 737 Element encapsulation of 6tisch Join Information", draft- 738 richardson-6tisch-join-enhanced-beacon-03 (work in 739 progress), January 2018. 741 [IEEE802154-2015] 742 IEEE standard for Information Technology, "IEEE Std 743 802.15.4-2015 Standard for Low-Rate Wireless Personal Area 744 Networks (WPANs)", December 2015. 746 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 747 Requirement Levels", BCP 14, RFC 2119, 748 DOI 10.17487/RFC2119, March 1997, 749 . 751 [RFC6550] Winter, T., Ed., Thubert, P., Ed., Brandt, A., Hui, J., 752 Kelsey, R., Levis, P., Pister, K., Struik, R., Vasseur, 753 JP., and R. Alexander, "RPL: IPv6 Routing Protocol for 754 Low-Power and Lossy Networks", RFC 6550, 755 DOI 10.17487/RFC6550, March 2012, 756 . 758 [RFC8180] Vilajosana, X., Ed., Pister, K., and T. Watteyne, "Minimal 759 IPv6 over the TSCH Mode of IEEE 802.15.4e (6TiSCH) 760 Configuration", BCP 210, RFC 8180, DOI 10.17487/RFC8180, 761 May 2017, . 763 [RFC8480] Wang, Q., Ed., Vilajosana, X., and T. Watteyne, "6TiSCH 764 Operation Sublayer (6top) Protocol (6P)", RFC 8480, 765 DOI 10.17487/RFC8480, November 2018, 766 . 768 [RFC8505] Thubert, P., Ed., Nordmark, E., Chakrabarti, S., and C. 769 Perkins, "Registration Extensions for IPv6 over Low-Power 770 Wireless Personal Area Network (6LoWPAN) Neighbor 771 Discovery", RFC 8505, DOI 10.17487/RFC8505, November 2018, 772 . 774 18.2. Informative References 776 [SAX-DASFAA] 777 Ramakrishna, M. and J. Zobel, "Performance in Practice of 778 String Hashing Functions", DASFAA , 1997. 780 Appendix A. Contributors 782 Beshr Al Nahas (Chalmers University, beshr@chalmers.se) Olaf 783 Landsiedel (Chalmers University, olafl@chalmers.se) Yasuyuki Tanaka 784 (Inria-Paris, yasuyuki.tanaka@inria.fr) 786 Appendix B. Example of Implementation of SAX hash function 788 For the consideration of interoperability, this section provides an 789 example of implemention SAX hash function [SAX-DASFAA]. The input 790 parameters of the function are: 792 o T, which is the hashing table length 793 o c, which is the characters of string s, to be hashed 794 In MSF, the T is replaced by the length slotframe 1. String s is 795 replaced by the mote EUI64 address. The characters of the string c0, 796 c1, ..., c7 are the 8 bytes of EUI64 address. 798 The SAX hash function requires shift operation which is defined as 799 follow: 801 o L_shift(v,b), which refers to left shift variable v by b bits 802 o R_shift(v,b), which refers to right shift variable v by b bits 804 The steps to calculate the hash value of SAX hash function are: 806 1. initialize variable h to h0 and variable i to 0, where h is the 807 intermediate hash value and i is the index of the bytes of EUI64 808 address 809 2. sum the value of L_shift(h,l_bit), R_shift(h,r_bit) and ci 810 3. calculate the result of exclusive or between the sum value in 811 Step 2 and h 812 4. modulo the result of Step 3 by T 813 5. assign the result of Step 4 to h 814 6. increase i by 1 815 7. repeat Step2 to Step 6 until i reaches to 8 816 8. assign the result of Step 5 to h 818 The value of variable h the hash value of SAX hash function. 820 For interoperability purposes, the values of h0, l_bit and r_bit in 821 Step 1 and 2 are configured as: 823 o h0 = 0 824 o l_bit = 0 825 o r_bit = 1 827 The appropriate values of l_bit and r_bit could vary depending on the 828 the set of motes' EUI64 address. How to find those values is out of 829 the scope of this specification. 831 Authors' Addresses 833 Tengfei Chang (editor) 834 Inria 835 2 rue Simone Iff 836 Paris 75012 837 France 839 Email: tengfei.chang@inria.fr 840 Malisa Vucinic 841 Inria 842 2 rue Simone Iff 843 Paris 75012 844 France 846 Email: malisa.vucinic@inria.fr 848 Xavier Vilajosana 849 Universitat Oberta de Catalunya 850 156 Rambla Poblenou 851 Barcelona, Catalonia 08018 852 Spain 854 Email: xvilajosana@uoc.edu 856 Simon Duquennoy 857 RISE SICS 858 Isafjordsgatan 22 859 164 29 Kista 860 Sweden 862 Email: simon.duquennoy@ri.se 864 Diego Dujovne 865 Universidad Diego Portales 866 Escuela de Informatica y Telecomunicaciones 867 Av. Ejercito 441 868 Santiago, Region Metropolitana 869 Chile 871 Phone: +56 (2) 676-8121 872 Email: diego.dujovne@mail.udp.cl