idnits 2.17.1 draft-ietf-6tisch-msf-08.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 (November 4, 2019) is 1635 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 618 -- Looks like a reference, but probably isn't: '3' on line 618 -- Looks like a reference, but probably isn't: '4' on line 618 -- Looks like a reference, but probably isn't: '2' on line 618 -- Looks like a reference, but probably isn't: '0' on line 618 -- Looks like a reference, but probably isn't: '5' on line 618 -- Looks like a reference, but probably isn't: '6' on line 618 -- Looks like a reference, but probably isn't: '7' on line 618 -- Looks like a reference, but probably isn't: '9' on line 618 == Outdated reference: A later version (-30) exists of draft-ietf-6tisch-architecture-28 ** 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-13 ** 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: May 7, 2020 X. Vilajosana 6 Universitat Oberta de Catalunya 7 S. Duquennoy 8 RISE SICS 9 D. Dujovne 10 Universidad Diego Portales 11 November 4, 2019 13 6TiSCH Minimal Scheduling Function (MSF) 14 draft-ietf-6tisch-msf-08 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 May 7, 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 sent 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 frame 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 the node's preferred parent. Without 389 specific declaring, all cells mentioned in this section are 390 negotiated cells 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 cells listed in CellList in 6P Request frame 434 SHOULD be either Tx=1 only or Rx=1 only. Both NumCellsElapsed and 435 NumCellsUsed counters can be used to both type of negotiated cells. 437 As there is no negotiated Rx Cell installed at initial, the 438 AutoRxCell is taken into account as well for downstream traffic 439 adaptation. Hence by default, each node at least has one Rx cell in 440 schedule for counting the NumCellsElapsed and NumCellsUsed of 441 dwonstream traffic. 443 Implementors MAY choose to create the same counters for each 444 neighbor, and add them as additional statistics in the neighbor 445 table. 447 The counters are used as follows: 449 1. Both NumCellsElapsed and NumCellsUsed are initialized to 0 when 450 the node boots. 451 2. When the value of NumCellsElapsed reaches MAX_NUMCELLS: 453 * If NumCellsUsed > LIM_NUMCELLSUSED_HIGH, trigger 6P to add a 454 single cell to the preferred parent 455 * If NumCellsUsed < LIM_NUMCELLSUSED_LOW, trigger 6P to remove a 456 single cell to the preferred parent 457 * Reset both NumCellsElapsed and NumCellsUsed to 0 and go to 458 step 2. 460 The value of MAX_NUMCELLS is chosen according to the traffic type of 461 the network. Generally speaking, the larger the value MAX_NUMCELLS 462 is, the more accurate the cell usage is calculated. The 6P traffic 463 overhead using a larger value of MAX_NUMCELLS could be reduced as 464 well. Meanwhile, the latency won't increase much by using a larger 465 value of MAX_NUMCELLS for periodic traffic type. For burst traffic 466 type, larger value of MAX_NUMCELLS indeed introduces higher latency. 467 The latency caused by slight changes of traffic load can be absolved 468 by the additional scheduled cells. In this sense, MSF is a 469 scheduling function trading latency with energy by scheduling more 470 cells than needed. It is recommended to set MAX_NUMCELLS value at 471 least 4 times than the maximum link traffic load of the network in 472 packets per slotframe. For example, a 2 packets/slotframe traffic 473 load results an average 4 cells scheduled, using the value of double 474 number of scheduled cells (which is 8) as MAX_NUMCELLS gives a good 475 resolution on cell usage calculation. 477 5.2. Switching Parent 479 A node implementing MSF SHOULD implement the behavior described in 480 this section. 482 Part of its normal operation, the RPL routing protocol can have a 483 node switch preferred parent. The procedure for switching from the 484 old preferred parent to the new preferred parent is: 486 1. the node counts the number of negotiated cells it has per 487 slotframe to the old preferred parent 488 2. the node triggers one or more 6P ADD commands to schedule the 489 same number of negotiated cells with same cell options to the new 490 preferred parent 491 3. when that successfully completes, the node issues a 6P CLEAR 492 command to its old preferred parent 494 5.3. Handling Schedule Collisions 496 A node implementing MSF SHOULD implement the behavior described in 497 this section. The "MUST" statements in this section hence only apply 498 if the node implements schedule collision handling. 500 Since scheduling is entirely distributed, there is a non-zero 501 probability that two pairs of nearby neighbor nodes schedule a 502 negotiated cell at the same [slotOffset,channelOffset] location in 503 the TSCH schedule. In that case, data exchanged by the two pairs may 504 collide on that cell. We call this case a "schedule collision". 506 The node MUST maintain the following counters for each managed 507 unicast cell to its preferred parent: 509 NumTx: Counts the number of transmission attempts on that cell. 510 Each time the node attempts to transmit a frame on that cell, 511 NumTx is incremented by exactly 1. 512 NumTxAck: Counts the number of successful transmission attempts on 513 that cell. Each time the node receives an acknowledgment for a 514 transmission attempt, NumTxAck is incremented by exactly 1. 516 Implementors MAY choose to maintain the same counters for each 517 negotiated cell in the schedule. 519 Since both NumTx and NumTxAck are initialized to 0, we necessarily 520 have NumTxAck <= NumTx. We call Packet Delivery Ratio (PDR) the 521 ratio NumTxAck/NumTx; and represent it as a percentage. A cell with 522 PDR=50% means that half of the frames transmitted are not 523 acknowledged (and need to be retransmitted). 525 Each time the node switches preferred parent (or during the join 526 process when the node selects a preferred parent for the first time), 527 both NumTx and NumTxAck MUST be reset to 0. They increment over 528 time, as the schedule is executed and the node sends frames to its 529 preferred parent. When NumTx reaches MAX_NUMTX, both NumTx and 530 NumTxAck MUST be divided by 2. That is, for example, from NumTx=256 531 and NumTxAck=128, they become NumTx=128 and NumTxAck=64. This 532 operation does not change the value of the PDR, but allows the 533 counters to keep incrementing. The value of MAX_NUMTX is 534 implementation-specific. 536 The key for detecting a schedule collision is that, if a node has 537 several cells to the same preferred parent, all cells should exhibit 538 the same PDR. A cell which exhibits a PDR significantly lower than 539 the others indicates than there are collisions on that cell. 541 Every HOUSEKEEPINGCOLLISION_PERIOD, the node executes the following 542 steps: 544 1. It computes, for each managed unicast cell with its preferred 545 parent (not for the autonomous cell), that cell's PDR. 546 2. Any cell that hasn't yet had NumTx divided by 2 since it was last 547 reset is skipped in steps 3 and 4. This avoids triggering cell 548 relocation when the values of NumTx and NumTxAck are not 549 statistically significant yet. 550 3. It identifies the cell with the highest PDR. 551 4. For any other cell, it compares its PDR against that of the cell 552 with the highest PDR. If the difference is larger than 553 RELOCATE_PDRTHRES, it triggers the relocation of that cell using 554 a 6P RELOCATE command. 556 6. 6P SIGNAL command 558 The 6P SIGNAL command is not used by MSF. 560 7. Scheduling Function Identifier 562 The Scheduling Function Identifier (SFID) of MSF is 563 IANA_6TISCH_SFID_MSF. 565 8. Rules for CellList 567 MSF uses 2-step 6P Transactions exclusively. 6P transactions are 568 only initiated by a node towards its preferred parent. As a result, 569 the cells to put in the CellList of a 6P ADD command, and in the 570 candidate CellList of a RELOCATE command, are chosen by the node 571 initiating the 6P transaction. In both cases, the same rules apply: 573 o The CellList is RECOMMENDED to have 5 or more cells. 574 o Each cell in the CellList MUST have a different slotOffset value. 575 o For each cell in the CellList, the node MUST NOT have any 576 scheduled cell on the same slotOffset. 577 o The slotOffset value of any cell in the CellList MUST NOT be the 578 same as the slotOffset of the minimal cell (slotOffset=0). 579 o The slotOffset of a cell in the CellList SHOULD be randomly and 580 uniformly chosen among all the slotOffset values that satisfy the 581 restrictions above. 582 o The channelOffset of a cell in the CellList SHOULD be randomly and 583 uniformly chosen in [0..numFrequencies], where numFrequencies 584 represents the number of frequencies a node can communicate on. 586 As a consequence of randomly cell selection, there is a non-zero 587 chance that nodes in the vicinity installed cells with same 588 slotOffset and channelOffset. An implementer MAY implement a 589 strategy to monitor the candidate cells before adding them in 590 CellList to avoid collision. For example, a node MAY maintain a 591 candidate cell pool for the CellList. The candidate cells in the 592 pool are pre-configured as Rx cells to promiscuously listen to detect 593 transmissions on those cells. If IEEE802.15.4 transmissions are 594 observed on one cell over multiple iterations of the schedule, that 595 cell is probably used by a TSCH neighbor. It is moved out from the 596 pool and a new cell is selected as a candidate cell. The cells in 597 CellList are picked from the candidate pool directly when required. 599 9. 6P Timeout Value 601 It is calculated for the worst case that a 6P response is received, 602 which means the 6P response is sent out successfully at the very 603 latest retransmission. And for each retransmission, it backs-off 604 with largest value. Hence the 6P timeout value is calculated as 605 ((2^MAXBE)-1)*MAXRETRIES*SLOTFRAME_LENGTH, where: 607 o MAXBE is the maximum backoff exponent used 608 o MAXRETRIES is the maximum retransmission times 609 o SLOTFRAME_LENGTH represents the length of slotframe 611 10. Rule for Ordering Cells 613 Cells are ordered slotOffset first, channelOffset second. 615 The following sequence is correctly ordered (each element represents 616 the [slottOffset,channelOffset] of a cell in the schedule): 618 [1,3],[1,4],[2,0],[5,3],[6,0],[6,3],[7,9] 620 11. Meaning of the Metadata Field 622 The Metadata field is not used by MSF. 624 12. 6P Error Handling 626 Section 6.2.4 of [RFC8480] lists the 6P Return Codes. Figure 1 lists 627 the same error codes, and the behavior a node implementing MSF SHOULD 628 follow. 630 +-----------------+----------------------+ 631 | Code | RECOMMENDED behavior | 632 +-----------------+----------------------+ 633 | RC_SUCCESS | nothing | 634 | RC_EOL | nothing | 635 | RC_ERR | quarantine | 636 | RC_RESET | quarantine | 637 | RC_ERR_VERSION | quarantine | 638 | RC_ERR_SFID | quarantine | 639 | RC_ERR_SEQNUM | clear | 640 | RC_ERR_CELLLIST | clear | 641 | RC_ERR_BUSY | waitretry | 642 | RC_ERR_LOCKED | waitretry | 643 +-----------------+----------------------+ 645 Figure 1: Recommended behavior for each 6P Error Code. 647 The meaning of each behavior from Figure 1 is: 649 nothing: Indicates that this Return Code is not an error. No error 650 handling behavior is triggered. 651 clear: Abort the 6P Transaction. Issue a 6P CLEAR command to that 652 neighbor (this command may fail at the link layer). Remove all 653 cells scheduled with that neighbor from the local schedule. Keep 654 that node in the neighbor and routing tables. 655 quarantine: Same behavior as for "clear". In addition, remove the 656 node from the neighbor and routing tables. Place the node's 657 identifier in a quarantine list for QUARANTINE_DURATION. When in 658 quarantine, drop all frames received from that node. 659 waitretry: Abort the 6P Transaction. Wait for a duration randomly 660 and uniformly chosen in [WAITDURATION_MIN,WAITDURATION_MAX]. 661 Retry the same transaction. 663 13. Schedule Inconsistency Handling 665 The behavior when schedule inconsistency is detected is explained in 666 Figure 1, for 6P Return Code RC_ERR_SEQNUM. 668 14. MSF Constants 670 Figure 2 lists MSF Constants and their RECOMMENDED values. 672 +------------------------------+-------------------+ 673 | Name | RECOMMENDED value | 674 +------------------------------+-------------------+ 675 | NUM_CH_OFFSET | 16 | 676 | KA_PERIOD | 1 min | 677 | LIM_NUMCELLSUSED_HIGH | 75 % | 678 | LIM_NUMCELLSUSED_LOW | 25 % | 679 | HOUSEKEEPINGCOLLISION_PERIOD | 1 min | 680 | RELOCATE_PDRTHRES | 50 % | 681 | SLOTFRAME_LENGTH | 101 slots | 682 | QUARANTINE_DURATION | 5 min | 683 | WAITDURATION_MIN | 30 s | 684 | WAITDURATION_MAX | 60 s | 685 +------------------------------+-------------------+ 687 Figure 2: MSF Constants and their RECOMMENDED values. 689 15. MSF Statistics 691 Figure 3 lists MSF Statistics and their RECOMMENDED width. 693 +-----------------+-------------------+ 694 | Name | RECOMMENDED width | 695 +-----------------+-------------------+ 696 | NumCellsElapsed | 1 byte | 697 | NumCellsUsed | 1 byte | 698 | NumTx | 1 byte | 699 | NumTxAck | 1 byte | 700 +-----------------+-------------------+ 702 Figure 3: MSF Statistics and their RECOMMENDED width. 704 16. Security Considerations 706 MSF defines a series of "rules" for the node to follow. It triggers 707 several actions, that are carried out by the protocols defined in the 708 following specifications: the Minimal IPv6 over the TSCH Mode of IEEE 709 802.15.4e (6TiSCH) Configuration [RFC8180], the 6TiSCH Operation 710 Sublayer Protocol (6P) [RFC8480], and the Minimal Security Framework 711 for 6TiSCH [I-D.ietf-6tisch-minimal-security]. In particular, MSF 712 does not define a new protocol or packet format. 714 MSF relies entirely on the security mechanisms defined in the 715 specifications listed above. 717 17. IANA Considerations 719 17.1. MSF Scheduling Function Identifiers 721 This document adds the following number to the "6P Scheduling 722 Function Identifiers" sub-registry, part of the "IPv6 over the TSCH 723 mode of IEEE 802.15.4e (6TiSCH) parameters" registry, as defined by 724 [RFC8480]: 726 +----------------------+-----------------------------+-------------+ 727 | SFID | Name | Reference | 728 +----------------------+-----------------------------+-------------+ 729 | IANA_6TISCH_SFID_MSF | Minimal Scheduling Function | RFC_THIS | 730 | | (MSF) | | 731 +----------------------+-----------------------------+-------------+ 733 Figure 4: IETF IE Subtype '6P'. 735 18. References 737 18.1. Normative References 739 [I-D.ietf-6tisch-architecture] 740 Thubert, P., "An Architecture for IPv6 over the TSCH mode 741 of IEEE 802.15.4", draft-ietf-6tisch-architecture-28 (work 742 in progress), October 2019. 744 [I-D.ietf-6tisch-dtsecurity-zerotouch-join] 745 Richardson, M., "6tisch Zero-Touch Secure Join protocol", 746 draft-ietf-6tisch-dtsecurity-zerotouch-join-04 (work in 747 progress), July 2019. 749 [I-D.ietf-6tisch-minimal-security] 750 Vucinic, M., Simon, J., Pister, K., and M. Richardson, 751 "Minimal Security Framework for 6TiSCH", draft-ietf- 752 6tisch-minimal-security-13 (work in progress), October 753 2019. 755 [I-D.richardson-6tisch-join-enhanced-beacon] 756 Dujovne, D. and M. Richardson, "IEEE802.15.4 Informational 757 Element encapsulation of 6tisch Join Information", draft- 758 richardson-6tisch-join-enhanced-beacon-03 (work in 759 progress), January 2018. 761 [IEEE802154-2015] 762 IEEE standard for Information Technology, "IEEE Std 763 802.15.4-2015 Standard for Low-Rate Wireless Personal Area 764 Networks (WPANs)", December 2015. 766 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 767 Requirement Levels", BCP 14, RFC 2119, 768 DOI 10.17487/RFC2119, March 1997, 769 . 771 [RFC6550] Winter, T., Ed., Thubert, P., Ed., Brandt, A., Hui, J., 772 Kelsey, R., Levis, P., Pister, K., Struik, R., Vasseur, 773 JP., and R. Alexander, "RPL: IPv6 Routing Protocol for 774 Low-Power and Lossy Networks", RFC 6550, 775 DOI 10.17487/RFC6550, March 2012, 776 . 778 [RFC8180] Vilajosana, X., Ed., Pister, K., and T. Watteyne, "Minimal 779 IPv6 over the TSCH Mode of IEEE 802.15.4e (6TiSCH) 780 Configuration", BCP 210, RFC 8180, DOI 10.17487/RFC8180, 781 May 2017, . 783 [RFC8480] Wang, Q., Ed., Vilajosana, X., and T. Watteyne, "6TiSCH 784 Operation Sublayer (6top) Protocol (6P)", RFC 8480, 785 DOI 10.17487/RFC8480, November 2018, 786 . 788 [RFC8505] Thubert, P., Ed., Nordmark, E., Chakrabarti, S., and C. 789 Perkins, "Registration Extensions for IPv6 over Low-Power 790 Wireless Personal Area Network (6LoWPAN) Neighbor 791 Discovery", RFC 8505, DOI 10.17487/RFC8505, November 2018, 792 . 794 18.2. Informative References 796 [SAX-DASFAA] 797 Ramakrishna, M. and J. Zobel, "Performance in Practice of 798 String Hashing Functions", DASFAA , 1997. 800 Appendix A. Contributors 802 Beshr Al Nahas (Chalmers University, beshr@chalmers.se) Olaf 803 Landsiedel (Chalmers University, olafl@chalmers.se) Yasuyuki Tanaka 804 (Inria-Paris, yasuyuki.tanaka@inria.fr) 806 Appendix B. Example of Implementation of SAX hash function 808 Considering the interoperability, this section provides an example of 809 implemention SAX hash function [SAX-DASFAA]. The input parameters of 810 the function are: 812 o T, which is the hashing table length 813 o c, which is the characters of string s, to be hashed 814 In MSF, the T is replaced by the length slotframe 1. String s is 815 replaced by the mote EUI64 address. The characters of the string c0, 816 c1, ..., c7 are the 8 bytes of EUI64 address. 818 The SAX hash function requires shift operation which is defined as 819 follow: 821 o L_shift(v,b), which refers to left shift variable v by b bits 822 o R_shift(v,b), which refers to right shift variable v by b bits 824 The steps to calculate the hash value of SAX hash function are: 826 1. initialize variable h to h0 and variable i to 0, where h is the 827 intermediate hash value and i is the index of the bytes of EUI64 828 address 829 2. sum the value of L_shift(h,l_bit), R_shift(h,r_bit) and ci 830 3. calculate the result of exclusive or between the sum value in 831 Step 2 and h 832 4. modulo the result of Step 3 by T 833 5. assign the result of Step 4 to h 834 6. increase i by 1 835 7. repeat Step2 to Step 6 until i reaches to 8 836 8. assign the result of Step 5 to h 838 The value of variable h is the hash value of SAX hash function. 840 The values of h0, l_bit and r_bit in Step 1 and 2 are configured as: 842 o h0 = 0 843 o l_bit = 0 844 o r_bit = 1 846 The appropriate values of l_bit and r_bit could vary depending on the 847 the set of motes' EUI64 address. How to find those values is out of 848 the scope of this specification. 850 Authors' Addresses 852 Tengfei Chang (editor) 853 Inria 854 2 rue Simone Iff 855 Paris 75012 856 France 858 Email: tengfei.chang@inria.fr 859 Malisa Vucinic 860 Inria 861 2 rue Simone Iff 862 Paris 75012 863 France 865 Email: malisa.vucinic@inria.fr 867 Xavier Vilajosana 868 Universitat Oberta de Catalunya 869 156 Rambla Poblenou 870 Barcelona, Catalonia 08018 871 Spain 873 Email: xvilajosana@uoc.edu 875 Simon Duquennoy 876 RISE SICS 877 Isafjordsgatan 22 878 164 29 Kista 879 Sweden 881 Email: simon.duquennoy@ri.se 883 Diego Dujovne 884 Universidad Diego Portales 885 Escuela de Informatica y Telecomunicaciones 886 Av. Ejercito 441 887 Santiago, Region Metropolitana 888 Chile 890 Phone: +56 (2) 676-8121 891 Email: diego.dujovne@mail.udp.cl