# 3 MSF: A Multi-Modal Adaptation of the 6 TiSCH Minimal Scheduling Function for the Industrial IoT
## Appendix B Quirks of MSF  
As mentioned throughout this paper, 3 MSF is based on MSF [7], arguably the most popular decentralized TSCH SF. However, there are certain peculiarities to MSF. In particular, the 6P Timeout value and the windowed counter mechanism for the management of negotiated cells raise questions. That is, for a two-step transaction, according to RFC 8480 [11] (Section 3.4.4), \"[t]he value of the 6P Timeout should be greater than the longest possible time it takes to receive the 6P Response\". MSF then tries to fulfill this requirement by defining the 6P Timeout according to (A1). \[\left(2^{MaxBe}-1\right)\times MaxFrameRetries\times|SO|\] (A1)  
where: \begin{tabular}{l|l} _MaxBe_ & the largest backoff exponent used by the TSCH backoff algorithm for shared cells [2] (Section 6.2.5.3); \\ _MaxFrameRetries_ & the maximum number of retransmissions of a single packet, \\  & which equates to the maximum number of Tx attempts \(-1\); \\ \(|SO|\) & the number of slot offsets in a slotframe (starting from 0), i.e., \\  & the \"slotframe length\". \\ \end{tabular}   
At first glance, this accounts for the worst-case scenario, wherein the transmission of a 6P response is only successful at the last possible Tx attempt, all those attempts occurred on shared cells, and we had to back off for the largest possible number of shared cells in between them. However, this fails to account for any sort of buffering of outgoing packets, which is part of most (if not all) TSCH implementations since opportunities to transmit towards a given neighbor can be scarce. This ties in with MSF's second quirk, i.e., the windowed counter mechanism for negotiated cell management. More specifically, the mechanism for adding/deleting negotiated Rx cells towards the preferred parent is slightly problematic. That is, unlike a negotiated Tx cell, immediately adding at least one negotiated Rx cell towards a parent when it becomes preferred is not mandatory. Instead, MSF [7] says to count incoming packets (from the preferred parent) on the autonomous Rx cell when a node has no negotiated Rx cell towards its preferred parent yet and to add one such cell when the count (for those incoming packets) exceeds a certain threshold in a given counter window. However, autonomous cells are shared, and the concept of backing off only applies to Tx cells, meaning the backoff mechanism is transparent to the node at the Rx side of a shared cell! As such, if there is a lot of contention on a given autonomous cell, a parent might back off an excessive number of times towards a given child. Upon this occurrence, the child might erroneously understand there to be no need for a dedicated negotiated Rx cell towards its preferred parent while the parent's outgoing buffer keeps filling up with packets, eventually causing it to overflow. To address this issue, we propose using a lower value for LIM_NUMCELLSUED_HIGH before adding the first negotiated Rx cell towards the preferred parent and using the normal limit value thereafter, even if the first negotiated Rx cell is subsequently removed. It should be noted that 3 MSF does not use this bootstrap threshold because it does not rely on shared cells in any way. Addressing the issue with the 6P Timeout value is less straightforward. Assuming transmit buffers have a simple First In, First Out (FIFO) structure, if we tried to increase the value to accommodate any meaningful buffer size (i.e., by multiplying (A1) by the buffer size, assuming the 6P response is always at the back of the buffer), the timeout would (very) quickly become so large that 6 top would become virtually unusable (since there is a typically rather low limit to the number of simultaneously ongoing 6P transactions any single node can support) and the network would grind to a halt, which is not so far-fetched if you consider that most 6P responses are sent on shared (!) autonomous cells.