# On-Demand Scheduling of Command and Responses for Low-Power Multihop Wireless Networks +
## 4 SCoRe Design
### Recursive \(N_{\text{dslot}}\) Gathering  
Figure 2 illustrates the key idea of SCoRe through an example. SCoRe allocates \(N_{\text{dslot}}\) to each node where \(N_{\text{dslot}}\) consist of two components: (1) \(N_{\text{dslot}}^{\text{hyv}}\), which is the sum of response-phase slots and command-phase slots for itself, and (2) \(N_{\text{dslot}}^{\text{subtree}}\), which is the sum of \(N_{\text{dslot}}\) of its subtree. \(N_{\text{dslot}}^{\text{my}}\) for response-phase is the hop count \(H\) of each node (as a packet from this node requires \(H\) transmissions to reach the root), and \(M\) for command-phase which is the number of transmissions configured for command dissemination (e.g., flooding [13; 22]). That is, \(N_{\text{dslot}}^{\text{my}}=H+M\). For example, \(N_{\text{dslot}}^{\text{my}}\) for a 3-hop node is 3+\(M\), 3 for response, and \(M\) for command. SCoRe does assume that it can obtain parent-child relationship and hop-depth information from its routing tree topology, which is common in most routing protocols for low-power wireless networks [23; 24; 45; 46].  
For SCoRe to gather \(N_{\text{dslot}}\) (2 bytes) from network nodes, each node informs its parent by piggybacking the sum of the number of timeslots it needs (\(N_{\text{dslot}}^{\text{my}}\)) together with an aggregate sum of \(N_{\text{dslot}}\) of its 1-hop children (\(N_{\text{dslot}}^{\text{subtree}}\)) in the upward route-notification packet such as DAO in RPL [24] (Without loss of generality, other similar routing protocols [23; 46] can be used.). In Figure 2, for example, node A requires \(1+M\) slots for itself (\(N_{\text{dslot}}^{\text{my}}\)), and additional \(7+M\) slots for its subtree (\(N_{\text{dslot}}^{\text{subtree}}\)), totaling to \(8+2M\) (\(N_{\text{dslot}}\)). The parent receiving \(N_{\text{dslot}}\) from its children does not have to know how many \(N_{\text{dslot}}\) each of its descendants need; it just needs to know the total amount of \(N_{\text{dslot}}\) its subtree rooted at that child will use. This aggregated number will eventually reach the root recursively via regular routing updates (e.g., DIO/DAO in RPL) without creating extra packets.  
Calculation of total \(N_{\text{dslot}}\) can be expressed as Equation (4),  
\[N_{\text{dslot}_{i}}^{\text{my}} =H_{i}+M \tag{1}\] \[N_{\text{dslot}_{i}}^{\text{subtree}} =\sum_{j=1}^{L}N_{\text{dslot}_{j}}\text{ (for $\forall j\in 1$-hop children of $i$)}\] (2) \[N_{\text{dslot}_{i}} =N_{\text{dslot}}^{\text{my}}+N_{\text{dslot}}^{\text{subtree}}\] (3) \[=\sum_{j=1}^{L}N_{\text{dslot}_{j}}+H_{i}+M \tag{4}\]  
where \(i\) and \(j\) denote nodes that calculate total \(N_{\text{dslot}}\) and its child, respectively. \(L\) is the number of \(i\)'s children. \(i\) forwards the sum of its children's \(N_{\text{dslot}}\), its hop count \(H\) and the number of dissemination \(M\) to its parent. \(M\) may be omitted for leaf nodes (if such information exists in the routing protocol) because leaf nodes need not be responsible for dissemination.  
SCoRe's gathering allows each node to know the total time needed for command dissemination and response collection in its sub-network, and thus it can schedule the (relative) transmission times in its subtree, on-demand when needed.