Resource Allocation for Machine-Type Communication of Energy-Harvesting Devices in Wi-Fi HaLow Networks

The recent Wi-Fi HaLow technology focuses on adopting Wi-Fi for the needs of the Internet of Things. A key feature of Wi-Fi HaLow is the Restricted Access Window (RAW) mechanism that allows an access point to divide the sensors into groups and to assign each group to an exclusively reserved time interval where only the stations of a particular group can transmit. In this work, we study how to optimally configure RAW in a scenario with a high number of energy harvesting sensor devices. For such a scenario, we consider a problem of device grouping and develop a model of data transmission, which takes into account the peculiarities of channel access and the fact that the devices can run out of energy within the allocated intervals. We show how to use the developed model in order to determine the optimal duration of RAW intervals and the optimal number of groups that provide the required probability of data delivery and minimize the amount of consumed channel resources. The numerical results show that the optimal RAW configuration can reduce the amount of consumed channel resources by almost 50%.


Introduction
The concept of the Internet of Things (IoT) [1] with its tremendous number of interconnected autonomous devices has become very attractive for device vendors, mobile operators, and their customers [2]. In addition to whipping up the telecommunication market, IoT brings new services and applications, which will revolutionize our life. From the technical point of view, it is evident that the easiest way to provide Internet access for the swarm of devices is using wireless communications. At the same time, it is not clear how to do it the most efficiently.
Another challenge is the energy consumption. Since it may be difficult, if even possible, to wire thousands of devices to an electric grid, autonomous devices are typically battery-supplied and/or harvest solar, wind, or other kinds of green energy. Using green energy may be especially fruitful in rural deployments, e.g., for agriculture monitoring. However, energy harvesting still needs energy storage. Unfortunately, from both technical and ecological points of view, the usage of traditional accumulators by autonomous devices is limited. First, their efficiency degrades with every recharge cycle. Second, they typically contain much mercury, cadmium, lead, or other dangerous poisonous access, and thus, the conditions for the other STAs are improved, which also affects the packet loss rate. Thus, it is important to consider the amount of energy available for the STAs while studying the data transmission solutions for wireless sensor networks.
The core contribution of this paper is the performance evaluation of the channel access method introduced in the 802.11ah amendment in networks with energy-harvesting devices. For that, we significantly extend our approach previously developed in [27,28] to model RAW behavior. In contrast to [27,28], in this paper, we consider a more complex scenario when we develop our mathematical model.
First, the STAs are energy harvesting and are supplied by a limited source of energy, so, during the transmission within the RAW slot, an STA can stop contending for the channel because of the depletion of the energy. This factor is important for two reasons. On the one hand, an STA that does not have enough energy fails to deliver its traffic during the RAW slot. On the other hand, when other STAs stop contending for the channel, the probability of successful transmission for the considered STA increases.
Second, the transmission attempts can fail because of collisions and the random noise in the channel, which is new.
With the developed mathematical model and simulation, we find non-obvious effects, which we describe and explain in the paper. Finally, we show how to use the model to find an optimal RAW configuration, i.e., such RAW parameters that minimize channel time consumption by the energy-harvesting devices and, at the same time, guarantee the delivery of the data with the required probability. We also show that the usage of models that does not take into account the limited sensor's energy and the parameters of random noise in the channel can lead to an incorrect choice of RAW parameters, which cannot provide the required probability of data delivery.
The rest of the paper is organized as follows. In Section 2, we describe the studied scenario in more detail and state the problem solved in the paper. Section 3 reviews the papers related to the subject of wireless energy-limited device networks, IEEE 802.11ah networks, and data transmission in Random Access Window. In Section 4, we design an analytical model to solve the stated problem. In Section 5, we present and discuss the numerical results obtained with the model. Section 6 summarizes the main results of the study.

Channel Access Method
The core idea of RAW is that an AP can select several STAs and allocate them a time interval called the RAW slot, during which only the selected STAs can transmit their packets while the other STAs are forbidden to access the channel. The AP can allocate a single RAW slot to a group of STAs or can establish a long-term periodic RAW slot allocation (so-called Periodic RAW or PRAW). With PRAW, the AP allocates to a group of STAs a series of equidistant time intervals of the same duration. In this article, we consider the PRAW approach since it introduces less overhead than repeating a single RAW slot allocation.
To access the channel during its RAW slot, the STA uses a native Wi-Fi enhanced distributed channel access (EDCA), which implements Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA). In summary, it works as follows. At the beginning of the slot, the STA initializes a backoff counter with a random integer value equiprobably drawn from the interval [0, CW 0 − 1], where CW 0 is the minimal contention window (a configurable network parameter). If the channel is idle during time σ, the STA decrements the backoff counter. If the channel is busy, the STA freezes its backoff counter and waits until the medium becomes free. It unfreezes the backoff counter when the channel has been idle during the arbitration interframe space (AIFS). When the backoff counter reaches zero, the STA transmits its data frame, provided that the transmission, including the expected acknowledgment frame (ACK), ends before the termination of the RAW slot.
If a frame transmission fails because of the random noise or collisions, the ACK does not arrive. Thus, the STA considers the transmission attempt as unsuccessful and increments the retry counter r (initially set to zero). If the retry counter reaches the Retry Limit RL, the pending frame is dropped. Otherwise, the STA repeats the transmission attempt. For that, it equiprobably draws a new backoff value from doubled contention window [0, CW r − 1], where CW r = min{CW max , 2CW r−1 }. (1)

Scenario
Let us consider a network with an AP, many energy harvesting sensor STAs, and several offloading STAs. From time to time, energy-harvesting STAs generate some small portion of information and intend to transmit a packet with this information to the AP. The packet shall be delivered to the AP no later than D max after it has been generated. Otherwise, it becomes outdated and is discarded by the STA. Additionally, the ratio of delivered packets shall not be less than p req . To simplify the further analysis, we assume that all packets have the same size.
The AP divides energy-harvesting STAs into several groups and assigns a periodic series of RAW slots to each group. The energy-harvesting STAs transmit their packets only in their own RAW slots. The offloading STAs are allowed to transmit only outside the allocated RAW intervals, as shown in Figure 1.
offloading STAs RAW slots We consider that the STAs assigned to the same RAW slot are located in the transmission range of each other, i.e., they are not hidden from each other. Such an assumption is reasonable because IEEE 802.11ah provides several ways to avoid hidden STAs and improve performance. First, during the association process, the AP can determine the direction for each sensor STA and then group STAs with respect to their locations. Second, it can use the sectorization mechanism, which allows only those STAs to transmit that are located in a given sector [18,30].
Every STA generates a Poisson flow of packets, the intensity of which is much lower than 1 D max and the period of RAW slots allocated to the STA. Having generated a packet, an energy-harvesting STA waits for its slot and tries to deliver the packet. A transmission attempt may fail because of the random noise in the channel or collisions. The STA's transmission is damaged by noise with probability p.
If the transmission attempt is unsuccessful, the STA repeats it if the retry limit is not reached. As soon as the packet is successfully delivered, the STA switches off its radio interface to save energy.
The STAs are supplied by a capacitor or small accumulator and can slowly harvest the energy from the environment, e.g., using a solar cell, motion, or an RF energy harvester [31]. We assume that at the beginning of the RAW slot, the STA has a random amount Q of energy, which it has harvested since the last transmission attempt. When an STA listens to the channel or tries to transmit a frame, it consumes energy. As in [32][33][34], if the STA's energy becomes less than the amount required to transmit a frame, the STA switches off its radio interface at least until the next RAW slot, even if its packet is not delivered. In addition, the STA switches off its radio at the end of the RAW slot.
Since this research is focused on the evaluation of channel access in Wi-Fi HaLow networks using RAW, we consider a simplified model of energy harvesting and, similarly to [32,34,35], assume that the amount of energy that the STA harvests since the last transmission attempt linearly depends on the elapsed time, i.e., we consider that the fluctuations related with the instability of the energy source, e.g., the variability of the solar flux caused by the clouds, are averaged over a sufficiently large period of time. In our scenario, it is justified by the assumption that the RAW period is much higher than the RAW slot duration. The average amount of Q of energy harvested by the STA within a RAW period is a variable parameter that characterizes the energy harvesting system, e.g., the solar cell area.
As the frame delay budget is D max , the period of RAW slots shall not be greater than D max . At the same time, the period of RAWs less than D max is also inefficient. To clarify this statement, let us consider a group of STAs that is granted a series of RAW slots. Let us fix the channel resource consumption defined as the time that the group is allowed to transmit and consider two cases. In the first case, RAW slots follow with period T, and their length is T raw . In the second case, RAW slots follow with period αT and their length is αT raw , where α < 1. In the latter, STAs have less time for transmission, but the more important problem is that the contention windows the STAs had at the end of the RAWs are not kept. Therefore, they spend more time with small contention windows and hence high collision probability, wasting energy. For that reason, we consider only the scenario when the RAW period is D max .
For the described scenario, we state the problem to find out how to divide STAs into groups, and to determine the RAW slot duration for each group in such a way that the channel resource consumption by the STAs is minimized, but the restriction on minimal packet delivery ratio p req is met. To solve this problem, we develop a model of the described above process.

Related Papers
In the literature, many papers study various aspects of energy-efficient data transmission in wireless sensor networks. A group of studies consider abstract wireless sensor networks and derive general models of their operation using the Markov models [36], Energy Packet [37,38] abstraction, or the Brownian motion [39]. Another group of studies consider wireless sensor networks using different technologies, including the cellular networks [40,41] such as NB-IoT [42], low power wide area networks such as LoRaWAN [43,44], and wireless personal area networks such as ZigBee [45]. Finally, some papers evaluate the benefits of low-power wake-up radios added to existing technologies to reduce power consumption, e.g., see [46,47] for Wi-Fi and 5G networks. However, since this paper is focused on the peculiarities of channel access in Wi-Fi HaLow, we further review the literature specifically on this technology.
Although there are many studies of RAW and other mechanisms introduced in the IEEE 802.11ah amendment, which evaluate the efficiency of these mechanisms via simulation [16,17], we focus on the works containing analytical approaches to estimate the network performance.
Most papers that analyze the efficiency of Wi-Fi networks (e.g., [48]) consider networks operating in saturated conditions, i.e., when all STAs always have data to send, and all STAs are allowed to transmit. Many papers [18][19][20] that analyze Wi-Fi HaLow with RAW consider the same scenario, and the presented analysis is mostly based on the assumption that the network operates in stationary conditions so that the probabilities of device transmission and collision are constant. However, the usage of such an approach for analysis of Wi-Fi HaLow networks with RAW is poorly justified in the case of many Internet of Things applications due to two reasons. The first reason is that the typical IoT traffic is not saturated, i.e., STAs rarely transmit small pieces of information. The second reason is that the STAs reset their backoff functions at the beginning of the RAW slot: the STAs use the smallest contention windows at the RAW slot start and increase their contention windows with every unsuccessful transmission attempt. As a result, the probability of an STA transmitting in a given instant of time changes with time during the RAW slot, and the analysis based on stationary transmission probability is a priori inaccurate. This fact is confirmed in [29], where the authors develop a model of data transmission in RAW and compare its results with an approach that does not take into account the fact that the STAs start transmission in a RAW slot with new backoff functions, and show that such an approach can lead to a very high relative error, up to 400%.
The transmission of non-saturated data streams in Wi-Fi HaLow is considered in [21][22][23][24][25][26]. In [21], the authors propose a channel access scheme that is built upon RAW and analyze it for a case of non-saturated traffic. In [22], the authors propose a retransmission scheme that uses empty RAW slots to resolve collisions and, thus, to decrease energy consumption. However, in both [21,22], the resulting channel access is not the standard EDCA used in Wi-Fi HaLow, but ALOHA-like access. In [23], the authors describe data transmission in a RAW slot in the case when an STA can have one packet for transmission and derive the energy consumption by the STAs. In [24], the authors consider non-saturated load and non-ideal channel conditions and derive formulae for the network throughput and backoff duration. The authors also suggest leaving a portion of channel time open for access so that the STAs that cannot transmit their data during their RAW slots could finish their transmissions. This research is further extended in [25] to a case with several EDCA access categories. In [26], the authors develop a model of data transmission with RAW, find the average energy consumption of device groups, and present a traffic grouping approach that can be used to minimize the energy consumption. Although [21][22][23][24][25][26] study a scenario with non-saturated traffic, more relevant to the IoT, all these papers neglect the fact that the data transmission process within a RAW slot is not stationary, and the probabilities of collision and success change with time.
The first accurate analysis of the non-stationary data transmission process in RAW slots is given in [27]. The authors consider a network of IEEE 802.11ah devices in a scenario, when a group of STAs, each having one data frame to transmit, simultaneously start accessing the channel. The authors develop an analytical model, which allows finding the probability that (a) an arbitrarily chosen STA of the group, or (b) all the STA of the group succeed to transmit data by the end of the RAW slot. In contrast to our paper, the model in [27] does not consider the energy consumption of STAs and does not describe the scenario when STAs can drop out of the transmission process due to the depletion of energy.
The model from [27] is extended in [28,49] for scenarios with a random amount of traffic at each STA and anycast transmissions correspondingly.

Mathematical Model
In this section, we consider the scenario described in Section 2.2. Specifically, we consider a Wi-Fi network where an AP collects data from a group of energy-harvesting sensor STAs, and uses the Periodic RAW in order to organize the STA transmissions. The AP divides the STAs into groups and allocates a series of RAW slots to every group. The AP faces the problem of efficient resource allocation to the STAs: given the number of STAs, the STA traffic intensity, the channel properties and the required probability of data delivery, the AP should find such a way to divide the STAs into groups and to set the RAW slot durations for each group that the probability of data delivery is not less than the required value, but at the same time the amount of occupied channel resources, i.e., the total duration of RAW slots, is minimal.
To solve this problem, we consider an opposite task: given the number of STAs that transmit their data in a single RAW slot and the RAW slot duration, we develop a mathematical model of data transmission that can be used to find the probability of data delivery by an STA. This model can be used in order to find the RAW slot duration that, for a given number of STAs, can guarantee the required probability of data delivery. We use this result in a more general model that describes the data transmission with Periodic RAW on a large scale: given the number of STAs and the number of groups, it can be used to calculate the amount of channel resources consumed by the STAs. We further use the general model to find the best way to divide the STAs into groups and thus solve the problem.
In Section 4.1, we study how the amount of occupied channel time depends on the number of groups. In Section 4.2, we develop a model of the data transmission process in a single RAW slot that allows us to find the minimal duration of the RAW slot that guarantees the given probability of successful frame delivery. The most important symbols used in the model are summarized in Table 1. Probability of an STA having data to transmit in its RAW slot T raw RAW slot duration S raw (n, T raw ) Probability of the STA making a successful transmission in a RAW slot to which n STAs are assigned S total Probability of the STA making a successful transmission during a RAW period σ Empty slot duration τ Non-empty slot duration D dat Data frame duration D ack Ack frame duration t Model time measured in virtual slots from the beginning of the considered RAW slot η t = (n, f , r) State of the Markov process in virtual slot t that describes the transmission within a RAW slot, here n is the number of still active STAs, f is the number of elapsed non-empty slots, and r is the retry counter of the considered STA RL Retry limit T real (t, f ) Real (not virtual) time which corresponds to t virtual slots out of which f are non-empty Q Amount of energy which the STA has at the beginning of the RAW slot k Number of STAs that run out of energy during a virtual slot Π out Probability that the process transits to the absorbing state Π e,k Probability of an empty slot Probability of a slot with successful transmission made by the considered STA (+) and by an other STA (-) Probability of a slot with unsuccessful transmission made by the considered STA (+) and by an other STA (-) Probability of a collision slot involving (+) and not involving (-) the considered STA π k (η t ) Probability of k other STAs transmitting in slot t, π e (η t ) Probability of none of the STAs transmitting in slot t, π + s (η t ) Probability of only the chosen STA transmitting in slot t, π − s (η t ) Probability of one other STA transmitting in slot t, π + c (η t ) Probability of the chosen STA and at least one other STA transmitting in slot t π − c (η t ) Probability of the chosen STA not transmitting in slot t, but a collision to happen V Consumed voltage I LS , I RX , I TX Current consumed by the STA for channel listening, receiving and transmitting q e Energy consumed by the STA during an empty slot q r f Energy consumed by the STA during a non-empty slot, in which it does not transmit q rs Energy consumed by the STA during a successful slot, in which it does not transmit q t f Energy consumed by the STA during a non-empty slot, in which it transmits q ts Energy consumed by the STA during a successful slot, in which it transmits

Periodic RAW
Let the number of sensors connected to the AP equal N 0 . The AP tries to divide these STAs into G groups of the same size. As N 0 may be not divisible by G, we assume that the first G 1 = N 0 mod G groups contain N 1 = N 0 G STAs, and the rest G 2 = G − G 1 groups contain N 2 = N 0 G STAs. Then, the AP periodically allocates a series of RAW slots, as shown in Figure 1. The RAW slots do not intersect and can be considered separately. Once in T time units, each group obtains a RAW slot.
Let p in be the probability of a new frame arrival to the STA's transmission queue by the beginning of its RAW slot. As we consider T = D max , each STA has no more than one frame in the queue during each RAW slot.
Let us consider a group and randomly choose an STA that has a frame to transmit and further call it the chosen STA. For convenience, the remaining STAs from its group are referred to as other STAs.
Let the number of STAs in the group equal N g , and the RAW slot duration equals T raw . The probability that the chosen STA makes a successful transmission in a RAW slot equals where S raw (n + 1, T raw ) is the probability that the chosen STA succeeds to transmit its frame in a RAW slot with duration T raw provided that n + 1 STAs are trying to send a frame. We multiply this probability by the probability of n other STAs to generate a frame by the beginning of the RAW slot and sum over all possible values of n. We develop a model to calculate the S raw (n + 1, T raw ) in Section 4.2.
To guarantee that the frame is delivered during the RAW slot, the RAW slot duration should be chosen in such a way that the probability of successful transmission equals or is greater than the threshold p req . At the same time, it should be as small as possible and equals We have two possible group sizes, N 1 and N 2 , which yield different optimal RAW slot durations. Our goal is to find the optimal number of groups that yields the minimal amount of occupied channel resources, which is calculated as To find the G opt , we can use the exhaustive search over G ∈ [1, N 0 ], but we need to know the distribution S raw (n + 1, T raw ) that is obtained as described in the next subsection.

RAW Slot
Let us consider a RAW Slot, during which N STAs try to send their frames according to EDCA channel access. Since there are no hidden STAs in the network, the STAs decrement their backoff counters synchronously. Following [48,50], we refer to a time interval between two consequent changes of the backoff counter as a virtual slot.
A virtual slot can be: • empty if none of the STAs transmits a frame; • successful if only one STA accesses the channel, and the frame transmission is not affected by the noise; • unsuccessful if only one STA accesses the channel, but the frame is damaged by the noise; • collision if more than one STAs access the channel.
In the model, we consider that the empty slot duration is σ, while the duration of other slots is τ. The non-empty virtual slot duration is calculated as τ = SIFS + D dat + D ack + AIFS, where D dat is the data frame duration and D ack is the acknowledgement duration.
Let us enumerate all virtual slots in the RAW slot starting from zero and observe the data transmission process at the beginning of each virtual slot. We describe the state of the system in the virtual slot t as η t = (n, f , r), where n is the number of active STAs, i.e., those STAs that have both data and energy to transmit, f is the number of passed non-empty virtual slots, and r is the value of the chosen STA's retry counter. Thus, we define a discrete-time Markov chain with the time unit equal to a virtual slot and the state η t = (n, f , r), The process can also transit to the absorbing state denoted as * when at least one of the event occurs: • the chosen STA transmits its frame successfully, or • it runs out of energy, or • its retry counter reaches RL, or • the RAW slot is terminated.
Note that n includes only the STAs having enough energy to transmit their frames and having undelivered frames in the queue with less than RL transmission attempts.
The initial state of the process is (N, 0, 0), where N is the number of active STAs in the group. Let T real (t, f ) be the real time interval from the beginning of the RAW to the beginning of the slot number t, provided that f previous slots were not empty: Let the traffic form a Poisson flow. Then, the distribution of the time elapsed from the last transmission attempt is exponential. Thus, by the beginning of the RAW slot, the STA has a random amount Q of energy, distributed exponentially: where Q is the average value of energy. Such an energy distribution is similar to the one considered in [34,51]. Let the STA consume the ∆q amount of energy in a virtual slot. The remaining energy of an STA after this virtual slot, provided that it has had enough energy to survive until the end of this slot has an inverse CDF, equal to Pr(Q > q + ∆q|Q ≥ ∆q). According to the memory-less property of the exponential distribution, it equals the initial inverse CDF: i.e., the distribution of the STA's energy at the beginning of each virtual slot is the same, provided that it has had enough energy to stay alive. In the model, we neglect the amount of energy harvested by the STA during its RAW slot because the STA transmits only one frame, and we consider that the transmission time is negligible in comparison with the RAW period. Let us describe the possible transitions from the state η t . We use the parameter k to indicate the number of other STAs that turn off their radio by the end of the slot t (because of the lack of energy or because of the successful transmission). Symbol "+" indicates the transition, in which the chosen STA transmits a frame. Otherwise, symbol "−" is used. The transitions described below are shown in Figure 2. These transitions correspond to a case when the STA's retry counter has not reached the RL.

•
With probability Π out (η t ), the process transits to the absorbing state η t+1 = * . • With probability Π e,k (η t ), the slot is empty and k other STAs run out of energy. Thus, the process transits to η t+1 = (n − k, f , r).

•
With probability Π − s,k (η t ), the slot is successful, the chosen STA does not try to transmit, and k − 1 other STAs run out of energy; the process transits to η t+1 = (n − k, f + 1, r).

•
With probability Π − f ,k (η t ), the slot is unsuccessful, the chosen STA does not try to transmit, and k other STAs run out of energy. The process transits to η t+1 = (n − k, f + 1, r).

•
With probability Π − c,k (η t ), the slot is collision, the chosen STA does not try to transmit, and k other STAs run out of energy. The process transits to η t+1 = (n − k, f + 1, r).

•
With probability Π + f ,k (η t ), the chosen STA tries to transmit a frame, the slot is unsuccessful, and k other STAs run out of energy. The process transits to η t+1 = (n − k, f + 1, r + 1).

•
With probability Π + c,k (η t ), the slot is collision, the chosen STA tries to transmit a frame, and k other STAs run out of energy. The process transits to η t+1 = (n − k, f + 1, r + 1).
(n, f , r) * (n − k, f , r) If the STA's retry counter r reaches RL, then the process transitions corresponding to the cases when the chosen STA tries to transmit, but the slot is unsuccessful (with probability Π + f ,k (η t )) or collision (with probability Π + c,k (η t )) also leads to the absorbing state η t+1 = * , as shown in Figure 3. We need some auxiliary values to present the transition probabilities.

The Probability of Chosen STA Transmitting a Frame
We need to find the probability Pr(TX|t, r) of the chosen STA to transmit a frame, provided that the slot number equals t, and the STA has made r transmission attempts. Let us define the following probabilities: • Pr(t, r) is the probability of the considered process not to transit to the absorbing state and the chosen STA making r transmission attempts by the moment t.

•
Pr(A, t, r) is the probability of the considered process by the moment t not to transit to the absorbing state, the chosen STA making r transmission attempts and an event A ∈ {TX, C, S} occurring: -TX means that the STA makes a transmission attempt. -C means that the STA makes a transmission attempt that leads to collision. -S means that the STA makes a transmission attempt that does not lead to collision.
It is obvious that Pr(TX, t, r) = Pr(C, t, r) + Pr(S, t, r). By definition, we have: The numerator can be written as follows: Pr(C,i,r−1)+p Pr(S,i,r−1) CW r , 0 < r < RL.
The first three equalities are obvious. The last one corresponds to transmission retries. After a collision or a frame being damaged by the noise, the STA chooses one of CW r virtual slots, each with probability 1 CW r . The probability of transmission being disrupted by the noise equals p Pr(S, t, r). Then, the probability of collision or of the frame being damaged by noise equals Pr(C, t, r) + p Pr(S, t, r).
Let us find Pr(t, r). Note that the retry-counter equals r at the beginning of slot t if and only if it has turned r in one of the previous slots, and, since that moment, the chosen STA has not tried to transmit. In this case: Pr(TX, i, r), r > 0.
For an infinite number of STAs, the transmission probability equals the probability of collision: Pr(TX, t, r) = Pr(C, t, r). Let us define values a(t, r) and b(t, r), in which Pr(TX, t, r) and Pr(t, r) turn when the number of STAs is infinite. These values are determined by the following formulae: Instead of Pr(TX|t, r), we use its approximation u(t, r) = a(t,r) b(t,r) , corresponding to the case, when the transmission probability equals the collision probability. In [27], it is shown that the error induced by such approximation is negligibly small even for N = 10 STAs and decreases with the growth of N.

The Probability of Other STA Transmitting a Frame
Let us randomly choose an STA from those n − 1 other STAs that are still alive by the slot t. Let us find the probability Pr(TX|t,n,f ) of this STA making a transmission attempt in instant t with given n =n and f =f . By definition where Pr(η t ) is the probability of the considered process to be found in state η t at the moment t, and Pr(TX, η t ) is the probability of considered process to be found in state η t at the moment t and the randomly chosen STA making a transmission attempt. By the law of total probability, Pr(TX, η t ) = Pr(TX|η t ) Pr(η t ). (14) It is obvious that the probability of an STA transmitting in slot t depends only on the slot number and on the number of its transmission attempts, i.e., Pr TX|η t = (n,f ,r) = Pr(TX|t,r). Let us replace Pr(TX|t, r) with its approximate value u(t, r) and introduce a value Pr η t = (n,f ,r) , (15) which approximates Pr(TX|t,n,f ) and coincides with it in case of the infinite number of STAs. The limits of summation overr are explained by the fact that the number of retries does not exceed the number of non-empty slots and does not exceed the retry limit.

Additional Values
Let us introduce some more auxiliary values that determine the transmission probabilities in the state η t : • π k (η t ) is the probability of k other STAs transmitting in slot t, • π e (η t ) is the probability of none of the STAs transmitting in slot t, • π + s (η t ) is the probability of only the chosen STA transmitting in slot t, • π − s (η t ) is the probability of one other STA transmitting in slot t, • π + c (η t ) is the probability of the chosen STA and at least one other STA transmitting in slot t, • π − c (η t ) is the probability of the chosen STA not transmitting in slot t, but at least two other STAs transmitting in this slot.
For the purpose of brevity, we hereinafter omit the argument η t = (n, f , r) for probabilities of transmission π and transition Π.
where V is the voltage and I LS , I RX , I TX are the current values, consumed by the STA while listening to the channel, receiving and transmitting, respectively.
The way the probability of transition to the absorbing state is calculated depends on the current state: • If the STA cannot transmit the frame by the end of the RAW, i.e., T raw − T real (t, f ) < τ, the process transits to the absorbing state, i.e., Π out = 1. • Otherwise, two situations are possible: if r = RL − 1, the process transits to the absorbing state if the frame transmission is successful, or if the chosen STA runs out of energy: if r = RL − 1, the process transits to the absorbing state on any transmission attempt, or if the chosen STA runs out of energy: Note that all other transitions take place only if T raw − T real (t, f ) ≥ τ.

The Probability of the Slot Being Empty
To find Π e,k we take into account that none of the STAs access the channel and k other STAs run out of energy: 4.2.6. The Probability of the Slot Being Successful and the Chosen STA Not Trying to Transmit After a successful transmission, the transmitting STA turns of, therefore k − 1 more STAs, must run out of energy to make a total of k STAs that turn off by the end of the slot: 4.2.7. The Probability of the Slot Being Unsuccessful and the Chosen STA Not Trying to Transmit If the transmitting STA has enough energy to transmit in the following slot, k STAs must run out of energy. Otherwise, only k − 1 STAs must run out of energy:

The Probability of the Slot Being Collision and the Chosen STA Not Trying to Transmit
In the given formula, we sum over the number of STAs i that participate in the collision. For each i, we go over the number of STAs j that participate in the collision and run out of energy. If j STAs participating in the collision run out of energy, then k − j STAs not participating in the collision must run out of energy too, i.e., 4.2.9. The Probability of the Chosen STA Trying to Transmit and the Slot Being Unsuccessful This event takes place when the chosen STA alone gains access to the channel, its transmission is disrupted by the noise, and it has already made r = RL − 1 transmission attempts. In addition, k other STAs have to run out of energy. The probability of this event equals:

The Probability of the Chosen STA Trying to Transmit and the Slot Being Collision
This transition takes place if r = RL − 1. As in the case when the chosen STA does not transmit, we sum over the number i of STAs, taking part in the collision. The difference is that the lower limit of i is 1:

The Probability of the Chosen STA Transmitting Its Frame Successfully
The considered process in initially in state η 0 = (N, 0, 0), where N is the initial number of STAs: The possible transitions from state η t = (n, f , r) are shown in Figures 2 and 3. Let us know the distribution Pr(η t ) for the moment t. Then, we can use the transition probabilities Π to calculate the distribution Pr(η t+1 ) for the next time moment.
The probability of the chosen STA transmitting its frame successfully during the RAW is calculated as: It is sufficient to sum over those t, for which T raw − T real (t, f ) < τ because π + s ( * ) = 0. Thus, to find S raw , we consider the evolution of the transmission process starting with its initial state at time t = 0, and iteratively calculate the probability of the process to reach its possible states at time t until either the real time exceeds T raw − τ, or the total probability of the process to reach an absorbing state becomes close to 1. The calculations can be hastened by omitting the states with low (in comparison with the required accuracy) probability. We further use S raw in Equation (2) to obtain the probability of successful transmission by the chosen STA in the RAW slot and further to find the optimal number of groups.

Numerical Results
In this section, we present and analyze the numerical results obtained using the designed models. In Section 5.1, we consider a single RAW slot and examine the dependence of the probability of successful transmission on different parameters, such as the average STA energy, probability of transmission being disrupted by noise, and the number of STAs. In Section 5.2, we consider the Periodic RAW and show the dependency of the amount of allocated channel resource on the number of groups.

RAW Slot
We assume that the STAs operate in a 2 MHz channel and use the most reliable modulation coding scheme (MCS0). The STAs transmit 100-byte data frames. Table 2 lists the experiment parameters. Specifically, the values of channel access parameters are given in the IEEE 802.11ah [10] amendment. Voltage V and the values of current I LS , I RX , I TX , consumed by the STA while listening to the channel, receiving, and transmitting, respectively, are given in the IEEE simulation scenario recommendations [52].  Figure 4 shows the dependency of the probability of successful frame transmission during the RAW slot on the RAW slot duration for various values of N, Q , p. The shown dependencies are monotonic, and the probability of success asymptotically approaches some value. This value is less than one because the STA's energy is limited. In addition, this value decreases with an increase of N and p and with a decrease of Q . This result is expected because the greater initial number of STAs yields the greater probability of their frames to enter a collision, and retries, caused by the collisions or noise, result in higher energy consumption. As a result, the STA can deplete its energy before successful transmission.
Before the probability becomes constant, it grows "step-by-step" with the increase of the RAW slot duration. Such behavior is directly related to the fact that, with the increase of the RAW slot duration, the number of frames that can be transmitted within the RAW slot increases in a step-type manner. The width of a "step" is determined by the non-empty slot duration of τ and approximately equals D dat + SIFS + D Ack + AIFS. The height of a "step" is determined by the number of STAs N and the initial contention window CW 0 . To find it, let us consider the beginning of the RAW slot and assume that all the STAs have sufficient energy to make the first transmission attempt. The first step of the plot corresponds to a situation when the chosen STA makes a successful first transmission attempt, and other STAs do not transmit their frames before the chosen STA. For slot number k, the probability of such an event equals where the first multiplier is the probability of the chosen STA selecting the considered slot for transmission, and the expression in brackets is the probability that the other STAs select slots after the considered one. Summing over all k possible for the first transmission attempt, we obtain the step height: The steps become more and more smooth with the increase of the RAW slot duration.  Let us find the minimal T raw , which yields the required probability p req of successful transmission. This value may not exist if the average STA's energy is too low, or there are too many STAs, or the noise level is too high. For example, in case N = 10, Q = 20q ts , p = 0, the probability of successful transmission of 0.9 cannot be achieved with any duration of RAW slot. However, with Q = 500q ts and Q = 1000q ts , the required probability is reached with T raw ≈ 28 ms. Such a result shows the importance of the developed model: the models known from the literature, e.g., [27,49], do not consider the STA energy and would provide results similar to the results with a high Q . Thus, unlike the models known from the literature, the developed model shows us that, in some cases, we cannot achieve high probabilities of successful data transmission by increasing the RAW slot duration.
At the same time, the developed model gives us possible solutions for the considered case. The first one, if the considered devices gain energy from a renewable source (e.g., from a solar battery), is to delay the beginning of the RAW slot to let the STAs accumulate more energy, thus increasing Q . Another solution is to divide the STAs into two groups and thus to decrease the parameter N from 10 to 5. In such a case, the required probability of successful transmission becomes achievable with T raw ≈ 15 ms.
The grouping approach might be more efficient because the growth of the probability of successful transmission is not directly proportional to the number of STAs (see Figure 4).

Periodic RAW
Let us now investigate the case with periodic RAW. As a performance indicator of the network, we consider the cycle duration, which is the total duration of RAW slots (the numerator of the fraction in Equation (4)) within a single RAW period. The numerical results obtained for N 0 = 1000 battery-powered energy harvesting STAs and Q = 1000q ts are shown in Figure 5. We consider the p req values close to 100% within a small interval starting with 95%. The dependency of the cycle duration on the number of groups is non-monotonic, with extremum points corresponding to such numbers of groups by which the number of STAs is divisible. As one can see, a minimum minimorum exists that depends on the required probability of successful transmission p req .
The curves corresponding to different p req values converge when the number of groups equals the number of STAs. In this extreme case, every STA obtains a RAW slot, the length of which includes the time needed by the STA to count down its backoff and to transmit the frame. This length is the same for the considered p req values, and therefore the cycle durations are the same.
The important point is that small numbers of groups (and big numbers of STAs in a group) make the desired probability of success unachievable for any value of T raw because STAs deplete their energy. Another point worth mentioning is that the cycle duration significantly depends on p req . Even though the considered p req values are close to 100%, even a 1% difference can bring a significant difference in the cycle duration. Specifically, with the increase of p req , it can suddenly change from increasing to decreasing dependency. This peculiarity is caused by the "step-by-step" dependency of the probability of successful transmission on the RAW duration.
To explain this fact, let us consider a case with p in = 1 and N 0 = 1000 (see Figure 5d). If we divide STAs into 1000 groups, each group will contain exactly 1 STA. The duration of the RAW that each group obtains in the general case is determined by p req , but, for 1 STA, it equals 2.98 ms for all considered p req values (see Figure 6). If we divide STAs into 500 groups, each group will contain exactly 2 STAs. In this case, the duration of the RAW slot varies significantly for different p req values. For p req = 0.95, minimal RAW slot duration equals 5.18 ms, so if we exchange two 1-STA groups for one 2-STA group, we win 0.78 ms. However, for p req = 0.99, minimal RAW slot duration equals 8.36 ms, so, if we exchange two 1-STA groups for one 2-STA group, we lose 2.42 ms.

Conclusions
Wi-Fi HaLow aims at extending the usage of Wi-Fi to the Internet of Things scenarios, which include gathering data from large numbers of autonomous energy-limited devices. An efficient tool that can help to reach this goal is the novel mechanism, introduced in the IEEE 802.11ah standard amendment: the Restricted Access Window (RAW). The Wi-Fi Access Point can use RAW to divide the connected STAs into groups and assign them a series of time intervals-RAW slots-during which only the STAs from a given group can transmit their data, thus decreasing the contention for channel access.
In the paper, we have studied an extreme scenario in which the STAs are energy-harvesting sensors that harvest energy with time and consume it during the data transmission, and it is possible that during the process of channel access and data transmission, the devices run out of energy. For such a scenario, we have developed an analytical model of data transmission that can be used to find the probability of successful data transmission by an STA as a function of the number of STAs, average STA energy, RAW slot duration, and the probability of a transmission to be damaged by random noise. Such a model can be used to determine the minimal RAW duration that, for a given number of STAs, can guarantee the given probability of data delivery. Unlike the existing models that do not take into account the energy consumption of devices, the developed model shows that, in some cases, the required probability of data delivery cannot be achieved by increasing the RAW slot duration.
We have used this model to solve the STA grouping problem: how to divide the STAs into groups in such a way that all the STAs can transmit their data with required probability, and the portion of consumed channel resources is minimal. While solving the STA grouping problem, we have obtained and explained some paradoxical results, e.g., increasing the number of groups and correspondingly decreasing the number of STAs per group does not necessarily provide lower channel resource consumption. At the same time, the model can be used to find the optimal number of groups and the corresponding duration of RAW slots for each group which can decrease the cycle duration by almost 50% in comparison with the usage of a single group for all devices or with the usage of a group for each device.
Let us summarize the contributions of the paper: • We have developed a model of data transmission in the RAW slot when STAs transmit single packets, the STAs have limited amounts of energy, and their transmissions can be disrupted by random noise. The model allows us to calculate the probability that the data are delivered with a given RAW configuration.

•
We have shown that it is important to consider the amount of STAs' energy in order to properly configure the RAW parameters, while the usage of models that do not consider the STA energy consumption may violate the requirements on the reliability of communications.

•
We have shown how to use the developed model to optimize the RAW slot duration in order to provide the required probability of data delivery and to minimize the amount of consumed channel resources.

•
We have shown that the channel resource consumption can change drastically depending on the reliability requirements: changing the required probability by 1% can increase the consumption by almost 100%, so the RAW parameters optimization shall take into account the requirements of particular applications.
As a direction of future work, we consider the modeling of data transmission for more complex models of traffic and energy harvesting. We also plan to consider the usage of RAW in heterogeneous networks.

Conflicts of Interest:
The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.