# Real-Time Station Grouping under Dynamic Traffic for IEEE 802.11 ah
## 4 Real-Time RAW Parameter Optimization
### Problem Statement  
We consider IoT sensor-based monitoring scenarios, where a large set of sensors \(\mathcal{S}\) send measurements to a back-end server (through the AP) at specific time intervals. A sensor \(s\in\mathcal{S}\), also referred to as a station, has a packet transmission interval \(\hat{t}^{s}_{int}\), which may change over time (e.g., when an environmental event triggers a change in the sensor measurement interval).  
The goal of RAW optimization is to assign stations to a set of RAW slots \(\mathcal{R}^{b}\) during each beacon interval \(b\), maximizing the number of successful transmissions. As an input, it uses only information readily available at the access point. The first input is the last-in-first-out (LIFO) queue of times a packet was successfully received by the AP from station \(s\) or \(t^{s}_{succ}\), where \(t^{s}_{succ}\left[0\right]\) represents the time of the last successful packet reception. The second input is the LIFO queue of transmission results (i.e., success or failure) \(\pi^{s}_{ttrans}\), where \(\pi^{s}_{ttrans}\left[0\right]\) is the result of the last transmission. A packet transmission is considered a failure if a RAW slot was assigned to a station, but no packet was received during that slot. The output of RAW optimization is, for each beacon interval \(b\), the set of RAW slots \(\mathcal{R}^{b}\), the set of stations \(\mathcal{S}^{\prime}\) assigned to each slot \(r\), and the duration \(t^{r}\) of each slot \(r\). The goal can then be formally defined as:  
\[\max\sum_{b}\sum_{r\in\mathcal{R}^{b}}\sum_{s\in\mathcal{S}^{\prime}}\pi^{s}_{ b,r} \tag{3}\]  
where \(\pi^{s}_{b,r}\) represents the number of packets successfully received by the AP from station \(s\) during beacon interval \(b\).  
\begin{table}
\begin{tabular}{l c} \hline \hline
**General Variables** & **Description** \\ \hline \(\mathcal{S}\) & Set of all stations \\ \(\mathcal{S}_{true}\) & Queue of stations sorted by increasing next transmission time \(t^{s}_{next}\) \\ \(t_{c}\) & Current time\({}^{\star}\) \\ \hline \multicolumn{3}{l}{**Variables of Beacon Interval \(b\)**} \\ \hline \(\mathcal{R}^{b}\) & Set of RAW slots in beacon interval \(b\) \\ \(t^{b}\) & Total beacon interval time minus beacon transmission time \\ \(\mathcal{S}^{b}\) & Set of stations that are allowed to transmit in the beacon interval \(b\) \\ \(\pi^{b}_{max}\) & Theoretical maximum number of packet transmissions in beacon interval \(b\) \\ \(\pi^{b}\) & Number of packet transmissions in beacon interval \(b\) \\ \hline \multicolumn{3}{l}{**Variables of RAW Slot \(r\in\mathcal{R}^{b}\)**} \\ \hline \(\mathcal{S}^{r}\) & **Description** \\ \(\sigma^{r}_{opt}\) & Set of stations assigned to RAW slot \(r\) \\ \(\pi^{r}\) & Optimal number of stations in RAW slot \(r\) based on throughput \\ \(t^{r}\) & Number of packet transmissions in RAW slot \(r\) \\ \(t^{r}\) & RAW slot duration \\ \hline \multicolumn{3}{l}{**Variables of Station \(s\in\mathcal{S}\)**} \\ \hline \(\pi^{s}_{b,r}\) & Number of packets received by the AP in RAW slot \(r\) of beacon interval \(b\) from station \(s\) \\ \(\pi^{s}_{failed}\) & Number of consecutive failed transmissions of station \(S^{i}\) \\ \(\pi^{s}_{next}\) & Estimated next transmission time \({}^{\star}\) \\ \(\pi^{s}_{int}\) & Estimated transmission interval \({}^{\star}\) \\ \(\pi^{s}_{int}\) & Real transmission interval \({}^{\star}\) \\ \(t^{s}_{succ}\left[0\right]\) & Last successful transmission time \({}^{\star}\) \\ \(\pi^{s}_{tmax}\left[1\right]\) & Previous to last successful transmission time \({}^{\star}\) \\ \(\pi^{s}_{ttrans}\left[0\right]\) & Last transmission result, success or failure \\ \(\pi^{s}_{ttrans}\left[1\right]\) & Previous to last transmission result, success or failure \\ \hline \hline \end{tabular} \({}^{\star}\) Expressed as a multiple of number of beacon intervals.  
\end{table}
Table 2: Variables and notations introduced in the algorithm description.