## 3 Design of MCSS
### Length Determination and Cell Allocation for WPT Slofframe
The HAP initializes variables (i.e., \(l_{minWPT,j}\) and \(primeNumFlag\)), and \(l_{minWPT,j}\) represents the minimum length required to determine the length of the WPT slotframe for the \(j\)-th HAP cluster, which is the sum of \(n_{reqPC,i}\) and \(n_{reqDC,i}\) for all cluster members in the HCT. In addition, \(primeNumFlag\) determines whether the HAP locates the smallest prime number greater than \(l_{minWPT,j}\). Then, the HAP calculates \(l_{minWPT,j}\) by adding \(n_{reqPC,i}\) and \(n_{reqDC,i}\) for all cluster members included in \(\textbf{ID}_{(j)}\). Moreover, \(l_{minWPT,j}\) of the \(j\)-th HAP, \(l_{minWPT,j}\), is calculated as follows:  
\[l_{\text{minWPT},j}=\sum_{k=0}^{n_{node,j}-1}(n_{reqPC,k}+n_{reqDC,k}),\ \ 0\leq k\leq n_{node,j}-1. \tag{19}\]  
If \(l_{minWPT,j}\) is not a prime number, the \(j\)-th HAP increases \(l_{minWPT,j}\) by increments of 1 to determine the smallest prime number greater than \(l_{minWPT,j}\). Finally, the HAP sets \(l_{WPT,j}\) to the determined \(l_{minWPT,j}\). After the length determination for the WPT slotframe is completed, the HAP broadcasts the EB frame to notify its cluster members of \(l_{WPT,j}\). ```
1:INITIALIZE\(primeNumFlag\) to TRUE, \(l_{minWPT,j}\) to 0
2:FOR\(id_{(j)}\), \(i\in\big{[}0,n_{node,j}\big{]}\)
3:\(l_{minWPT,j}\gets l_{minWPT,j}+n_{reqPC,i}+n_{reqDC,i}\)
4:ENDFOR
5:WHILE\(primeNumFlag\)
6:FOR each iteration, \(k\), \(j\in\big{[}2,\text{math.sqrt}(l_{minWPT,j})+1\big{]}\)
7:IF\(l_{minWPT,j}\)\(\%\)\(k==0\)
8:\(primeNumFlag\leftarrow\) TRUE
9:\(l_{minWPT,j}=l_{minWPT,j}+1\)
10: Break
11:ELSE
12:\(primeNumFlag\leftarrow\)FALSE
13:ENDIF
14:ENDFOR
15:ENDWHILE
16:\(l_{WPT,j}\gets l_{minWPT,j}\)
17:RETURN\(l_{WPT,j}\)
```  
**Algorithm 1**WPT slotframe length determination  
Upon receiving the EB frame, including the numbers of required power and data cells (\(n_{reqPC,i}\) and \(n_{reqDC,i}\)), the cluster member initiates the three-step 6P transaction to allocate power and data cells to the WPT slotframe. To this end, the \(i\)-th cluster member transmits the modified 6P ADD request, including \(n_{reqPC,i}\) and \(n_{reqDC,i}\) to its parent along with the empty PowerCellList and empty DataCellList. When the HAP receives the modified 6P ADDrequest from the \(i\)-th cluster member in the HAP cluster, it configures the PowerCellList and DataCellList for the \(i\)-th cluster member (\(\mathbf{PC}_{(i)}\) and \(\mathbf{DC}_{(i)}\)) by considering its WPT slotframe schedule. In addition, \(\mathbf{PC}_{(i)}\) and \(\mathbf{DC}_{(i)}\) are represented as follows:  
\[n_{CMcell,j}=\frac{l_{LCM,j}}{L_{CM}}\ (0<j\leq M), \tag{11}\]0  
\[n_{CMcell,j}=\frac{l_{LCM,j}}{L_{CM}}\ (0<j\leq M), \tag{11}\]1  
where \(pc_{(i,k)}\) and \(dc_{(i,l)}\) represent cells (i.e., timeslot and channel offset) for energy harvesting and data transmission, respectively. Moreover, \(k\) and \(l\) refer to the cell index in \(\mathbf{PC}_{(i)}\) and \(\mathbf{DC}_{(i)}\). Note that \(\mathbf{PC}_{(i)}\) and \(\mathbf{DC}_{(i)}\) consist of at least \(n_{req\text{PC},i}\) and \(n_{req\text{DC},i}\). When the configuration of \(\mathbf{PC}_{(i)}\) and \(\mathbf{DC}_{(i)}\) is completed, the HAP transmits the modified 6P ADD response to the \(i\)-th cluster member. Upon receiving the modified 6P ADD response, the \(i\)-th cluster member selects the required power and data cells from \(\mathbf{PC}_{(i)}\) and \(\mathbf{DC}_{(i)}\). Then, the \(i\)-th cluster member transmits the modified 6P ADD confirmation to its parent, including the selected required power and data cells. Finally, HAP adds the selected required power and data cells to its WPT slotframe schedule. Likewise, the \(i\)-th cluster member adds them to its WPT slotframe schedule. Thus, the three-step 6P transaction is completed. Figure 5 presents an example of the three-step 6P transaction in MCSS.