Once a node has joined the 6TiSCH network, it adds/deletes/relocates cells with the selected parent for three reasons:
-
to match the link-layer resources to the traffic between the node and the selected parent (Section 5.1),
-
to handle switching the parent (Section 5.2), or
-
to handle a schedule collision (Section 5.3).
These cells are called "negotiated cells" as they are scheduled through 6P and negotiated with the node's parent. Without specific declaration, all cells mentioned in this section are negotiated cells, and they are installed at Slotframe 2.
A node implementing MSF
MUST implement the behavior described in this section.
The goal of MSF is to manage the communication schedule in the 6TiSCH schedule in a distributed manner. For a node, this translates into monitoring the current usage of the cells it has to one of its neighbors, in most cases to the selected parent.
-
If the node determines that the number of link-layer frames it is attempting to exchange with the selected parent per unit of time is larger than the capacity offered by the TSCH negotiated cells it has scheduled with it, the node issues a 6P ADD command to that parent to add cells to the TSCH schedule.
-
If the traffic is lower than the capacity, the node issues a 6P DELETE command to that parent to delete cells from the TSCH schedule.
The node
MUST maintain two separate pairs of the following counters for the selected parent: one for the negotiated Tx cells to that parent and one for the negotiated Rx cells to that parent.
-
NumCellsElapsed:
-
Counts the number of negotiated cells that have elapsed since the counter was initialized. This counter is initialized at 0. When the current cell is declared as a negotiated cell to the selected parent, NumCellsElapsed is incremented by exactly 1, regardless of whether the cell is used to transmit or receive a frame.
-
NumCellsUsed:
-
Counts the number of negotiated cells that have been used. This counter is initialized at 0. NumCellsUsed is incremented by exactly 1 when, during a negotiated cell to the selected parent, either of the following happens:
-
The node sends a frame to the parent. The counter increments regardless of whether a link-layer acknowledgment was received or not.
-
The node receives a valid frame from the parent. The counter increments only when a valid frame per [IEEE802154] is received by the node from its parent.
The cell option of cells listed in CellList in a 6P Request frame
SHOULD be either (Tx=1, Rx=0) only or (Tx=0, Rx=1) only. Both NumCellsElapsed and NumCellsUsed counters can be used for both types of negotiated cells.
As there is no negotiated Rx cell installed at initial time, the AutoRxCell is taken into account as well for downstream traffic adaptation. In this case:
-
NumCellsElapsed is incremented by exactly 1 when the current cell is AutoRxCell.
-
NumCellsUsed is incremented by exactly 1 when the node receives a frame from the selected parent on AutoRxCell.
Implementors
MAY choose to create the same counters for each neighbor and add them as additional statistics in the neighbor table.
The counters are used as follows:
-
Both NumCellsElapsed and NumCellsUsed are initialized to 0 when the node boots.
-
When the value of NumCellsElapsed reaches MAX_NUM_CELLS:
-
If NumCellsUsed is greater than LIM_NUMCELLSUSED_HIGH, trigger 6P to add a single cell to the selected parent.
-
If NumCellsUsed is less than LIM_NUMCELLSUSED_LOW, trigger 6P to remove a single cell to the selected parent.
-
Reset both NumCellsElapsed and NumCellsUsed to 0 and restart #2.
The value of MAX_NUM_CELLS is chosen according to the traffic type of the network. Generally speaking, the larger the value MAX_NUM_CELLS is, the more accurately the cell usage is calculated. By using a larger value of MAX_NUM_CELLS, the 6P traffic overhead could be reduced as well. Meanwhile, the latency won't increase much by using a larger value of MAX_NUM_CELLS for periodic traffic type. For bursty traffic, a larger value of MAX_NUM_CELLS indeed introduces higher latency. The latency caused by slight changes of traffic load can be alleviated by the additional scheduled cells. In this sense, MSF is a Scheduling Function that trades latency with energy by scheduling more cells than needed. Setting MAX_NUM_CELLS to a value at least four times the recent maximum number of cells used in a slotframe is
RECOMMENDED. For example, a two packets/slotframe traffic load results in an average of four cells scheduled (two cells are used), using at least the value of double the number of scheduled cells (which is eight) as MAX_NUM_CELLS gives a good resolution on the cell usage calculation.
In the case that a node has booted or has disappeared from the network, the cell reserved at the selected parent may be kept in the schedule forever. A cleanup mechanism
MUST be provided to resolve this issue. The cleanup mechanism is implementation-specific. The goal is to confirm that those negotiated cells are not used anymore by the associated neighbors and remove them from the schedule.
A node implementing MSF
SHOULD implement the behavior described in this section.
As part of its normal operation, RPL can have a node switch parent. The procedure for switching from the old parent to the new parent is the following:
-
The node counts the number of negotiated cells it has per slotframe to the old parent.
-
The node triggers one or more 6P ADD commands to schedule the same number of negotiated cells with same cell options to the new parent.
-
When that successfully completes, the node issues a 6P CLEAR command to its old parent.
The type of negotiated cell that should be installed first depends on which traffic has the higher priority, upstream or downstream, which is application-specific and out of scope of MSF.
A node implementing MSF
SHOULD implement the behavior described in this section. Other algorithms for handling schedule collisions can be an alternative to the algorithm proposed in this section.
Since scheduling is entirely distributed, there is a nonzero probability that two pairs of nearby neighbor nodes schedule a negotiated cell at the same [slotOffset,channelOffset] location in the TSCH schedule. In that case, data exchanged by the two pairs may collide on that cell. We call this case a "schedule collision".
The node
MUST maintain the following counters for each negotiated Tx cell to the selected parent:
-
NumTx:
-
Counts the number of transmission attempts on that cell. Each time the node attempts to transmit a frame on that cell, NumTx is incremented by exactly 1.
-
NumTxAck:
-
Counts the number of successful transmission attempts on that cell. Each time the node receives an acknowledgment for a transmission attempt, NumTxAck is incremented by exactly 1.
Since both NumTx and NumTxAck are initialized to 0, we necessarily have NumTxAck less than or equal to NumTx. We call Packet Delivery Ratio (PDR) the ratio NumTxAck/NumTx and represent it as a percentage. A cell with a PDR equal to 50% means that half of the frames transmitted are not acknowledged.
Each time the node switches parent (or during the join process when the node selects a parent for the first time), both NumTx and NumTxAck
MUST be reset to 0. They increment over time, as the schedule is executed, and the node sends frames to that parent. When NumTx reaches MAX_NUMTX, both NumTx and NumTxAck
MUST be divided by 2. MAX_NUMTX needs to be a power of two to avoid division error. For example, when MAX_NUMTX is set to 256, and NumTx=255 and NumTxAck=127, the counters become NumTx=128 and NumTxAck=64 if one frame is sent to the parent with an acknowledgment received. This operation does not change the value of the PDR but allows the counters to keep incrementing. The value of MAX_NUMTX is implementation-specific.
The key for detecting a schedule collision is that, if a node has several cells to the selected parent, all cells should exhibit the same PDR. A cell that exhibits a PDR significantly lower than the others indicates that there are collisions on that cell.
Every HOUSEKEEPINGCOLLISION_PERIOD, the node executes the following steps:
-
It computes, for each negotiated Tx cell with the parent (not for the autonomous cell), that cell's PDR.
-
Any cell that hasn't yet had NumTx divided by 2 since it was last reset is skipped in steps 3 and 4. This avoids triggering cell relocation when the values of NumTx and NumTxAck are not statistically significant yet.
-
It identifies the cell with the highest PDR.
-
For any other cell, it compares its PDR against that of the cell with the highest PDR. If the subtraction difference between the PDR of the cell and the highest PDR is larger than RELOCATE_PDRTHRES, it triggers the relocation of that cell using a 6P RELOCATE command.
The RELOCATION for negotiated Rx cells is not supported by MSF.