idnits 2.17.1 draft-ietf-6tisch-msf-06.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 (August 12, 2019) is 1717 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 599 -- Looks like a reference, but probably isn't: '3' on line 599 -- Looks like a reference, but probably isn't: '4' on line 599 -- Looks like a reference, but probably isn't: '2' on line 599 -- Looks like a reference, but probably isn't: '0' on line 599 -- Looks like a reference, but probably isn't: '5' on line 599 -- Looks like a reference, but probably isn't: '6' on line 599 -- Looks like a reference, but probably isn't: '7' on line 599 -- Looks like a reference, but probably isn't: '9' on line 599 == 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') ** 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: February 13, 2020 X. Vilajosana 6 Universitat Oberta de Catalunya 7 S. Duquennoy 8 RISE SICS 9 D. Dujovne 10 Universidad Diego Portales 11 August 12, 2019 13 6TiSCH Minimal Scheduling Function (MSF) 14 draft-ietf-6tisch-msf-06 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 February 13, 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. End State . . . . . . . . . . . . . . . . . . . . . . . . 8 78 5. Rules for Adding/Deleting Cells . . . . . . . . . . . . . . . 8 79 5.1. Adapting to Traffic . . . . . . . . . . . . . . . . . . . 8 80 5.2. Switching Parent . . . . . . . . . . . . . . . . . . . . 10 81 5.3. Handling Schedule Collisions . . . . . . . . . . . . . . 10 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 6 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 2. Interface to the Minimal 6TiSCH Configuration 148 A node implementing MSF SHOULD implement the Minimal 6TiSCH 149 Configuration [RFC8180], which defines the "minimal cell", a single 150 shared cell providing minimal connectivity between the nodes in the 151 network. The MSF implementation provided in this specification is 152 based on the implementation of the Minimal 6TiSCH Configuration. 153 However, an implementor MAY implement MSF without implementing 154 Minimal 6TiSCH Configuration. 156 MSF uses the minimal cell to exchange the following packets: 158 1. Enhanced Beacons (EBs), defined by [IEEE802154-2015]. These are 159 broadcast frames. 160 2. Broadcast DODAG Information Objects (DIOs), defined by [RFC6550]. 161 Unicast DIOs SHOULD NOT be sent on minimal cell. 163 To ensure there is enough bandwidth available on the minimal cell, a 164 node implementing MSF SHOULD enforce some rules for limiting the 165 traffic of broadcast frames. For example, a Trickle Timer defined in 166 [RFC6550] MAY be applied on DIOs. However, this behavior is 167 implementation-specific which is out of the scope of MSF. 169 MSF RECOMMENDS the use of 3 slotframes. MSF schedules autonomous 170 cells at Slotframe 1 (Section 3) and 6P negotiated cells at Slotframe 171 2 (Section 5) , while Slotframe 0 is used for the bootstrap traffic 172 as defined in the Minimal 6TiSCH Configuration. It is RECOMMENDED to 173 use the same slotframe length for Slotframe 0, 1 and 2. Thus it is 174 possible to avoid the scheduling collision between the autonomous 175 cells and 6P negotiated cells (Section 3). The default slotframe 176 length (SLOTFRAME_LENGTH) is RECOMMENDED for Slotframe 0, 1 and 2, 177 although any value can be advertised in the EBs. 179 3. Autonomous Cells 181 MSF nodes initialize Slotframe 1 with a set of default cells for 182 unicast communication with their neighbors. These cells are called 183 'autonomous cells', because they are maintained autonomously by each 184 node without negotiation through 6P. Cells scheduled by 6P 185 transaction are called 'negotiated cells' which are reserved on 186 Slotframe 2. How to schedule negotiated cells is detailed in 187 Section 5. There are two types of autonomous cells: 189 o Autonomous Rx Cell (AutoRxCell), one cell at a 190 [slotOffset,channelOffset] computed as a hash of the EUI64 of the 191 node itself (detailed next). Its cell options bits are assigned 192 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.8 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. End State 348 For a new node, the end state of the joining process is: 350 o it is synchronized to the network 351 o it is using the link-layer keying material it learned through the 352 secure joining process 353 o it has identified its preferred routing parent 354 o it has one AutRxCell 355 o it has one negotiated Tx cell to its parent 356 o it starts to send DIOs, potentially serving as a router for other 357 nodes' traffic 358 o it starts to send EBs, potentially serving as a JP for new pledge 360 5. Rules for Adding/Deleting Cells 362 Once a node has joined the 6TiSCH network, it adds/deletes/relocates 363 cells with its preferred parent for three reasons: 365 o to match the link-layer resources to the traffic between the node 366 and its preferred parent (Section 5.1) 367 o to handle switching preferred parent or(Section 5.2) 368 o to handle a schedule collision (Section 5.3) 370 Those cells are called 'negotiated cells' as they are scheduled 371 through 6P, negotiated with their parents. Without specific 372 declaring, all cells mentioned in this section are negotiated cells 373 and they are installed at Slotframe 2. 375 5.1. Adapting to Traffic 377 A node implementing MSF MUST implement the behavior described in this 378 section. 380 The goal of MSF is to manage the communication schedule in the 6TiSCH 381 schedule in a distributed manner. For a node, this translates into 382 monitoring the current usage of the cells it has to its preferred 383 parent: 385 o If the node determines that the number of link-layer frames it is 386 attempting to exchange with its preferred parent per unit of time 387 is larger than the capacity offered by the TSCH negotiated cells 388 it has scheduled with it, the node issues a 6P ADD command to its 389 preferred parent to add cells to the TSCH schedule. 390 o If the traffic is lower than the capacity, the node issues a 6P 391 DELETE command to its preferred parent to delete cells from the 392 TSCH schedule. 394 The node MUST maintain the following counters for its preferred 395 parent: 397 NumCellsElapsed : Counts the number of negotiated cells that have 398 elapsed since the counter was initialized. This counter is 399 initialized at 0. Each time the TSCH state machine indicates 400 that the current cell is a negotiated cell to the preferred 401 parent, NumCellsElapsed is incremented by exactly 1, regardless 402 of whether the cell is used to transmit/receive a frame. 403 NumCellsUsed: Counts the number of negotiated cells that have been 404 used. This counter is initialized at 0. NumCellsUsed is 405 incremented by exactly 1 when, during a negotiated cell to the 406 preferred parent, either of the following happens: 408 * The node sends a frame to its preferred parent. The counter 409 increments regardless of whether a link-layer acknowledgment 410 was received or not. 411 * The node receives a frame from its preferred parent. The 412 counter increments regardless of whether the frame is a valid 413 IEEE802.15.4 frame or not. 415 The cell option of the cell listed CellList in 6P Request SHOULD be 416 either Tx=1 only or Rx=1 only. Both NumCellsElapsed and NumCellsUsed 417 counters can be used to both type of negotiated cells. 419 As there is no negotiated Rx Cell installed at initial, the AutRxCell 420 is taken into account as well for downstream traffic adaptation. 421 Hence by default, each node at least has one Rx cell in schedule for 422 counting the NumCellsElapsed and NumCellsUsed of dwonstream traffic. 424 Implementors MAY choose to create the same counters for each 425 neighbor, and add them as additional statistics in the neighbor 426 table. 428 The counters are used as follows: 430 1. Both NumCellsElapsed and NumCellsUsed are initialized to 0 when 431 the node boots. 432 2. When the value of NumCellsElapsed reaches MAX_NUMCELLS: 434 * If NumCellsUsed > LIM_NUMCELLSUSED_HIGH, trigger 6P to add a 435 single cell to the preferred parent 436 * If NumCellsUsed < LIM_NUMCELLSUSED_LOW, trigger 6P to remove a 437 single cell to the preferred parent 438 * Reset both NumCellsElapsed and NumCellsUsed to 0 and go to 439 step 2. 441 The value of MAX_NUMCELLS is chosen according to the traffic type of 442 the network. Generally speaking, the larger the value MAX_NUMCELLS 443 is, the more accurate the cell usage is calculated. The 6P traffic 444 overhead using a larger value of MAX_NUMCELLS could be reduced as 445 well. Meanwhile, the latency won't increaase much by using a larger 446 value of MAX_NUMCELLS for periodic traffic type. For burst traffic 447 type, larger value of MAX_NUMCELLS indeed introduces higher latency. 448 The latency caused by slight changes of traffic load can be absolved 449 by the additional scheduled cells. In this sense, MSF is a 450 scheduling function trading latency with energy by scheduling more 451 cells than needed. It is recommended to set MAX_NUMCELLS value at 452 least 4 times than the maximum link traffic load of the network in 453 packets per slotframe. For example, a 2 packets/slotframe traffic 454 load results an average 4 cells scheduled, using the value of double 455 number of scheduled cells (which is 8) as MAX_NUMCELLS gives a good 456 resolution on cell usage calculation. 458 5.2. Switching Parent 460 A node implementing MSF SHOULD implement the behavior described in 461 this section. 463 Part of its normal operation, the RPL routing protocol can have a 464 node switch preferred parent. The procedure for switching from the 465 old preferred parent to the new preferred parent is: 467 1. the node counts the number of negotiated cells it has per 468 slotframe to the old preferred parent 469 2. the node triggers one or more 6P ADD commands to schedule the 470 same number of negotiated cells with same cell options to the new 471 preferred parent 472 3. when that successfully completes, the node issues a 6P CLEAR 473 command to its old preferred parent 475 5.3. Handling Schedule Collisions 477 A node implementing MSF SHOULD implement the behavior described in 478 this section. The "MUST" statements in this section hence only apply 479 if the node implements schedule collision handling. 481 Since scheduling is entirely distributed, there is a non-zero 482 probability that two pairs of nearby neighbor nodes schedule a 483 negotiated cell at the same [slotOffset,channelOffset] location in 484 the TSCH schedule. In that case, data exchanged by the two pairs may 485 collide on that cell. We call this case a "schedule collision". 487 The node MUST maintain the following counters for each managed 488 unicast cell to its preferred parent: 490 NumTx: Counts the number of transmission attempts on that cell. 491 Each time the node attempts to transmit a frame on that cell, 492 NumTx is incremented by exactly 1. 493 NumTxAck: Counts the number of successful transmission attempts on 494 that cell. Each time the node receives an acknowledgment for a 495 transmission attempt, NumTxAck is incremented by exactly 1. 497 Implementors MAY choose to maintain the same counters for each 498 negotiated cell in the schedule. 500 Since both NumTx and NumTxAck are initialized to 0, we necessarily 501 have NumTxAck <= NumTx. We call Packet Delivery Ratio (PDR) the 502 ratio NumTxAck/NumTx; and represent it as a percentage. A cell with 503 PDR=50% means that half of the frames transmitted are not 504 acknowledged (and need to be retransmitted). 506 Each time the node switches preferred parent (or during the join 507 process when the node selects a preferred parent for the first time), 508 both NumTx and NumTxAck MUST be reset to 0. They increment over 509 time, as the schedule is executed and the node sends frames to its 510 preferred parent. When NumTx reaches MAX_NUMTX, both NumTx and 511 NumTxAck MUST be divided by 2. That is, for example, from NumTx=256 512 and NumTxAck=128, they become NumTx=128 and NumTxAck=64. This 513 operation does not change the value of the PDR, but allows the 514 counters to keep incrementing. The value of MAX_NUMTX is 515 implementation-specific. 517 The key for detecting a schedule collision is that, if a node has 518 several cells to the same preferred parent, all cells should exhibit 519 the same PDR. A cell which exhibits a PDR significantly lower than 520 the others indicates than there are collisions on that cell. 522 Every HOUSEKEEPINGCOLLISION_PERIOD, the node executes the following 523 steps: 525 1. It computes, for each managed unicast cell with its preferred 526 parent (not for the autonomous cell), that cell's PDR. 527 2. Any cell that hasn't yet had NumTx divided by 2 since it was last 528 reset is skipped in steps 3 and 4. This avoids triggering cell 529 relocation when the values of NumTx and NumTxAck are not 530 statistically significant yet. 531 3. It identifies the cell with the highest PDR. 532 4. For any other cell, it compares its PDR against that of the cell 533 with the highest PDR. If the difference is larger than 534 RELOCATE_PDRTHRES, it triggers the relocation of that cell using 535 a 6P RELOCATE command. 537 6. 6P SIGNAL command 539 The 6P SIGNAL command is not used by MSF. 541 7. Scheduling Function Identifier 543 The Scheduling Function Identifier (SFID) of MSF is 544 IANA_6TISCH_SFID_MSF. 546 8. Rules for CellList 548 MSF uses 2-step 6P Transactions exclusively. 6P Transactions are 549 only initiated by a node towards its preferred parent. As a result, 550 the cells to put in the CellList of a 6P ADD command, and in the 551 candidate CellList of a RELOCATE command, are chosen by the node 552 initiating the 6P Transaction. In both cases, the same rules apply: 554 o The CellList is RECOMMENDED to have 5 or more cells. 555 o Each cell in the CellList MUST have a different slotOffset value. 556 o For each cell in the CellList, the node MUST NOT have any 557 scheduled cell on the same slotOffset. 558 o The slotOffset value of any cell in the CellList MUST NOT be the 559 same as the slotOffset of the minimal cell (slotOffset=0). 560 o The slotOffset of a cell in the CellList SHOULD be randomly and 561 uniformly chosen among all the slotOffset values that satisfy the 562 restrictions above. 563 o The channelOffset of a cell in the CellList SHOULD be randomly and 564 uniformly chosen in [0..numFrequencies], where numFrequencies 565 represents the number of frequencies a node can communicate on. 567 As a consequence of randomly cell selection, there is a non-zero 568 chance that nodes in the vicinity installed cells with same 569 slotOffset and channelOffset. An implementer MAY implement a 570 strategy to monitor the candidate cells before adding them in 571 CellList to avoid collision. For example, a node MAY maintain a 572 candidate cell pool for the CellList. The candidate cells in the 573 pool are pre-configured as Rx cells to listen whether there is any 574 incoming frame on those cells. If any IEEE802.15.4 frames are 575 received within a pre-defined duration on one cell, that cell will be 576 moved out from the pool and a new cell is selected as a candidate 577 cell. The cells in CellList are picked from the candidate pool 578 directly when required. 580 9. 6P Timeout Value 582 It is calculated for the worst case that a 6P response is received, 583 which means the 6P response is sent out successfully at the very 584 latest retransmission. And for each retransmission, it backs-off 585 with largest value. Hence the 6P timeout value is calculated as 586 ((2^MAXBE)-1)*MAXRETRIES*SLOTFRAME_LENGTH, where: 588 o MAXBE is the maximum backoff exponent used 589 o MAXRETRIES is the maximum retransmission times 590 o SLOTFRAME_LENGTH represents the length of slotframe 592 10. Rule for Ordering Cells 594 Cells are ordered slotOffset first, channelOffset second. 596 The following sequence is correctly ordered (each element represents 597 the [slottOffset,channelOffset] of a cell in the schedule): 599 [1,3],[1,4],[2,0],[5,3],[6,0],[6,3],[7,9] 601 11. Meaning of the Metadata Field 603 The Metadata field is not used by MSF. 605 12. 6P Error Handling 607 Section 6.2.4 of [RFC8480] lists the 6P Return Codes. Figure 1 lists 608 the same error codes, and the behavior a node implementing MSF SHOULD 609 follow. 611 +-----------------+----------------------+ 612 | Code | RECOMMENDED behavior | 613 +-----------------+----------------------+ 614 | RC_SUCCESS | nothing | 615 | RC_EOL | nothing | 616 | RC_ERR | quarantine | 617 | RC_RESET | quarantine | 618 | RC_ERR_VERSION | quarantine | 619 | RC_ERR_SFID | quarantine | 620 | RC_ERR_SEQNUM | clear | 621 | RC_ERR_CELLLIST | clear | 622 | RC_ERR_BUSY | waitretry | 623 | RC_ERR_LOCKED | waitretry | 624 +-----------------+----------------------+ 626 Figure 1: Recommended behavior for each 6P Error Code. 628 The meaning of each behavior from Figure 1 is: 630 nothing: Indicates that this Return Code is not an error. No error 631 handling behavior is triggered. 632 clear: Abort the 6P Transaction. Issue a 6P CLEAR command to that 633 neighbor (this command may fail at the link layer). Remove all 634 cells scheduled with that neighbor from the local schedule. Keep 635 that node in the neighbor and routing tables. 636 quarantine: Same behavior as for "clear". In addition, remove the 637 node from the neighbor and routing tables. Place the node's 638 identifier in a quarantine list for QUARANTINE_DURATION. When in 639 quarantine, drop all frames received from that node. 640 waitretry: Abort the 6P Transaction. Wait for a duration randomly 641 and uniformly chosen in [WAITDURATION_MIN,WAITDURATION_MAX]. 642 Retry the same transaction. 644 13. Schedule Inconsistency Handling 646 The behavior when schedule inconsistency is detected is explained in 647 Figure 1, for 6P Return Code RC_ERR_SEQNUM. 649 14. MSF Constants 651 Figure 2 lists MSF Constants and their RECOMMENDED values. 653 +------------------------------+-------------------+ 654 | Name | RECOMMENDED value | 655 +------------------------------+-------------------+ 656 | NUM_CH_OFFSET | 16 | 657 | LIM_NUMCELLSUSED_HIGH | 75 % | 658 | LIM_NUMCELLSUSED_LOW | 25 % | 659 | HOUSEKEEPINGCOLLISION_PERIOD | 1 min | 660 | RELOCATE_PDRTHRES | 50 % | 661 | SLOTFRAME_LENGTH | 101 slots | 662 | QUARANTINE_DURATION | 5 min | 663 | WAITDURATION_MIN | 30 s | 664 | WAITDURATION_MAX | 60 s | 665 +------------------------------+-------------------+ 667 Figure 2: MSF Constants and their RECOMMENDED values. 669 15. MSF Statistics 671 Figure 3 lists MSF Statistics and their RECOMMENDED width. 673 +-----------------+-------------------+ 674 | Name | RECOMMENDED width | 675 +-----------------+-------------------+ 676 | NumCellsElapsed | 1 byte | 677 | NumCellsUsed | 1 byte | 678 | NumTx | 1 byte | 679 | NumTxAck | 1 byte | 680 +-----------------+-------------------+ 682 Figure 3: MSF Statistics and their RECOMMENDED width. 684 16. Security Considerations 686 MSF defines a series of "rules" for the node to follow. It triggers 687 several actions, that are carried out by the protocols defined in the 688 following specifications: the Minimal IPv6 over the TSCH Mode of IEEE 689 802.15.4e (6TiSCH) Configuration [RFC8180], the 6TiSCH Operation 690 Sublayer Protocol (6P) [RFC8480], and the Minimal Security Framework 691 for 6TiSCH [I-D.ietf-6tisch-minimal-security]. In particular, MSF 692 does not define a new protocol or packet format. 694 MSF relies entirely on the security mechanisms defined in the 695 specifications listed above. 697 17. IANA Considerations 699 17.1. MSF Scheduling Function Identifiers 701 This document adds the following number to the "6P Scheduling 702 Function Identifiers" sub-registry, part of the "IPv6 over the TSCH 703 mode of IEEE 802.15.4e (6TiSCH) parameters" registry, as defined by 704 [RFC8480]: 706 +----------------------+-----------------------------+-------------+ 707 | SFID | Name | Reference | 708 +----------------------+-----------------------------+-------------+ 709 | IANA_6TISCH_SFID_MSF | Minimal Scheduling Function | RFC_THIS | 710 | | (MSF) | | 711 +----------------------+-----------------------------+-------------+ 713 Figure 4: IETF IE Subtype '6P'. 715 18. References 717 18.1. Normative References 719 [I-D.ietf-6tisch-architecture] 720 Thubert, P., "An Architecture for IPv6 over the TSCH mode 721 of IEEE 802.15.4", draft-ietf-6tisch-architecture-24 (work 722 in progress), July 2019. 724 [I-D.ietf-6tisch-dtsecurity-zerotouch-join] 725 Richardson, M., "6tisch Zero-Touch Secure Join protocol", 726 draft-ietf-6tisch-dtsecurity-zerotouch-join-04 (work in 727 progress), July 2019. 729 [I-D.ietf-6tisch-minimal-security] 730 Vucinic, M., Simon, J., Pister, K., and M. Richardson, 731 "Minimal Security Framework for 6TiSCH", draft-ietf- 732 6tisch-minimal-security-12 (work in progress), July 2019. 734 [I-D.richardson-6tisch-join-enhanced-beacon] 735 Dujovne, D. and M. Richardson, "IEEE802.15.4 Informational 736 Element encapsulation of 6tisch Join Information", draft- 737 richardson-6tisch-join-enhanced-beacon-03 (work in 738 progress), January 2018. 740 [IEEE802154-2015] 741 IEEE standard for Information Technology, "IEEE Std 742 802.15.4-2015 Standard for Low-Rate Wireless Personal Area 743 Networks (WPANs)", December 2015. 745 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 746 Requirement Levels", BCP 14, RFC 2119, 747 DOI 10.17487/RFC2119, March 1997, 748 . 750 [RFC6550] Winter, T., Ed., Thubert, P., Ed., Brandt, A., Hui, J., 751 Kelsey, R., Levis, P., Pister, K., Struik, R., Vasseur, 752 JP., and R. Alexander, "RPL: IPv6 Routing Protocol for 753 Low-Power and Lossy Networks", RFC 6550, 754 DOI 10.17487/RFC6550, March 2012, 755 . 757 [RFC8180] Vilajosana, X., Ed., Pister, K., and T. Watteyne, "Minimal 758 IPv6 over the TSCH Mode of IEEE 802.15.4e (6TiSCH) 759 Configuration", BCP 210, RFC 8180, DOI 10.17487/RFC8180, 760 May 2017, . 762 [RFC8480] Wang, Q., Ed., Vilajosana, X., and T. Watteyne, "6TiSCH 763 Operation Sublayer (6top) Protocol (6P)", RFC 8480, 764 DOI 10.17487/RFC8480, November 2018, 765 . 767 [RFC8505] Thubert, P., Ed., Nordmark, E., Chakrabarti, S., and C. 768 Perkins, "Registration Extensions for IPv6 over Low-Power 769 Wireless Personal Area Network (6LoWPAN) Neighbor 770 Discovery", RFC 8505, DOI 10.17487/RFC8505, November 2018, 771 . 773 18.2. Informative References 775 [SAX-DASFAA] 776 Ramakrishna, M. and J. Zobel, "Performance in Practice of 777 String Hashing Functions", DASFAA , 1997. 779 Appendix A. Contributors 781 Beshr Al Nahas (Chalmers University, beshr@chalmers.se) Olaf 782 Landsiedel (Chalmers University, olafl@chalmers.se) Yasuyuki Tanaka 783 (Inria-Paris, yasuyuki.tanaka@inria.fr) 785 Appendix B. Example of Implementation of SAX hash function 787 For the consideration of interoperability, this section provides an 788 example of implemention SAX hash function [SAX-DASFAA]. The input 789 parameters of the function are: 791 o T, which is the hashing table length 792 o c, which is the characters of string s, to be hashed 793 In MSF, the T is replaced by the length slotframe 1. String s is 794 replaced by the mote EUI64 address. The characters of the string c0, 795 c1, ..., c7 are the 8 bytes of EUI64 address. 797 The SAX hash function requires shift operation which is defined as 798 follow: 800 o L_shift(v,b), which refers to left shift variable v by b bits 801 o R_shift(v,b), which refers to right shift variable v by b bits 803 The steps to calculate the hash value of SAX hash function are: 805 1. initialize variable h to h0 and variable i to 0, where h is the 806 intermediate hash value and i is the index of the bytes of EUI64 807 address 808 2. sum the value of L_shift(h,l_bit), R_shift(h,r_bit) and ci 809 3. calculate the result of exclusive or between the sum value in 810 Step 2 and h 811 4. modulo the result of Step 3 by T 812 5. assign the result of Step 4 to h 813 6. increase i by 1 814 7. repeat Step2 to Step 6 until i reaches to 8 815 8. assign the result of Step 5 to h 817 The value of variable h the hash value of SAX hash function. 819 For interoperability purposes, the values of h0, l_bit and r_bit in 820 Step 1 and 2 are configured as: 822 o h0 = 0 823 o l_bit = 0 824 o r_bit = 1 826 The appropriate values of l_bit and r_bit could vary depending on the 827 the set of motes' EUI64 address. How to find those values is out of 828 the scope of this specification. 830 Authors' Addresses 832 Tengfei Chang (editor) 833 Inria 834 2 rue Simone Iff 835 Paris 75012 836 France 838 Email: tengfei.chang@inria.fr 839 Malisa Vucinic 840 Inria 841 2 rue Simone Iff 842 Paris 75012 843 France 845 Email: malisa.vucinic@inria.fr 847 Xavier Vilajosana 848 Universitat Oberta de Catalunya 849 156 Rambla Poblenou 850 Barcelona, Catalonia 08018 851 Spain 853 Email: xvilajosana@uoc.edu 855 Simon Duquennoy 856 RISE SICS 857 Isafjordsgatan 22 858 164 29 Kista 859 Sweden 861 Email: simon.duquennoy@ri.se 863 Diego Dujovne 864 Universidad Diego Portales 865 Escuela de Informatica y Telecomunicaciones 866 Av. Ejercito 441 867 Santiago, Region Metropolitana 868 Chile 870 Phone: +56 (2) 676-8121 871 Email: diego.dujovne@mail.udp.cl