Diffusion Analysis Improves Scalability of IoT Networks to Mitigate the Massive Access Problem

—A signiﬁcant challenge of IoT networks is to offer Quality of Service (QoS) and meet deadline requirements when packets from a massive number of IoT devices are forwarded to an IoT gateway. Many IoT devices tend to report their data to their wired or wireless network gateways at closely correlated instants of time, leading to congestion known as the Massive Access Problem (MAP), which increases the probability that the IoT data will not meet its required deadlines. Since IoT data loses much of its value if it arrives to destination beyond a required deadline, MAP has been extensively studied in the literature. Thus we ﬁrst take a queueing theoretic view of the problem, and also use a Diffusion Approximation to gain insight into the IoT trafﬁc statistics that affect MAP. Then we introduce the Quasi-Deterministic Transmission Policy (QDTP) which signiﬁcantly alleviates MAP when the average trafﬁc rate grows beyond a given level and substantially reduces the probability that IoT data deadlines are missed. The results are validated using real IoT data which has been placed in IP packets for transmission.


I. INTRODUCTION
Sensors for health applications, monitoring of areas which are of difficult access such as remote areas or large civil engineering structures, and geophysical characteristics [1]- [4] are among the numerous motivations for the development of sensor networks, giving rise to the Internet of Things (IoT) where the number of connected devices is rapidly increasing with the needs of autonomous systems, smart cities and smart vehicles [5], [6]. This increase in connectivity results in high traffic rates, causing congestion at the Physical Random Access Channels (PRACH) that service these systems [7], [8] which is known as the Massive Access Problem (MAP). When IoT data is used to control a complex distributed system, the needs for synchronization of the data to present a coherent view of the system can lead to further constraints regarding packet delays [9]. This research has been supported by the European Commission H2020 Program through the IoTAC Research and Innovation Action, under Grant Agreement No. 952684. MAP was addressed in early research [10]- [12] through adaptive routing to reduce congestion in networks with multiple paths and gateways, and via information theoretic techniques to reduce the amount of traffic that is sent [13]. More recent work [7], [8], [14]- [29] commonly assumes that IoT traffic arrives at random, leading to solutions to MAP that include Access Class Barring (ACB) [8], [14], [16], [23]- [26], Cognitive Machine-to-Machine (M2M) communication [17], [19], game theory [18], clustering of devices [20], [27], data rate adaptation [21], Spread-spectrum, Non-Orthogonal Multiple Access (NOMA) [22], Interference Cancellation (SIC) [7], the use of CSMA/CA or slotted-ALOHA [15], [28] and collision awareness [29]. Other work [30]- [35] has suggested proactive network solutions for MAP, which can include techniques such as adaptive traffic ofloading to storage areas or less congested gateways [36].
On the other hand it was empirically shown that the IoT traffic at the MAC-layer is predictable via specific machinelearning techniques that can help to identify distinct IoT traffic classes in [37]. Thus in [38], the predictability of IoT traffic is used to address the MAP in a "predictive network" framework with a Joint Forecasting-Scheduling (JFS) system that allocates the time slots of a single frequency channel for IoT devices based on a forecast of traffic generation. In [39] a Multi-Scale Algorithm is suggested to improve the performance of the JFS system while [40] has suggested the extension of JFS for multi-frequency channels. The results of this work has shown that predictive networks, in particular JFS, are promising for the solution to the MAP and that the lightweight scheduling heuristics are crucial since optimal schedules are difficult to achieve in practice due to their high computational requirements.
In recent work [41] we show that, for any given and fixed IoT packet traffic rate, the statistics of the actual instants at which IoT packets are sent has a significant impact on the number of packets which are received before the packets' deadlines expire. We showed that "smoothing" the traffic by setting the individual packet transmission times in a uniformly distributed manner will considerably improve the system's performance. We used queueing analysis to select the randomization instants, and to predict which packets would not meet their deadlines and should be eliminated before transmission to improve the chances that other packets meet their deadlines.
In the present paper, we seek the optimum instants of packet transmission which will maximize the probability that deadlines are met. Since exact analytical solutions for queueing systems with general arrival and service processes are not readily available, we first use Diffusion Approximations [42], [43] to compute the probability that an IoT packet will meet its deadline. Based on this analysis we show that the probability that the packet does not meet its deadline is an increasing function of the Squared Coefficient of Variation (SCV) of the interarrival times. Thus we observe that for any given fixed average arrival rate, and any service time distribution of the IoT data, the best possible schedule (in the sense of minimizing the IoT date that misses its deadline) is deterministic, with data being sent at fixed time intervals whose value is identical to the inverse of the arrival rate.
However such a deterministic schedule cannot be applied exactly: indeed, at low traffic rates deterministic schedules may unnecessarily delay some of the data, while not providing any significant improvement in the amount of data that misses its deadline. Thus in the sequel we develop a Quasi-Deterministic Transmission Policy (QDTP) which is used when traffic rates are moderate or high, and is turned off for low traffic rates.
DAs also provide us with mathematically based insight with regard to the randomization result obtained earlier in [41], since the uniformly distributed randomization reduces the SCV of the interarrival times for the publicly available empirical data set which is in the range 1.6 to 2.18, down to approximately 0.33. Furthermore the QDTP results in an SCV close to zero, hence it also minimizes the probability of missing deadlines.
The rest of this paper is organized as follows. Section II describes the problem we wish to solve, while Section III introduces the diffusion process based analysis and introduces our main result concerning the Quasi-Deterministic Transmission Policy which aims to reduce the probability that deadlines are not respected. Section IV details the QDTP and evaluates it on the experimental data that we use from [44]. Finally section V summarizes our main conclusions and suggests further research.

II. THE PROBABILITY OF MEETING DEADLINES
We model the channel that offers access to the IoT gateway as a single server queue with a service time that is related the length of each individual IoT packet that is being sent, with queuing theory techniques that are widely used [45]- [49].
Each IoT device that uses this gateway forwards packets structured from data in the form of "bursts" of multiple bits seen in the data set [44]. These bits would normally be packetized in some form, for instance basrd on the relatively recent LoRa-WAN standard which is used for IoT devices [50]. However we simplify matters and assume that the packetizations is based on IP packets with 21 − Byte headers, which is not too different from LoRa-WAN, followed by payload bytes that contain the IoT device bit Bursts. The data transmission times are then selected in a manner that is compatible with the measurements reported in [50] were and effective data transmission rate in free space of 5400 bits/sec was measured; beyond that rate, it was found that bit error rates became significant. Based on the measured average packet length of 22.47 Bytes, we see that the average packet transmission time would be 33.33 msec, which will be used in the sequel.
The IoT traffic data set [44] that we have used contains the traffic patterns of 10, 000 IoT devices, whose traffic generation patterns belong to one of the following classes: Fixed Bit Aperiodic, Fixed Bit Periodic, Variable Bit Aperiodic and Variable Bit Periodic. For a device j which sends a burst of Bits at time a j,n , the deadline beyond which the burst is of "no value" is denoted by ∆ j,n > 0; thus the bits must arrive at the gateway and be served and transferred out of the gateway by time a j,n +∆ j,n . The evaluations we will conduct are based on different fixed values of the deadline.
In turn, the gateway will then process the successive packets to extract the required information, or to pass on the packet to some other system such as a Cloud server.
Let a 1 ≥ 0, a 2 ≥ a 1 , .. a n+1 ≥ a n , ... be the successive transmission times to the gateway of data packets by the various IoT devices that are connected, which is the First-In-First-Out ordered set of all data transmission instants from all IoT devices {a j,n }.
On the other hand S 1 , S 2 , .. S n , ... are the successive durations of occupancy of the channel to the gateway by these successive packets which we call the "service times", so that in the numerical examples considered later in the paper we will take E[S n ] = 0.33 msec. Each packet will also have a deadline that is denoted ∆ n ≥ 0 for the n − th packet and which we discuss below.
The waiting W n experienced by the n − th packet is the delay that separates its arrival instant from its departure instant, and it is given by the well known Lindley's recursive equation [45], [48]: where we take a 0 = 0 and [X] + = 0 when X < 0, and The response time R n experienced by the n − th packet is then defined as: i.e. the waiting time plus its service time. Note that A(t) the number of arrivals by time t and the arrival rate of packets (when the arrival rate does not vary with time and the corresponding limit exists) are defined as: When the arrival instants {a n } n≥0 constitute a random process, and the {S n } n≥0 are random variables, we define the probability Π n that the n − th packet misses its deadline, i.e.: which is the probability that by the time a packet exits the gateway, its deadline has expired. Note that the "clock instant" when the n − th packet's deadline expires is a n + ∆ n . In the sequel we will assume that the transmission channel characteristics are fixed, and that all packet transmission times are proportional to their sizes and are drawn from the same distribution, so that the service times are samples of the same random variable S with mean value E[S] = 0.33 ms. On the other hand, we will assume that the arrival rate of IoT packets λ depends on the number of active IoT devices in the system, which we denote by M .
The problem we now address is how to take appropriate scheduling decisions for each value of the workload λ, and in particular we will consider how to optimize the instants at which the packets are actually transmitted, which we call t n , so as to minimize Π. Note that t n ≥ a n , while a n is the instant at which the IoT device data is available for transmission.
Thus in effect, the simple scheduling algorithm we describe, which we call Quasi-Deterministic Traffic Policy (QDTP), will transform each a n into a new value t n , and W n will be transformed into W * n where: so that the new response time becomes: since we need to include the delay introduced by the QDTP algorithm itself into the response time of the n−th packet that is being sent. Note that the new probability that the deadline is not met, also becomes:

A. Interarrival and Service Time Statistics
In the sequel we will assume that the channel characteristics between the IoT devices and the gateway are fixed, and that all packets are drawn from the same population having given packet length characteristics. Thus we assume that all S n are independent random variables with the same probability distribution (i.e. they are i.i.d. or independent and identically distributed), with given mean E[S] and SCV: We also assume that we will operate under variable load λ (the arrival rate) but under stable conditions, i.e. λE[S] < 1. For a given λ = (E[a n+1 −a n ]) −1 , we will assume that we restrict ourselves to the i.i.d. case but we have the freedom of choosing the probability distribution function that best fits our needs to minimize Π, and we define: In fact, our analysis will show that by setting C 2 A as small as possible, we can minimize Π.
1) An Example of IoT Data Statistics: To illustrate some of the statistics obtained from real IoT date available from the Open Source Repository [44], in Figure 1 we show the distribution of the amount of data in Bits from data Bursts emanating from the IoT devices in the data set. We observe that the average number of Bits per Burst is 6.8167 and the SCV of the number of Bits per Burst is 1.9506. There are only 2000 Bursts with more than 50 Bits per Burst. For those Bursts with less than 50 Bits, the average number of Bits per Burst is 6.778 and the SCV of the number of Bits per Burst is 1.7633. In Figure 2, we have used the same data set, but assumed that each burst from an IoT device is sent in the form of an IP packet with a 21 − Byte header, and that the Bits belonging to the burst are stored in 8 − Bit Bytes inside each packet, so that we exhibit the histogram of the length of the packets in Bytes.
In this data set, only 2000 packets are longer than 30 − Bytes. We note that the overall average packet length is 22.4744 − Bytes with an SCV of 0.0031. If we only consider just those packets whose length is less than 30 − Bytes the statistics are hardly different, since the average packet length is 22.4695 − Bytes with an SCV of 0.0028 and the amount of payload data transmitted per burst is on average around 12 − Bits.
In the numerical examples of the next Sections III and IV, we normalize the average arrival rate λ based on the LoRa-WAN bit-rate mentioned at the beginning of Section II, so that the average packet length of 22.4744 Bytes is transmitted in 33.33 msec, and the maximum traffic rate λ = 1 corresponds to 30 packets/sec

III. USING THE DIFFUSION APPROXIMATION
While the probability density of the response time in steadystate: is known in the case when at least one of the interarrival or service times are exponential (G/M/1, M/G/1 systems) [48], there is no easy way to obtain it exactly for both arbitrary interarrival and service time distributions. Therefore, we will use a diffusion approximation [51], [52] to determine the probability F R (∆) that the response time of the station is shorter than the deadline ∆, where we assume that the deadline is identical for all the IoT packets: In the diffusion approximation, the number of customers N (t) in a single server queue is modeled by the diffusion process X(t) on the interval [0, +∞) with probability density function f (x, t; x 0 ) which approximates the queue length probability p(n, t; x 0 ) for the initial condition x 0 at t = 0. In steady state, when f (x) = lim t→∞ f (x, t; x 0 ) the diffusion model yields [51]: where: Note that p 0 is obtained by the relation p 0 + ∞ 0 f (x)dx = 1, and its value is also known from queueing theory. On the basis of (12) we can also calculate the mean number of customers in the system: Finally, using Little's law, the mean response time in steadystate can also be obtained: We note that E[R] is monotone increasing in C 2 A and C 2 B but we need the probability distribution function of R to determine the probability of respecting the deadline. Therefore, we compute the response time with the use of the diffusion process [43]. It is can be obtained as a first passage time, since the time X(t) needs to travel from the point x = x 0 , corresponding to the queue length at the moment when a new packet joins it, to the first following instant when x = 0 when the packet has left the queue.
The probability density function γ x0,0 (t) of the distribution of first passage time from x = x 0 to x = 0, i.e. probability density that the process hits x = 0 the barrier at time t after starting at x = x 0 for time t = 0, is given by [46]: .
For an arrival that finds the diffusion at level x 0 on arrival, this is simply the probabiity density function of the response time, because when this customer's service is complete it will leave the queue in the empty state, and the diffusion at level x = 0. Considering that the customer arrives when the system is at steady-state, the density of x 0 is simply f (x 0 ), i.e. the stationary distribution of the diffusion process given in the expression (12).
We therefore obtain the probability density function of the response time as: and the probability that the deadline is missed is simply: In order to illustrate these results, we provide two figures that show how Π varies with C 2 A , λ and ∆. Both Figures 3 and  4 also show, for comparison purposes, the actual values of the SCV of inter-arrival times C 2 A of the real data set [44] with vertical bars, marked as ranging from approximately 1.6 to 2.18. The vertical bar for 0.33 which is close to the the value for the randomization policy of arrival instants developed in a recent paper [41], which reduces the value of C 2 A by selecting the instants at which data is sent from individual devices using a uniform distribution over a deterministic interval of length ∆ − E[R], when E[R] ≤ ∆.
In Figure 3, we show the probability of missing the deadline (y-axis) in logarithmic scale (to the base ten) for a given value of ∆, different values of λ, and with C 2 A varying over a wide range. Here the average service rate and the SCV of service time are both fixed to 1. We see that as C 2 A and λ increase, Π increases significantly.
Similar results are shown in Figure 4 for different values of ∆ and a fixed value of λ, and C 2 A varying over a wide range, showing that as ∆ decreases and C 2 A increases, Π increases significantly.
In Figure 5, we detail the probability of missing the deadline for the real data set of [44], plotted against the number of IoT devices M being used. For each value of M , we also give the arrival rate λ normalized against the measured average bit rate from the M sources and the corresponding real values of the SCV of interarrival times C 2 A . We see that the value of M or of the corresponding λ has the principal effect in determining the measured fraction Π of the data transfers which do not meet the deadline. Fig. 3. The probability of missing the deadline (y-axis) in logarithmic scale (to the base ten), estimated using the diffusion approximation, increases significantly as C 2 A and λ increase, for a fixed value of ∆. The average service rate µ and the SCV of service time C 2 B are both fixed to 1.

IV. QUASI-DETERMINISTIC TRANSMISSION POLICY (QDTP)
For 0 ≤ a 1 ≤ a 2 ≤ ... a n ≤ a n+1 ≤ ... , the list of successive Burst dates of all the IoT devices, and λ the overall average arrival rate of the bursts, let t n ≥ a n , n = 1, 2, ... be the instants at which the Bursts are actually sent from the IoT devices, and define the deterministic quantity D = 1 λ , which is identical to the average inter-arrival time. The "Quasi-Deterministic Transmission Policy" (QDTP) which is meant to reduce the value of C 2 A and hence reduce Π the probability of missing deadlines, is defined as follows: 1) Set n = 1, 2) Send Packet 1 at t 1 = a 1 , 3) Set n ← n + 1, Fig. 4. The probability of missing the deadline (y-axis) in logarithmic scale (to the base ten), estimated with the diffusion approximation, increases significantly as C 2 A increases and the the deadline ∆ measured in slots decreases, for a fixed but high value of the arrival rate λ = 0.8. The average service rate µ and the SCV of service time C 2 B are both fixed to 1.  5. The probability of missing the deadline (y-axis) in logarithmic scale (to the base ten) estimated with the diffusion approximation, using the traffic statistics of the real data set of [44], is plotted against the number of IoT devices M (x-axis) that are being used. Note that each value of M corresponds to specific measured values of λ and C 2 A shown along the x − axis. The corresponding arrival rate λ normalized against the measured average bit rate from sources is also shown. The real values of the SCV of interarrival times C 2 A are also indicated. 4) If a n ≤ t n−1 + D, Send Packet n at t n = a n−1 + D, 5) Else if a n > t n−1 + D, Send Packet n at a n . 6) Go to (3).
To implement QDTP in practice, we would need to know λ in advance, which is possible when we have a fixed set of IoT devices, each of which sends data at pre-determined instants. Also, we either need the receiver to know the Packet generation times in advance, and to request all the senders to send their Packets at the instants defined by the QDTP, or the senders can know in advance their sequence number n, "listen" to the successive sending instants and apply the QDTP to determine when they need to send their own data.
Thus the communication channel would need to be two-way or the individual IoT devices should also have the ability to sense the channel.
To evaluate the effectiveness of QDTP, we first conducted measurements of the SCV of interarrival times for the data set [44], both for the raw IoT data from [44], and for the same data using QDTP, for a varying number of active IoT devices M as shown in Figure 6. We see that QDTP substantially reduces the SCV C 2 A for all values of M . Then in Figure 7, we show the relative frequency (empirical probability) of missing the deadline -for a very small value of the deadline ∆ = 2 -for both the raw data set of [44] and for the case where the QDTP is used with the same data set. QDTP obviously succeeds in considerably reducing the probability that the deadline is missed. Finally, in Figure 8 the data set in [44] with varying numbers M of active IoT devices, and different values of ∆, is used. We see that for all values of ∆ above 2, QDTP reduces the empirically measured Π to practically zero. However when the heuristic is not used, Π tends to one as M increases beyond a few hundred devices. Fig. 6. Measurements of the SCV of interarrival times, both for the raw IoT data from [44], and for the same data using QDTP, for a varying number of active IoT devices M . We observe that QDTP has substantially reduced the empirically measured SCV C 2 A , reducing it to zero for all the distinct numbers of devices M in the data set of [44].

V. CONCLUSIONS
The MAP is one of the biggest challenges for the future of IoT networks and occurs when large numbers of devices access a single channel to reach their gateway, causing congestion at the entry points and leading to deadlines being missed for the data sent from IoT devices. In order to address this problem, predictive network designs have been used, where scheduling modifies priorities between devices and select the instants at which IoT packets are transmitted.
In this paper, we use insight from queueing theory and Diffusion Approximations to design the QDTP scheduling heuristic that improves the scalability of IoT networks. Using a real data set of outputs from a large number of IoT devices, we have examined the relevant statistics and used them to study Fig. 7. This figure shows the consequence of the results detailed in Figure  6 for the empirically measured probability of missing the deadline (y-axis). log 10 Π is shown for both the raw data set of [44] and for the case where the QDTP is used with the same data set, with a very small value of the deadline ∆ = 2. We see that QDTP succeeds in considerably reducing the probability that the deadline is missed for all values of M .  Figure 7 using the data set [44] and varying numbers M of active IoT devices. We compare the logarithm to the base 10 of the (empirically measured) probability Π that the deadline is missed for different values of the deadline ∆. We see that for all values of ∆ that are shown above 2, the QDTP reduces Π to practically zero, while when the heuristic is not used then Π tends to one as M increases beyond a few hundred devices. the effect of the interarrival time statistics on the probability that the IoT packets meet (or do not meet) their deadlines.
The performance of QDTP has then been evaluated extensively using the data set in [44] for a widely varying range of numbers M of IoT devices, resulting in widely varying average arrival rates and many different deadline values. In particular, we have compared the performance of QDTP against the case where the original packet transmission dates (found in the experimental data set) are used.
These evaluations which use real data have demonstrated that QDTP can provide a very large reduction in the empirically measured fraction of packets that miss their deadlines.
Future work will combine QDTP with priority policies to attempt to obtain further improvements in IoT network performance, resulting in further alleviation of the MAP problem. Furthermore, since queueing systems with deterministic arrivals have been studied by different authors [53]- [55] we expect that the insight provided by our work may lead to further useful interactions between classical queueing theory and the study and optimization of the Internet of Things.