# Real-Time Station Grouping under Dynamic Traffic for IEEE 802.11 ah
## 3 IEEE 802.11 ah Restricted Access Window  
IEEE 802.11 ah operates over a set of unlicensed radio bands (all in the sub-1 GHz spectrum), supporting up to 1 km transmission range, and allowing up to 8192 stations to associate with a single AP. Due to these features, 802.11 ah is a highly attractive wireless communication technology for long-distance IoT use cases, such as smart meters and environmental/agricultural monitoring. This section provides an overview of the RAW station grouping feature of the 802.11 ah standard, which is the focus of this article. More detailed overview of the complete standard can be found in existing literature [4; 5; 6; 7]. The goal of the RAW mechanism is to mitigate collisions and improve performance in dense IoT networks where a large number of stations are contending for channel access simultaneously. It splits stations into groups and only allows stations assigned to a certain group to access the channel at specific times. Figure 1 schematically depicts how RAW works. Specifically, the channel time is split into several intervals, some of which are assigned to RAW groups, while the others are considered as shared channel airtime and can be accessed by all stations. Each interval assigned to a RAW group is preceded by a beacon frame carrying a RAW parameter set (RPS) information element that specifies the RAW related information, such as the stations belonging to the group, as well as the group start time. Moreover, each RAW group consists of one or more slots, over which the stations assigned to the RAW group are evenly split (using round robin assignment). The RPS information element also contains the number of slots, slot format and slot duration count sub-fields, which jointly determine the RAW slot duration as follows [32]:  
\[D=500\ \upmu\text{s}+C\times 120\ \upmu\text{s}, \tag{1}\]  
where \(C\) represents _slot duration count_ sub-field, which is either \(y=11\) or \(y=8\) bits long if the slot format sub-field is set to respectively 1 or 0. The _number of slots_ field is \(14-y\) bits long. When \(y=11\), each RAW consists of at most eight slots and the maximum value of \(C\) is \(2^{11}-1=2047\), the slot duration is up to 246.14 ms. Otherwise, each RAW consists of at most 64 slots and the maximum value of \(C\) is \(2^{8}-1=255\), the slot duration is limited to 31.1 ms. Stations are mapped to slots as follows [32]:  
\[i_{slot}=(x+N_{offset})\mod\quad N_{RAW}, \tag{2}\]  
where \(i_{slot}\) is the index of \(i^{th}\) RAW slot to which the station is mapped. \(N_{RAW}\) is the number of slots in one RAW. \(N_{offset}\) is the offset value in the mapping function to improve fairness and equals the two least significant octets of the _FCS field_ of the S1G beacon frame, and \(x\) is the index of the station. Figure 1 shows an example of the RAW slot assignment procedure. The RPS also contains the _cross slot boundary_ (CSB) sub-field. Stations are allowed to continue their ongoing transmissions even after the end of the current RAW slot when CSB is set to true. Otherwise, stations should not start a transmission if the remaining time in the current RAW slot is not enough to complete it. Different from previous IEEE 802.11 standards, each station uses two back-off states of enhanced distributed channel access (EDCA) to manage transmission inside and outside their assigned RAW slot respectively (cf. Figure 2). The first back-off function state is used outside RAW slots, while the second is used inside. For the first back-off state, the station suspends its back-off timer at the start of each RAW, and restores and resumes the back-off timer at the end of the RAW. For the second back-off state, stations start back-off with initial back-off state inside their own RAW slot, and discard the back-off state at the end of their RAW slot, effectively restarting their back-off at the start of their next RAW period. As shown in Figure 2, station 1 is inside the RAW group and assigned to slot 1, while station 2 is not included in this RAW group.