1. Introduction
With the recent advancements in sensor and communication technologies, the Internet of Things (IoT)-based network has become one of the most promising technologies for future applications. IoT offers a diverse range of applications from healthcare to surveillance [
1,
2,
3,
4]. IoT is a network of smart physical objects—devices, vehicles, buildings and other items—armed with different kinds of micro-controllers, transceivers and protocols for the dissemination of sensing and control information [
5]. Therefore, IoT aims at provisioning an immersive, pervasive and ubiquitous connectivity of these smart objects. The current state of the art technologies to connect these heterogeneous objects include RFID, UWB, Bluetooth, ZigBee, WiFi Direct, etc. However, these technologies operate using the unlicensed spectrum band [
6]. Therefore, the QoS over different established links is uncontrollable. However, the QoS is of prime importance for the IoT; hence, an innovative solution is needed to ensure the desired QoS. For this purpose, the cognitive radio (CR) technology is a promising solution in this scenario because it can exploit both the unlicensed and the licensed spectra for transmission [
7,
8]. Therefore, in this paper, our major focus is to optimize the throughput and ensure desired QoS to IoT devices using CR technology in a smart building environment.
The smart city is an emerging concept that brings benefits in the management and optimization of public services, such as transport and parking, lighting on roads and inside buildings, the surveillance and maintenance of public areas, the salubrity of hospitals and schools, etc. To achieve this, extensive and prevalent data availability and computing compatibilities are needed for different IoT devices [
9,
10]. The concept of the smart city starts with the idea of a smart building. A smart building consists of several control systems, such as ventilation, heating, air conditioning, communication, and many more [
11,
12,
13,
14,
15,
16,
17]. To make intelligent decisions and effective optimizations of the available building resources, the data collected from IoT devices of different systems are all needed together. For instance, to make intelligent energy management decisions, the data collected from IoT devices belonging to different systems, such as heating, air conditioning and ventilation, need to be analyzed together. Therefore, a communication mechanism is required to provide the ubiquitous and pervasive availability of data collected by IoT devices of one system to the IoT devices of other systems within the building [
2,
4,
18]. Other important concerns for IoT in a smart building are energy efficiency [
19,
20], admission control [
21], naming and addressing [
22], privacy and security [
23], mobile sensing [
24,
25,
26], etc.
The smart building is the convergence of construction, electrical and information technology [
11,
15]. It is a new concept of building construction with the aggregation of network systems and devices. These devices belong to different systems. Therefore, they have different QoS requirements in terms of data rate, latency and bit error rate. Additionally, these IoT systems consist of massive numbers of IoT devices [
19,
22]. Therefore, the integration of these devices must be done with higher spectral efficiency. One of the key technologies to improve spectral efficiency is cognitive radio (CR) technology [
27,
28]. Thus, we employ CR technology for these IoT devices. CR is an intelligent communication device that can learn, decide and reconfigure itself based on the available portion of the spectrum [
29]. In a CR-based network (CRN), there are two kinds of users: (1) primary users (PUs) and (2) CR users or secondary users (SUs). CRs are only allowed to use the spectrum unused by the PU [
30,
31,
32]. Without loss of generality, we keep the same terms of PUs and CRs for our cognitive IoT-enabled smart building system, i.e., the mobile users, IoT devices and networking monitors (NMs) deployed inside the building are referred to as CRs or SUs and the few mobile terminals as PUs.
The work in the domain of channel assignment of CRNs can be classified based on their architecture (centralized or distributed), allocation behavior (cooperative or non-cooperative), access technology (underlay or overlay) and scope (intra or inter) [
33,
34,
35]. The research articles [
27,
34,
35] are focused on the QoS provisioning in CRNs, but they are inclined towards cellular communication. In [
36], an internetwork channel assignment scheme is presented to improve overall throughput at reduced interference. However, it ignores the QoS requirement desired by the PUs. Although the scheme presented in [
37] considers the QoS parameters, it completely ignores the availability of the channel due to PU activity. In [
38], the authors present a channel assignment scheme considering both the QoS parameters and PU activity. However, this scheme does not incorporate the traffic pattern for the applications running on different IoT devices. Similarly, the schemes presented in [
39,
40,
41,
42] target the energy efficiency, but they all lack in considering the PU activity and QoS of SUs. Likewise, the authors in [
43,
44] concentrated on congestion avoidance along with energy balancing, but do not consider individual QoS for optimal operation. Although the aforementioned schemes [
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44] are optimizing their objective functions, they are not suitable and applicable for the data dissemination of the IoT devices in a smart building environment. Hence, we propose a novel channel assignment scheme that considers the QoS requirements of different IoT devices, the availability of a channel due to the PU activity and the traffic patterns of different applications running on different IoT devices. The main contributions of our scheme can be summarized as follows:
An optimization problem is formulated for the channel assignment to different SUs (i.e., IoT devices, mobile user) in a smart building environment. The objective is to serve the maximum SUs while satisfying their desired QoS.
The optimization problem considers the number of QoS parameters (e.g., data rate, bit error rate and channel stability index) while taking into account the availability of channels by the PU activity and traffic patterns for different IoT applications.
A novel particle swarm optimization-based algorithm is proposed to solve the optimization problem.
To evaluate the performance of the proposed algorithm, exhaustive simulations are carried out by varying different parameters (e.g., the number of channels, the number of devices under scenarios where each IoT device uses different applications).
The rest of the paper is organized as follows.
Section 2 describes the system model.
Section 3 defines the problem formulation steps.
Section 4 illustrates the details about the PSO implementation. Simulation results are presented in
Section 5. Finally,
Section 6 concludes the findings and sets the future directions.
2. System Model
We consider a smart-building environment, which consists of a central entity,
Q spectrum-sensors,
I IoT devices,
M mobile users and
N free licensed channels. The central entity is responsible for spectrum-management, which includes the tasks of spectrum-sensing and spectrum-allocation. During spectrum allocation, the central entity allocates the available licensed channels to the IoT devices and mobile users. IoT devices and mobile users are considered to be SUs. However, they do not perform the task of spectrum-sensing because we employ dedicated sensors for the spectrum-sensing task. It not only helps to conserve the energy of IoT devices and mobile users, but also reduces the delay incurred in the spectrum-sensing process. First, the spectrum-sensors sense different channels to check whether they are empty or not and send their decisions to the central entity. Based on these decisions, the central entity decides finally whether a licensed channel is free or not. After spectrum sensing, the central entity performs the channel assignment to allocate the free channels to the IoT devices and mobile users. With reference to IoT devices, mobile users and networking monitors (NMs), we divided them into
C classes. Each class has minimum requirements in terms of data rate (
), bit error rate (
) and stability index (
). A typical smart building with IoT devices, mobiles users and spectrum-sensors is shown in
Figure 1.
Since IoT involves energy-constrained devices, these cannot transmit over long distances; otherwise, their battery will drain out very quickly. Therefore, to facilitate their communication with the central entity, we divide the smart building into a number of sections. Each section has specific gateways. The communication between SUs and the central entity happens via gateways. The frame exchange sequence between the SUs, gateways and central entity is shown in
Figure 2. A brief description of these frames is as follows. First, each SU that has data to send directs an I-REQmessage to its respective gateway. The I-REQ message specifies the class of a particular SU. After receiving I-REQs from all SUs, the gateways forward C-REQ message to the central entity. The C-REQ message includes the information about the requirements of all SUs associated with a particular gateway. After receiving C-REQ messages from all gateways, the central entity maximizes the total number of served users while assuring the minimal QoS requirement of each SU according to its class. For channel allocation to an SU, the central entity considers the data rate, bit error rate and stability index of the channel, which are discussed in subsequent subsections. The central entity broadcasts the C-GRANTmessage towards each gateway, which contains the list of channels assigned to each SU. Then, each gateway directs I-GRANT messages to the respective SUs. I-GRANT contains the channel number that is allocated to each SU. If a PU comes back on any channel, a PU-DETECTmessage is generated by the central entity to gateways, which indicates the arrival of the PU on the scheduled channel. As a result, gateways generates CH-PAUSEmessage to SUs to halt their ongoing transmission to avoid interference with PUs.
Table 1 depicts the important symbols and notations for better understanding of the proposed scheme.
2.1. Capacity and Bit Error Rate
We assume that each SU belongs to a certain class
and transmits the signal with power
. Let
be the interference experienced by an SU over the
kth channel, and
is the noise content. Then, the achievable data rate
of a
uth SU over the
kth channel can be computed using Equation (
1) as follows [
45]:
where
and
is the BER of a
uth SU over the
kth channel. It is proven to be a good model for the modulation scheme, such as MQAMwith a constellation size greater than or equal to four [
46].
2.2. Spectrum Sensing
Since SUs are using CR technology, the separate spectrum-sensors are deployed on top and inside the smart building, which are responsible for detecting the vacant spots in the spectrum for SUs. The transmitter detection (the signal received by the spectrum-sensors)-based hypothesis model can be given by Equation (
2) as follows [
28]:
where
is the signal received by a spectrum-sensor on the
th channel,
(t) is the transmitted signal of the PU,
h(t) is the channel response and
represents the noise content. For the sake of simplicity, we employ a double threshold-based energy detector, which calculates the energy of a PU signal on the
kth channel as follows:
if the value of
is greater than threshold-1, it is assumed that the PU is present over the
kth channel, and the SU cannot use the
kth channel for its transmission. However, if the value of
is less than threshold-2, it declares that the channel is available to SUs.
2.3. Channel Stability Index
As mentioned earlier, separate spectrum-sensors are deployed for PU detection. Each spectrum-sensor creates a vector on each sensing interval and forwards it directly to the central entity, which characterizes the channels based on their stability (PU activity) index. A channel with the least PU activity is considered to be the most stable channel. Let
= {
} be a history status vector (HSV) indicating the PU on-off activity over the
kth channel during
T time slots. For better prediction of PU activity, we vertically divide the HSV into different regions where
represents the most recent and
indicates the oldest region of the HSV, as shown in
Figure 3. Suppose that
= {
} represents the consecutive number of free slots in different regions of HSV and that
= {
} indicates the weights assigned to each region of the HSV. The weights are assigned in decreasing order from the recent to the older samples of HSV. The stability index can be given using Equation (
4) as follows:
where
indicates the stability index for the
kth channel. The larger value of
indicates that the channel is more stable and that it has the least PU activity.
2.4. Traffic Classes of SUs
We classify the SUs (i.e., IoT devices, mobile users and NMs) into six different classes based on their QoS requirements, as shown in
Table 2. The video IoT devices and video mobile users are considered in different classes due to different demands in terms of BER and the stability index of the channel (SoC). The smoke or fire detectors and ventilation control IoT devices need a small amount of data, but need more reliability and stability of the channel for real-time communication. The NM represents a real-time building monitoring class, which requires highly stable and reliable channels. For clarity, we use the letter
Ibefore IoT traffic class (e.g., Ivideo represents the video class for IoT devices). Similarly, the requirements of other classes are highlighted in
Table 2 [
47,
48].
4. Particle Swarm Optimization
PSO is an artificial intelligence technique inspired from the social behavior of birds, and it is used to approximate the solutions for optimization problems involving a large search space [
50]. An individual amongst the bird population is known as a particle, and it represents the possible solution (a bird in the flock) for a given problem. The fitness of each particle indicates how close it is from the ideal solution. The solution has definite boundaries, and the particles move within the
D-dimensional boundaries (flying space for birds) [
51]. Let
P represent the total number of particles (birds or solutions) and
represent the position of the
jth particle
at iteration
τ, where
indicates the position of particle in the
dth
dimensional space. At iteration
τ, the velocity of the
jth particle can be denoted as
, which varies in the range
. During each iteration, the fitness of the particles is evaluated to indicate their merit. The position of particles depends on two key parameters: (1) personnel best (
); and (2) the neighbor best (
). Let
indicate the best position of the
jth particle and be the best position in comparison with the neighbors. If we consider the rest of the particles as neighbors, then this term can be called the global best, and it can be represented by
. These swarm parameters help with quick convergence towards the possible solution. The velocity and position of individual particles can be updated using the expression given in Equations (
6) and (
7) as follows:
where
and
are two positive constants termed the learning factor or acceleration coefficients and
and
represent the uniform random numbers fully distributed in the range [0, 1]. The terms
and
represent the updated position and velocity factors for the
jth particle, respectively.
4.1. Particle Encoding
The encoding process is one of the important steps in the PSO process. It assists in binding the particle with the solution. For the current scheme, the solution is an assignment of N channels to M mobile users, I IoT and network-monitors. For example, the encoding particles for the high-load traffic scenario is () and for the low-load traffic is (). We perform the simulations using the aforementioned encoding scenarios, and we assume that mobile users, sensors and NMs are served on discrete channels.
Figure 4 illustrates the encoding process for two traffic scenarios (i.e., low traffic and high traffic). The size of Particle 1 is 20, which indicates the total number of requests from mobile users, IoT and NM, i.e.,
= 20, whereas the length of Particle 2 is
= 40. It is clear from the given scenarios that a particle represents the complete solution in terms of channel allocation to mobile users, IoT and NMs.
4.2. Position and Velocity Updates
To achieve the optimal solution, the swarm particles need to update their velocity and position. The velocity of the jth particle can be represented by the D-dimensional vector in which each element is a random real number, and it represents the change in channel allocation for a given iteration. For example, consider a particle for low load traffic; the velocity vector (−13 5 2 −8 33 24 −22 … −19 41 6 55) is added to the position vector (5 42 58 69 21 6 18, … , 6 11 22 30) to form the new position of the particle (8 47 80 61 54 30 4, … , 13 52 28 85). In order to bring the updated position of the particles within D-dimensional space, the velocities can be clamped using the given range .