A novel superframe structure and optimal time slot allocation algorithm for IEEE 802.15.4–based Internet of things

IEEE 802.15.4 standard is specifically designed for a low-rate and low-processing Internet of things (IoT) applications and offers guaranteed time slots. A beacon-enabled IEEE 802.15.4 consists of a superframe structure that comprises of the contention access period and contention-free period. During contention-free period, nodes transfer their data using guaranteed time slots without any collision. The coordinator node receives data transmission requests in one cycle and allocates guaranteed time slots to the nodes in the next cycle. This allocation process may cause large delay that may not be acceptable for few applications. In this work, a novel superframe structure is proposed that significantly reduces guaranteed time slots allocation delay for the nodes with data requests. The proposed superframe structure comprises of two contention access periods and one contention-free period, where contention-free period precedes both contention access periods with reduced slot size. In addition, the knapsack algorithm is modified for better guaranteed time slots allocation by allowing more guaranteed time slots requesting nodes to send their data as compared to the IEEE 802.15.4 standard. The simulation and analytical results show that the proposed superframe structure reduces the network delay by up to 80%, increases contention-free period utilization up to 50%, and allocates guaranteed time slots up to 16 nodes in a single superframe duration.


Introduction
Internet of things (IoT) is an emerging paradigm and revolutionizing the control and management of automated systems. Its capability of usage in diverse areas makes it an interesting technology in the current smart world. A survey says that by 2020, the growth in IoT connected devices will be over 20 billion. [1][2][3] IoT is used in diverse areas of transportation, environmental monitoring, agriculture precision, health care, smart cities, smart homes, and military applications. 4 Most of these applications require guaranteed data delivery with a time-bound latency. 5 Wireless sensor networks (WSNs) is the foundation of IoT applications. WSNs is a group of dedicated specialized sensors with a communications infrastructure. Most of these applications require the remote deployment of wireless nodes where frequent human visits are impossible. WSNs comprise tiny wireless nodes with a limited battery source. Sensor nodes must be energyefficient because most sensor nodes operate autonomously on battery. The maximum amount of energy is consumed in transmitting or receiving data. However, a significant amount of energy is wasted when a node remains in idle listening mode by keeping its radios ON , even when it has no data to transmit or receive. In addition to energy constraints, sensor nodes have low data rates, low processing, and limited computational capabilities. To overcome these constraints, several medium access control (MAC) protocols are proposed. IEEE 802.15.4 is designed for low data rate, low power wireless devices, 6 and offers a duty cycle even less than 0:1%. That is why the standard is preferred for WSN applications.
IEEE 802.15.4 operates in beacon as well as in nonbeacon-enabled modes. During non-beacon-enabled mode, nodes communicate in an ad hoc setup by following an un-slotted carrier-sense multiple access with collision avoidance (CSMA/CA) algorithm. However, a superframe structure is introduced in a beaconenabled mode. An interval from the commencement of the first beacon to the initiation of the next beacon is known as beacon interval (BI). BI comprises an active period and an inactive period. During the active period, in addition to the beacon frame, it also comprises of contention access period (CAP) and contention-free period (CFP). Sensor nodes in a wireless personal area network (WPAN) communicate during the active period and remain in sleep mode during the inactive period. A complete superframe structure of beaconenabled mode is shown in Figure 1.
Superframe duration (SD) is an active period, that comprises of 16 equal duration time slots. Out of 16, CAP consists of a minimum of 9 slots and a maximum of 16 slots, whereas CFP comprises of maximum 7 slots. In case there is no CF request, then the whole active period comprises CAP. Nodes which require guaranteed time slots (GTS) are required to send their request for allocation of CFP slots in CAP by following slotted CSMA/CA. The coordinator assigns requested GTS to member nodes by informing them in the next beacon frame on a first-come first-serve (FCFS) basis. Although IEEE 802.15.4 standard is attracted by WSN-based multiple applications, however, they have the following limitations-which cannot be compromised in sensitive applications such as healthcare and military applications: 1. Significant delay is observed in CFP slots allocation process and each requesting node has to wait at least one BI before transmitting its data during CFP. 2. There are only seven CFP slots in each BI. It means PAN coordinator can allocate GTS to maximum seven nodes. 3. The standard assigns CFP slots to nodes on FCFS basis, which does not allow optimal CFP utilization.
In this work, these limitations of the standard in IoT prospects are addressed. The salient features of our proposed superframe structure are as follows: A novel superframe structure is introduced that comprises two CAPs and a CFP, where CFP precedes both CAPs and inactive periods. The proposed superframe structure reduces the delay and allows a GTS requesting node to transmit its data within a BI duration, which is not possible in the standard. PAN coordinator scrutinizes GTS requesting nodes by applying the knapsack optimization technique instead of FCFS. This improves the GTS utilization. Each CFP slot duration has been reduced to half during the same CFP duration. This doubles the number of CFP slots, and consequently, more nodes can be accommodated as compared to the existing standard. These improvements are obtained without major changes in the existing parameter structures of the standard.
The rest of the article is organized as: section ''Related work'' describes the previous research work. Section ''IEEE 802.15.4 overview'' gives a brief overview of the IEEE 802.15.4 standard by focusing the GTS allocation procedure in the standard. The proposed superframe structure is discussed in section ''Proposed model.'' The result comparison between the proposed work and the standard is discussed in section ''Performance analysis,'' and section ''Conclusion'' concludes the article.
For better understanding of the readers, list of symbols along with their descriptions that are used in this article are given in Table 1.

Related work
Internet of things (IoT) 7,8 is emerging rapidly since one decade. Multiple trends and protocols such as IEEE 802.15.4 compliant protocols, 9 future Internet, 10,11 and machine-to-machine (M2M) networks 12 are the fundamental part during the development of the IoT.
Multiple European projects are focusing their research on future Internet such as EU 4WARD, 13 but they are not emphasizing on LoWPANs. However, the EU SENSEI project 14 has focused on the functionality of LoWPAN in the current and future global Internet. 15 Security is also one of the core parameters in IoT systems and is being evaluated in different prospects. 16 M2M networks are cognitive and capable to interact with each other without human interference. 17 Connectivity between LoWPAN and Internet is possible via the M2M gateway that gives confidence to both industry and research community to get involved with the IoT revolution. 18 IEEE 802.15.4 standard is mostly used by low-power and low-rate WPAN (LoWPAN) applications on their physical and MAC layers. Thereat, its performance is monitored to evaluate the performance of CAP and CFP in different prospects. In Alvi et al., 19 the performance of the slotted CSMA/CA algorithm during CAP is evaluated by calculating the node's waiting time, failure probabilities, transmission delay, and network throughput. However, the impact of backoff period variation on slotted CSMA/CA performance is evaluated in Alvi et al. 20 Xia et al. 21 proposed an adaptive and real-time GTS allocation scheme (ART-GAS) for time-sensitive applications. The scheme is compatible with the IEEE 802.15.4 standard and also preferred for high traffic requirements that increase the bandwidth utilization as compared to IEEE 802.15.4 standard.
Multiple solutions are proposed for effectively allocating these CFP slots for delay minimization with increased throughput and assign more GTSs to nodes in comparison of the standard. [22][23][24] However, the focus of most of the previous works alters the standard superframe structure either by extending or shrinking the GTS area to optimize the GTS utilization.
In Alvi et al., 25 an efficient superframe structure (ESS) is introduced where CFP precedes CAP. Authors claim that ESS reduces the delay of GTS allocating nodes and offers better GTS utilization as compared to the IEEE 802.15.4 standard. Although ESS manages the delay up to some extent with improved data transmission, however, GTS requesting nodes still observe a significant amount of delay, which is not tolerable in many applications.
This article proposes a novel superframe structure, that minimizes the network delay for GTS requesting nodes with increased link utilization by allowing 16 GTS requesting nodes in an SD.  15.4 standard is designed for the low data rate, low-power, and low-cost wireless personal area network (LR-WPAN), which covers the physical and MAC layer. The standard operates in three frequency bands such as 868 MHz, 915 MHz, and 2.4 GHz. The first two are unlicensed for Europe and North America only, whereas 2.4 GHz is an unlicensed band worldwide. 868 and 915 MHz offer 20 and 40 kbps data rates, respectively, using the binary phase shift keying (BPSK) modulation scheme. However, 2.4 GHz offers a 250 kbps data rate with a 62,500 symbol rate using offset quadrature phase-shift keying (O-QPSK) modulation.
Superframe structure of an LR-WPAN allows nodes to operate in star as well as in peer-to-peer topology. Devices at tail of the network are normally associated to its coordinator and send their information directly to it in star topology, whereas coordinators/PAN coordinators exchange their information using peer-to-peer pattern, as shown in Figure 2.
A superframe structure comprises an active period also known as SD and an inactive period. SD starts with a beacon frame followed by a CAP and CFP. Beacon and CAP collectively have a minimum of nine slots and CFP contains a maximum of seven slots. The coordinator is responsible to generate beacon frames after periodic sessions. All nodes in that network are required to listen to this beacon frame not only to attain necessary information but also to synchronize themselves with the beacon frame. The time duration between two consecutive beacons is known as beacon interval (BI). SD and BI in the standard are determined as All the member nodes in a WPAN are assigned a unique short address for further communication with the coordinator. Only those nodes are capable to send their data using GTS that has been allocated a short address. A GTS requesting node is required to send its request during CAP by following the CSMA/CA algorithm. GTS is assigned through an FCFS basis. Sometimes, it will cause wastage of time slots and also a maximum of seven nodes can be entertained in CFP.

Proposed model
This section describes our proposed novel superframe structure, which offers reduced delay with better CFP utilization by allowing more GTS requesting nodes. This superframe comprises a beacon frame, a CFP, and two CAPs (CAP-1 and CAP-2). CAP-1 similar to CAP in the standard is mandatory. However, in standard, it comes right after the beacon frame, whereas it is placed after the inactive period in the proposed superframe. CAP-2 is optional and it comprises 0-8 equal duration slots. If there is no CFP-allocated node, then it occupies all eight slots; otherwise, it has leftover slots from CFP. In this superframe, the beacon frame is followed by CFP, an optional CAP-2, inactive period, and mandatory CAP-1, respectively, as shown in Figure 3. If all the available GTS are allocated, then there will be no CAP-2 and CAP duration will comprise eight superframe slots only as shown in Figure 4. If there is no CFP, then all these slots act as CAP-2 and CAP duration increases to 16 superframe slots as shown in Figure 5.
The main prospect of the relocation of different periods in our proposed superframe structure is to allow a GTS requesting node to transfer its data within a BI which is not possible in the standard. For example, when a node intends to send its data to CFP, then it  sends its GTS request to the PAN coordinator either in CAP-1 or CAP-2. After sending its request, it has to wait for the beacon frame to confirm its allocated GTS and transmit its data immediately before CAP-2.
Superframe duration in the proposed scheme (SD Prop ) comprises two parts such as SD 1 and SD 2 . SD 1 comprises beacon frame (a), CFP or/and CAP À 2, whereas, SD 2 comprises of CAP-1 only. In the proposed scheme, CAP-1 is mandatory and comprises of eight superframe slots. However, CAP-2 is optional and ranges from 0 to 8 superframe slots. CAP-2 shrinks or expands based on GTS utilization in the superframe. Both SD 1 and SD 2 are computed as The beacon frame is excluded from the superframe duration and follows after the expiry of mandatory CAP-1. This exclusion of the beacon frame will help the PAN coordinator to adjust without compromising the aminCAPlength parameter, as the minimum CAP length will never be less than 540 symbols. At the same time, eight superframe slots of CAP-1 are not short enough to increase the chances of a collision. The maximum CFP duration is similar to CAP-1 duration. However, these have been divided into 16 equal duration slots. This allows up to 16 GTS requesting nodes send their data. PAN coordinator scrutinizes GTS requesting nodes by applying a knapsack optimization algorithm instead of FCFS.
Superframe duration in the proposed model (SD Prop ) is computed as where a Freq is the beacon duration for different frequencies, and it is computed as where S 868 = 8, S 915 = 8, and S 2400 = 2, n is the number of nodes that have been granted GTS, and m is the length of beacon frame in bytes without GTS list field. The beacon interval (BI Prop ) and duty cycle (DC Prop ) of the proposed scheme for its different frequency bands are estimated as follows Nodes determine the arrival of next beacon (Beacon start ) from equation (9) In addition to that, the nodes estimate the start of the inactive period (SIP) and start of the CAP-1 (S CAP1 ) by simply knowing the values of SO and BO and using the expressions (10) and (11), respectively To achieve the proposed superframe format, the superframe specification field of the beacon frame has been modified as shown in Figure 6.
Bits (b 8 to b 11 ) in Superframe specification field indicates the start of the CAP-2 (S CAP2 ). However, in the original 802.15.4 standard these bits express the Final CAP Slot. If value of these bits are 0011 (3), then a node can determine the start of CAP-2 by simply following the formula as Similarly, GTS field comprises 2 bytes to augment 16 slots in CFP period. This helps in accommodating 16 GTS requesting nodes instead of seven in the existing standard. A GTS requesting node needs to compute the number of GTS required for transmitting its data. If N bps is the capacity of a CFP slot in bits and D is the amount of data required to be sent, then each GTS requesting node calculates the number of CFP slots N GTS as where N bps for 868 and 915 MHz is 15 3 2 SO + 1 and for 2400 MHz is 15 3 2 SO + 3 . At the end of CAP-1, the PAN coordinator scrutinizes applies knapsack algorithm on all GTS requesting nodes. A complete GTS allocation procedure for both node and coordinator is shown in Figure 7.

Knapsack optimization algorithm
The proposed scheme modifies the knapsack optimization algorithm to optimally scrutinize GTS requesting  nodes with adaptive GTS requests. The knapsack algorithm picks the most valuable items up to its maximum weighing capacity. We need to improve the link utilization of the CFP by accommodating more GTS requesting nodes in a superframe duration. The analogous knapsack statement, which relates to our problem, is as follows. Suppose there are k GTS requesting nodes which can be allocated GTS within the maximum capacity of 16 slots. In this knapsack problem, wights and values are the same, that is, the number of requesting slots of a node. The constraint of this optimization problem is to adjust the maximum number of GTS requesting slots to fill the available capacity of these slots to attain maximum utilization. This problem is mapped to the 0-1 knapsack problem by satisfying the following condition where X i , Y i , and C are GTS requesting nodes that may be selected, the number of GTS requested by a node i, and maximum GTS capacity, that is, 16. If total GTS requesting slots are within the maximum capacity of 16, then all requesting nodes will be allocated GTS according to their requests by applying for the shortest job first. However, if the total GTS demand is more than the available capacity, then the knapsack allows the WPAN coordinator to scrutinizes GTS requesting nodes to fulfill the above-mentioned condition according to the algorithm as shown in Figure 8.
Suppose there are seven GTS available and five nodes named a, b, c, d, and e are contending for these GTS by demanding 2, 2, 1, 4, and 3 slots, respectively. PAN coordinator after receiving all these requests arrange them in an ascending order and then compares it with the available GTS limit. If the number of requested nodes is less than the available limit, then all nodes are allocated GTS accordingly. However, if the number of requests is more than the available capacity then nodes are scrutinized with the help of 0-1 knapsack. The PAN coordinator fills knapsack table and scrutinizes nodes a, b, and e for sending their data during CFP with maximum CFP utilization. The knapsack table filling and selected nodes are shown in Table 2. However, IEEE 802.15.4 standard would select nodes a, b, and c on FCFS basis and two out of seven nodes remain unutilized.

GTS utilization
In a superframe, GTS utilization in a superframe is calculated as the total amount of data transmitted to their total transmission capacity. The proposed superframe structure comprises maximum 16 GTS by introducing small GTS as compared to the normal slot capacity. The smaller the slot capacity, the less will be the slot wastage resulting in a better utilization. Suppose, node A intends to transmit D A data and the time required to send this data is t A by offering data rate DR, then t A is calculated as The number of slots K A required by node A to send its data is calculated as Link utilization for A (U A ) is calculated as where t s is GTS duration and it is measured in seconds. If total GTSs allocated to n nodes are Slots tot , then cumulative GTS utilization (GTS Prop Uti ), for n nodes, is computed as However, GTS utilization in IEEE 802.15.4 standard (GTS 15:4 ) for a GTS allocated node A is calculated as

Network delay
The delay of a node is calculated as the amount of time when it has data to send till its successful transmission. Network delay is the accumulated delay measured by all nodes in a PAN to successfully transmit their data to their PAN coordinator. Suppose a node A has a data request during any time in a beacon interval. If its total time since its successful transmission in proposed scheme is t Prop A seconds, then it is calculated as where t d is time lapsed since node has data request in its buffer. t d will be zero, if node has data request just before the beacon frame. X b is the number of slots allocated to node n and its preceding nodes. t s is time in seconds of each GTS in the proposed scheme and it is calculated as If q nodes are assigned GTS, then the cumulative network delay in the proposed scheme is calculated as If all these nodes have GTS requests just before the start of their beacon frame then t j d will be 0. However, delay of the same node A, which has a GTS request just  0  0  0  0  0  0  0  0  c  0  1  1  1  1  1  1  1  a  0  1  2  3  3  3  3  3  b  0  1  2  3  4  5  5  5  e  0  1  2  3  4  5  6  7  d  0  1  2  3  4  5  6  7 GTS: guaranteed time slots.
The bold values show that these are selected as a result of the knapsack algorithm.
before the start of beacon frame in IEEE 802.15.4 standard (t Orig k ), is calculated as where t Orig is the CFP slot duration in seconds and it is calculated as If q nodes have been allocated GTS, then total time required for these nodes (D max Orig ) to send their data is calculated as

Performance analysis
In this section, a comparative analysis of the proposed scheme with ESS and IEEE 802.15.4 standard for 2400 MHz frequency band is evaluated. This performance analysis includes the following: Successful allocation of GTS to the requesting nodes. Amount of data transmitted in a superframe. GTS utilization in a superframe.
To evaluate the performance of the proposed scheme with the standard, three different data sets are chosen to evaluate them against different superframe order (SO) and beacon order (BO) values. The salient simulation parameters are shown in Table 3.

Number of nodes assigned GTS
In the IEEE 802.15.4 standard, the PAN coordinator assigns GTS to GTS requesting nodes on their requests. If requesting nodes are less than the available limit then all nodes are allocated GTS on their desired requests. However, if the number of GTS requested by nodes is more than the available limit, then the PAN coordinator scrutinizes nodes on an FCFS basis. In ESS, CFP slots have been doubled as compared to the standard, and each slot duration is reduced to half. This allows up to 14 GTS requesting nodes to send their data during CFP. The proposed superframe structure offers more CFP slots than the standard and ESS because the number of slots has been increased to 16, and each slot duration is reduced to half of the size of the standard causing more nodes in transmitting their data to the PAN coordinator during CFP. If GTS requests are more than the available limit, then nodes are scrutinized by applying a modified 0-1 knapsack algorithm. Results shown in Figures 9 and 10 verify that the proposed scheme scrutinize more GTS requesting nodes to send their data as compared to the standard and ESS for three different superframe durations with varying data requests and for three different data sets with varying superframe duration, respectively. It is evident from the results shown in Figure 10 that, with the rise in SO value, the GTS duration increases, and the proposed superframe allocates more nodes as compared to IEEE 802.15.4 standard and ESS, which allows 7 and 14 nodes, respectively.

Data transmission
Data transmission during CFP in a superframe duration of a WPAN depends upon the number of GTS assigned to nodes and GTS utilization. Assignment of  GTS to more number of nodes allows higher data transmission in a superframe duration and hence, better GTS utilization is achieved. The proposed superframe duration offers reduced GTS size with 16 GTSs. Reduced GTS size adjusts nodes' request with minute wastage resulting in better GTS utilization. Also, the PAN coordinator scrutinizes more GTS requesting nodes by applying a modified knapsack optimization algorithm. That is why the proposed superframe allows better data transmission as compared to the standard and ESS where nodes are allocated GTS on FCFS basis. The transmitted data of the proposed scheme is compared with the standard and ESS for different values of SO and multiple data ranges as shown in Figures  11 and 12, respectively. Figure 11 shows a comparative analysis of data transmission between the proposed superframe, ESS, and IEEE 802.15.4 standard for three different SO values when each node has a fixed amount of data request in each BI. The results show that the proposed scheme allows a significantly large amount of data as compared to the other two for different data ranges for varying values of SO. Figure 12 compares data transmission of the proposed scheme with the other two on different values of SO for three different random data ranges. It is evident from the results that data transmission in each BI in the proposed scheme is almost double as compared to the standard and much better than ESS for all values of SO with different data ranges.

GTS utilization
GTS utilization determines how efficiently slot capacity is used and it is measured in percentage. It is the ratio between the slot used to its maximum capacity. Smaller slot size allows nodes to occupy maximum slot capacity for the same data requesting nodes. The proposed scheme similar to ESS reduces slot size to half as compared to the standard for the same value of SO. This minimizes the slot wastage, and consequently, slot utilization is improved. Figure 13 shows a comparison between different values of SO and BO, when nodes have a fixed amount of data requests that increases from 20 to 200 bytes. The results show that GTS utilization in the proposed superframe is the same as ESS; however, it is significantly greater than the standard in most of the results. There are a couple of results when GTS utilization of all the competing schemes is the same. This is due to the data range of GTS requesting nodes when GTS is fully occupied. Figure 14 compares data transmission of the proposed scheme with the standard and ESS on different values of SO for three different random data ranges.   The results show that GTS utilization decreases with an increase in SO. Larger SO increases the slot capacity and most of the slot remains unoccupied resulting in poor utilization. However, it is evident from the results that GTS utilization of the proposed scheme is better than ESS and the standard.

Network delay
Delay is the elapsed time since a node has data request and until it successfully transmits the data. It is supposed that all GTS requesting nodes have data requests just before the start of beacon frame. Accumulated network delay is calculated for 10 beacon intervals. Network delay in each beacon interval is an average sum of delay computed for all nodes in each beacon interval. Accumulated network delay comparison of ESS, IEEE 802.15.4 standard, and the proposed scheme is shown in Figure 15. This delay is calculated for three different SO values with 50% duty cycle. It is evident from the results that network delay in proposed superframe structure is significantly less than both ESS and IEEE 802.15.4 standard. Figure 16 shows network delay comparison when data requests of GTS requesting nodes are in the range of 25-100 bytes. The results are calculated for 10 beacon intervals for an increasing value of SO with 100% duty cycle. It is evident from the results that in the proposed scheme, nodes transmit their data earlier than both ESS and IEEE 802.15.4 standard. The network delay calculated in the proposed superframe structure is 80% and 74% less than the network delay in IEEE 802.15.4 standard and ESS, respectively.

Conclusion
In this article, a novel superframe structure that comprises two CAPs is proposed. One of the CAPs is mandatory with a fixed duration and the second CAP is Figure 13. GTS utilization versus for fixed data nodes. Figure 15. Accumulated delay comparison for fixed data nodes. Figure 14. GTS utilization for random data nodes. Figure 16. Average delay comparison for varying SO and BO.
optional with varying duration. The proposed superframe structure is designed to minimize the waiting time of GTS requesting nodes. Furthermore, an efficient GTS allocation scheme that improves the GTS utilization of its CFP is proposed. The proposed scheme does not require additional parameters, without compromising existing parameters. The analytical and simulation results verify that the proposed scheme reduces network delay, offers better link utilization, and allows more GTS requesting nodes. The results verified that the proposed scheme reduced average network delay for both fixed and random data rates up to 80% also the GTS utilization is improved for both fixed and random data traffic and even 100% of GTS utilization are achieved. The proposed scheme accommodated up to 16 GTS requesting nodes, while in standard, the maximum capacity was seven nodes, thus improving the transmitting data capacity, and up to 40% more data are transmitted for both fixed and random data ranges.

Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.

Funding
The author(s) received no financial support for the research, authorship, and/or publication of this article.