1 Introduction

The rapid developments of wireless technologies and the explosion of their usage create an ever-increasing demand for more radio spectrum. The radio spectrum is one of the valuable and rarest resources in wireless communications. Real-time measurements have shown that, with traditional static spectrum allocation techniques, a substantial part of licensed bands remains unoccupied most of the time [1]. These challenges have directed the search for breakthrough radio technologies that can fulfill the future demands, both in terms of spectrum utilization efficiency and application performance. Cognitive radio (CR) has been proposed as an approach to improve the spectrum efficiency by exploiting the unused spectrum in dynamically changing environments. The main idea of CR is that some sectors of the licensed spectrum have not currently been used by the incumbent licensed primary users (PUs), and might be temporarily and opportunistically used by other unlicensed secondary users (SUs). If the PU resumes activity in the spectrum occupied by an SU, the SU must vacate the occupied spectrum [2]. Accordingly, the cognitive radio network (CRN) is mainly a conflation of PUs and SUs, and the PUs have the primary license to utilize the network spectrum.

The field of wireless networks is growing, and it will not stop until all spectrums have been exploited, or a new technology has materialized. There are primarily two methods for improving wireless technology, namely, the physical and logical methods. The physical method is to develop physical techniques to improve the transmission rate such as time-division multiplexing (TDM), frequency-division multiplexing (FDM) or code-division multiplexing (CDM). The logical method is to develop logical techniques to improve the communication between two nodes. The CRN has both physical and logical methods. The CRN physical methods are for implementing the control of physical sensing and the access control for the traffic. The CRN logical methods are to handle the traffic in the MAC layer. Therefore, CRN is a flexible subject that is a fertile ground with a new domain coming to the forefront, allowing researchers to dig in and share knowledge [3].

The CR has been envisioned as a major enabler, for both the current and future wireless networks, which allows dynamic spectrum access without interrupting the PUs. It has been considered a major advancement for a higher bandwith provision for the fifth generation (5G) network and it can meet the challenge of the CR-enabled Internet of Things (CR-IoT) [4, 5]. Fortunately, spectrum utilization with CR technology can be increased significantly by allowing a collection of unlicensed SUs to access frequency bands originally licensed for PUs. CRNs have the ability to sense the spectrum and detect the white holes and harmlessly exploit them. CRNs impose different challenges because of the high fluctuation in the available PU radio channel and the diverse quality of service (QoS) requirements of different SUs. These changeless include spectrum sensing, spectrum decision, spectrum sharing, and spectrum mobility. Therefore, an efficient resource allocation is needed to address these challenges. Many resource allocations methods and protocols have been proposed and developed to solve the different challenges of CRNs. The MAC protocol is considered as a crucial issue that can maintain and control the usage of the CRN spectrum at physical and MAC layers [3,4,5,6]. The MAC protocol must be carefully designed for CRNs environment to avoid turning the features of CRNs into disadvantages. Therefore, controlling the CR nodes to communicate is through controlling the MAC and improving its functionality [3]. A successful MAC protocol is the first step in a better communication environment regardless of how complicated and challenging the network. Making the right decision at the right time is the core job of the MAC protocol. Hence, this motivates us to the development of an enhanced MAC protocol that is able to maximize the system utilization in CRN [4,5,6,7,8].

In this paper, we propose a new enhanced distributed-based MAC protocol for multi-channel CRNs. The main objective of this proposed protocol is to improve the coexistence of licensed PUs and unlicensed SUs in CRNs. Precisely, based on the channel usage patterns of PUs, SUs determine a group of channels for channel sensing and data transmissions that satisfy their QoS requirements. Multiple channels can be defined as the independent channels that exists in a network environment, which can be in the frequency domain, time domain, or code domain. Focusing on CRN multi-channels frequency domain leads to another definition known as spectrum handoff [8]. Spectrum handoff is the ability of the SUs to handoff (mobile) between the frequency bands (channels). In addition, in wireless networks, the fragmentation concept is a method developed to improve the data transmission of wireless networks by splitting the large frame size into a number of smaller ones (called fragments). These fragments can be transmitted and acknowledged independently. It has been developed to serve many advantageous including wireless throughput improvement, rate adaptations, and lower energy consumptions [9].

Spectrum Management (SM) is the technical processes and procedures necessary to ensure efficient utilization of radio spectrum without causing interference. The SM and fragmentation techniques can be successfully adapted into the CRN MAC protocols for better performance. The frame fragmentation can be used to minimize the discarded SU’s larger frame size due to the PUs arrival. Therefore, splitting the larger SU frames into smaller ones makes it suitable for the smaller white spaces, and hence increases the useful spectrum utilization of the CRNs. In addition, the spectrum handoff is needed to switch in-service SUs to another available channel when a PU has been returned to this channel. Using spectrum handoff can protect the in-service SUs from being preempted by shifting them to another available channel. As a result, we can enhance the maximum utilization provisioning of the proposed CR MAC protocol by including these two techniques into its design in order to explore the available spectral opportunities dynamically, and guarantee the changing of frequency bands without breaking or degrading the PU’s QoS. In summary, the distinct contributions of this paper are therefore:

  • We Design a new distributed CR MAC protocol for utilization system enhancement in CRN, incorporating spectrum mobility and frame fragmentation for SUs.

  • An existing CRN MAC protocol with two other variants of the proposed protocol is evaluated and compared.

  • We present simulation results showing the performance of the proposed MAC protocol outperforms the legacy CR MAC protocol regarding system utilization gains, SUs average delays, and SUs total loss probabilities. We also show that the proposed CRN MAC protocol has advantages over the basic CRN MAC protocol at different system configurations.

The remainder of this paper is outlined as follows: Related works and contributions are discussed in Sect. 2. The system model and assumptions are presented in Sect. 3. In Sect. 4, the proposed CRN MAC protocol is discussed. The performance measures and results discussions are presented in Sect. 5. Finally, the paper is concluded in Sect. 6.

2 Related Works and Contribution

The QoS of SUs is one of the challenges for wireless communications in general and has been the focus of several studies [5, 10,11,12,13,14,15,16,17,18,19,20,21,22]. In [5], a priority-based call admission control for SU in CR-enabled IoT is proposed. In this scheme, the SU is classified into different priority levels and a dynamic channel allocation method is used to allocate the channel for SUs. In [9,10,11] the queuing method is used to model the QoS provision for SUs. In [9], a detailed survey on queuing models for CRNs is presented. In [11], a fair MAC protocol for Cognitive Radio Ad-hoc Networks is proposed in order to address the fairness issue in CRNs. The Markov chain model is used to study its performance measures. In [12], a queuing-based channel allocation method for the clustered SUs is proposed, and the performance in terms of SUs average delay is studied.

In [13], a decentralized MAC protocol for SUs is proposed in order to consider fairness issues between SUs in heterogeneous wireless networks. The Markov chain model is used to investigate the unfairness issues. In [14], a distributed multichannel MAC protocol for the CR ad hoc network is proposed. This proposed protocol is compared with the previous MAC protocol and it outperforms them. In [15], a novel MAC protocol for CR networks is proposed. The main goal of this protocol is to use a simple selection algorithm to choose the robust unused channels. Choosing the robust channel enhanced the system performance compared to conventional MAC protocols. In [16], a priority reservation-based MAC protocol in CRN is proposed. In this protocol, the common control channel (CCC) is used to transmit control packets that determine the priority of accessing the available channel. The next SU that gained the priority can access the channel without any collisions with other SUs.

In [17], a two-level priority MAC protocol has been proposed for a single half-duplex transceiver to utilize multiple channels using TDMA technique to improve throughput. The proposed method uses fixed-length time frames depending on the old technology of CSMA/CA by using CTS and RTS messages. This technique neglected the CRNs nature and made the proposed system as any other wireless system. In [18], a MAC scheme for different priority SUs over the developed standard 802.22 is proposed with parallel SUs transmission over several spectrums. The SU with the highest priority will access the channel through customized CTS/RTS techniques. In this research, they did not mention what will happen if the PU comes to its spectrum while SU is currently using it.

In [19], an adaptive MAC protocol for useful utilization enhancement in CR is proposed, which has the ability to change its transmission mode between dual transmit mode and frame recovery mode according to the channel status. It utilizes the legacy techniques in error recovery over two half-duplex transceivers to use the successfully received traffic under the PU’s heavy usage. In [20], a distributed cognitive MAC protocol with QoS provisioning for multimedia services over CRNs is studied. By exploiting diverse channel usage patterns, SUs can select the appropriate channels that satisfy their QoS requirements for both channel sensing and data transmissions. In this proposal, they assumed that the PUs do not heavily utilize the channels. Also if the SU had had the chance to communicate with the receiver and at that time the PU appeared, the SU communication would have failed and would start finding other available channels.

In [21], a proposition of cognitive MAC protocols based on the theory of the Partially Observed Markov Decision Process (POMDP) is presented. This scheme senses the spectrum and detects the occupancy state of different primary channels, and then opportunistically transmits over idle channels (white spaces). The proposal depends on time-slotted channels for the PUs and spectrum sensing and accessing the medium based on the channel transition probabilities. This proposal neglects the relation between the PU and SU where it focuses on SU utilization without looking at the PU behavior. In [22], an improvement to 802.22 is proposed. The proposed centralized MAC protocol for SU co-exists with the PU by using an inband/outband signaling mechanism. It uses extra channels to inform the others about the channel state through broadcasting the current channel status as a list. It focuses on how the SU is going to sense the channels and send a broadcast information about the situation for the reserved channel to avoid user collision.

Most of the above research focuses on enhancing the availability of SU instead of enhancing the performance, by limiting the SU assumptions, i.e., half-duplex transmission. In facts, the available resources in CR are opportunistic and entirely depend on PU’s activity. Since the exact behavior of PUs is hard to predict, the radio resource environment is highly dynamic and it is hard to guarantee a QoS for SU at a given moment. To efficiently probe the spectrum opportunity to provide SUs QoS and maximize the system utilization, it is essential to consider the characteristics of both the users and the channel usage in the MAC design. To the best of our knowledge, while there have been a number of research studies pertaining to CRN MAC protocol, few works have considered distributed cognitive MAC protocol for CRN with multiple channels, which take various user characteristics, spectrum mobility and channel usage activityFootnote 1 into consideration.

The MAC protocol of a CRN is supposed to enable the SUs to access unused or under-utilized spectrum dynamically without (or with minimal) interference to the PUs. To fulfill such a goal, we designed a new MAC protocol that exploits statistics of spectral usage for decision making on channel access. Therefore, the main objective of this paper is to design an enhanced distributed CRN MAC protocol for maximum utilization using multiple combined techniques, by considering real-time spectrum mobility and SU frame fragmentation to exploit the smallest spectrum holes. The performance measures that will help us to accomplish our goal are system utilization, SU loss probability, and SU average waiting time. Also a developed NS3 simulation is used to gain realistic results using decision-making processes.

3 System Model and Assumptions

In this study, we consider a centralized primary network that is composed of ‘N’ licensed channels for PUs and multiple distributed SUs, as shown in Fig. 1. The spectrum consists of ‘N’ non-overlapping channels, each with bandwidth ‘B’. The channels are assumed to have identical propagation characteristics. The availability of the channels depends on the presence of the PUs. We assume that the system has a dedicated common control channel (CCC) for managing, controlling and distributing information of the spectrums’ availability in real-time. The CCC is assumed to be available for all SUs and the coordination among SUs is performed through the CCC. Therefore, each SU keeps track of the list of the available channels. We assume that all SUs equipped with a software-defined radio (SDR) device with a full-duplex transceiver. We also assume that one of the efficient spectrums sensing schemes is used at the physical layer, and the results obtained are correct. The arrival and departure of both PUs and SUs are independent continuous time Poisson Processes. For each PU channel, the presence or absence of PUs is modeled using the ON–OFF model, respectively. The model of the PUs, SUs activity, and the CCC are explained in the following paragraphs.

Fig. 1
figure 1

Network Model with multi-channels

3.1 PUs Activity Model

Since PU activity is closely related to the performance of CRNs, the estimation of this activity is a very crucial issue in the spectrum sensing and utilization processes. We assume that PU channel activity can be modeled as exponentially distributed inter-arrivals. In this model, PUs traffic can be modeled as a two-state ON/OFF. An ON state represents the period for PU being active, and an OFF state represents the period for PU being idle. Since each PU arrival rate is independent, each transition follows the Poisson arrival process. Accordingly, the length of ON and OFF periods is exponentially distributed. Therefore the mean duration of ON state is (α−1) and the mean duration of OFF state is (β−1).

To consider the right environment for the SUs, we have to consider the behavior of PUs in order to define the white spaces (OFF period) that can be used by the SUs. Therefore, the overview of the PUs’ channels model is depicted in Fig. 2. In this figure, we assume that we have N PU channels and the PU activity is modeled using ON–OFF model. In this case, the spectrum of each channel will be busy during the ON period and free or unused during the OFF period. We call the unused spectrum of each channel during the OFF period white space (or spectrum hole) and this white space can be used by SUs. Utilizing the white spaces by SUs will increase the total system utilization and improve the QoS of SUs. The probability that the channel is in ON state is \(P_{{{\text{ON}}}} = \frac{\beta }{{\left( {\alpha + \beta } \right)}}\), while the probability that the channel is in OFF state is \(P_{{{\text{OFF}}}} = \frac{\alpha }{{\left( {\alpha + \beta } \right)}}\). In this case, the fraction of time in which the PU channel is busy (ON state) is defined as follows:

$$ {\text{U}} = \frac{\alpha }{{\left( {\alpha + \beta } \right)}}; $$
(1)
Fig. 2
figure 2

PU activity model using ON–OFF model (each PU channel is independent)

And the fraction of time in which the PU channel is free (OFF state) is

$$ 1 - U = \frac{\beta }{{\left( {\alpha + \beta } \right)}} $$
(2)

To calculate the PU utilization for each channel, we can use (1). For example, if the transition rate (arrival) from OFF to ON (β) is 0.3 and the transition rate from ON to OFF (the departure rate) (α) is 0.7, then the PU is utilizing 70% of the channel and the other 30% is free and can be used by the SUs. We assume that each PU channel has its own independent PU utilization. Therefore, each PU channel can be modeled as M/M/1/1 model with only one input as the PU and the utilization of PU is U as defined in (1).

3.2 SUs Model

According to the PU activity model, the remaining unutilized spectrum (White spaces) for each PU channel can be utilized by the SUs where there will be sensing and transmitting periods in any CRN. In this case, each PU channel is modeled as an independent server for SUs. Having N independent PU channels, we can use M/M/N/K model (N = 5 channels) to represent the overall system with coexistence of SUs/PUs, where the SU has the second priority and can be preempted by the presence of PU. Figure 3 shows the CRN model with PU/SUs coexistence. This model is multi-server queuing model used to represent the system model in case of SUs/PUs Coexistence where:

  • SUs arrive according to a Poisson process with rate λ.

  • The service times of SUs are exponentially distributed with parameter u.

  • There are N channels, serving customers in order of arrival.

  • Maximum number of users in the system including queued users are K where users who see at arrival K (K ≥ N) other users in the system are lost.

Fig.3
figure 3

CR Model (M/M/N/N) with SUs/ PUs Coexistence

The SUs arrival rate is λ and has Poisson distribution. The service time duration (access duration) has an expositional distribution and with mean time u−1. If this mean time is less than or equal to the mean time of the OFF state being accessed by SU, then the SU will complete its transmission otherwise it will vacate the channel before completion of its transmission. In other words, the in-service SU must vacate the channel whenever the PU appears (becomes active). Each SU is assumed to have a cognitive radio, which has the ability to switch among PU channels when necessary and can sense the PUs channels while transmitting frames. Each SU is assumed to have the same detection probability with perfect detections by ignoring the sensing errors.

3.3 Common Control Channel

The CCC is the heartbeat of the entire system and it synchronizes the events between PUs and SUs [7]. Also, it triggers the actions and broadcasts information about the system and data. We assume that the CCC covers all SUs and is always available. Every SU in the system must listen to the CCC constantly to adjust its timing and sending data. We assume that each SU has a full-duplex transceiver that can be tuned to the dedicated CCC while continuing frame transmissions. The CCC has two main functions as seen in Fig. 4. First, to broadcast the information of the channels' occupation status periodically. Second, to broadcast the information and give an order when an action happens such as when PU becomes available to send data and when SU starts sending data.

Fig.4
figure 4

Common control channel

4 The System Model for the Proposed CR MAC Protocols

In this section, we present the proposed CR MAC Protocol with three variations. First, the basic CR MAC protocol that is already existed is introduced and used as a reference model. Then its main shortcomings are highlighted. After that, the proposed CR MAC protocol model with its new features is explained. For each studied protocol, the pseudo-code and queuing model are shown.

4.1 Basic CR MAC (BCRM) Protocol

In this section, we highlight the previously studied basic CR MAC protocol in order to compare its performance with our proposed protocols. This model has been studied in [10, 11] and can be abbreviated in this study as BCRM. This protocol tries to allocate each SU frame into the white space of the channel if the frame size can fit in the allocated white space. Also, when the SU starts sending its frame, it will be assigned a single channel at a time. The SU frame size has a random size and will be generated randomly with respect to a specified mean to allow SU frames to fit into the most occupied channel by the PUs. There is no guarantee that SU transmission won’t be interrupted by the PU. In this model, each PU channel is independent and statistical identical. Since each PU is independent, each PU has a single channel while the SUs in the same network can be shared over multiple PU channels (N). Therefore, the system model for this protocol can be modeled as M/M/N/K where K − 1 is the SU queue size as shown in Fig. 5.

Fig. 5
figure 5

BCRM protocol model (similar to [10, 11])

Simply when the SU request arrives, it will be inserted into its queue if it is not full. If the queue is full, then it will be blocked. When the CCC triggers an empty channel (PU departure event occurs) then the queued SUs requests will be served based on FIFO. If the SU queue is empty, then the channel status returns to OFF state. If the PU appears before the SU’s transmission occupying that channel is complete, then the SU’s transmission will be forced to terminate and to vacate the channel and the channel state returns to ON. Otherwise, when the SU completes its transmission the next queued SU is served, if any. The queued SUs will be assigned to any available channel only if the mean time of the OFF state can accommodate the time of the next SU transmission request. The main steps of this BCRM protocol are outlined as a pseudo-code as shown in Table 1.

Table 1 Pseudo-code for the BCRM Protocol Model

4.2 The Proposed Cognitive Radio MAC Protocols

In this section, the proposed enhanced CR MAC (ECRM) protocol is explained. The main goal of this protocol is to overcome the shortcomings of the BCRM protocol and enhance both system utilization and SU QoS without interfering with the PUs. If we focus on the behavior of the BCRM protocol, we will discover two main shortcomings as highlighted in Fig. 6. First, as shown in Fig. 6 and labeled as (1), the sudden appearance of the PU on channel 1 while it is occupied by an SU, it compels the US frame to leave the channel and terminates its service. Unfortunately, the channel 3 is OFF and can accommodate the aborted SU frame at that time but the protocol does not support the spectrum mobility. Second, the SU transmission occupying channel 3 is at the end of its transmission and the PU suddenly appears. The sudden appearance of the PU compels the SU to terminate its transmission. The protocol does not support the frame fragmentation, otherwise it could avoid having a whole frame lose problem. These two shortcomings result in a higher wastage of spectrum utilization. These two shortcomings can be solved and enhanced in order to increase the system utilization and SUs successful transmissions rate. This proposed ECRM protocol will address these two shortcomings by incorporating the spectrum handoff and frame fragmentation.

Fig. 6
figure 6

The shortcomings of BCRM protocol

The fragmentation technique is introduced to stuff the white holes with SU small fragments so that the fragment can fit into the smaller spectrum holes instead of discarding the whole SU frame. The handoff technique is to give SU the ability to switch its connection (hand-off) to any new available channel when the channel's owner appears (becomes active) instead of discarding it. Finally, by combining these two features, we can have a significant improvement in the overall spectrum utilization. In order to explain the advantages of the proposed CR MAC protocol, we will divide it into different protocols each one having one of the ECRM protocol features. The proposed MAC protocol and its variations are shown in Fig. 7 and can be specified as follows:

  • (a) Fragmentation-Based Cognitive Radio MAC Protocol (FCRM)

  • (b) Handoff-Based Cognitive Radio MAC Protocol (HCRM)

  • (c) Enhanced Cognitive Radio MAC Protocol (ECRM), which combines both (a and b).

Fig. 7
figure 7

The proposed CR MAC Protocol and its combination

In the following sub-sections we describe the proposed ECRM protocol and its variations.

4.2.1 FCRM Model

The CRNs are all about sensing the radio spectrum and detecting the occupancy of different PUs’ channels, then opportunistically communicating over idle channels (white spaces). One of the main problems in the existed BCRM protocol is that the whole SU frame is discarded when the PU appears regardless of the amount of time elapsed serving the in-service SU frame. To mitigate this problem, the fragmentation can be used whereby large frames are fragmented into small pieces (fragments) that are individually transmitted. Therefore, using fragmented traffic will help in utilizing the spectrum of even the small white spaces, because it is hard to guarantee that the normal traffic frame will survive in the CRN. Therefore, for future developments, the fragmentation is suitable for channel flexibility and utilization. In case of the fragmentation, when the PU becomes available it will interrupt the last fragment in the white space only and the previous fragments are already served. So, instead of interrupting the whole SU frame in case of no fragmentation, the PU will interrupt only the remained fragments that are in-service upon PU appearance. Therefore, the interrupted fragments will be considered wasted, while the earlier fragments will be successfully transferred.

Figure 8 describes how fragmentation supports SU successful transmission. As shown in the figure, the interrupted SU transmission in channel 3 will lose only one fragment and hence the SU is required to resend one fragment. Therefore, the FCRM protocol differs from BCRM by enabling the SU to split its frame based on a predefined fragmentation factor before starting its transmission. In case of the SU transmission preemption, the SU is required to retransmit only the discarded fragments until the entire frame is transmitted. The fragment has a higher probability of getting through without interruption because it can be fitted into small holes rather than frames. So, by using this technique the SUs increase their chances to successfully transmit their data in heavy channel loads with small spectrum holes.

Fig. 8
figure 8

Fragmented SU frames

4.2.2 HCRM Model

This model introduces the handoff technique as a method used to enhance the SU successful transmission over PUs’ channels, also known as a spectrum handoff (SH). The SH refers to the process of switching the ongoing SU transmission, whenever a PU reclaims its channel, to a new available PU channel for resuming its transmission. Therefore, when PU appears, the SU leaves the channel and either switches to a certain available PU channel after immediate sensing and resumes its transmission, or terminates its transmission session if there is no other available channel. To make this technique smooth, the CCC is used to broadcast which channels are available to give the in-service SU a chance to switch its transmission to. Figure 9 shows the behavior of the channel handoff procedure. As seen in the figure, when the PU appears on CH 1, the ongoing SU pauses its transmission and resumes its transmission on channel 3 after channel switching. However, the SU transmission on the CH 3 is compelled to terminate its transmission because there are no other available PU channels at the time of the PU appearance. Using HS, The SU is given the ability to be switched over multiple PU channels to enhance the system flexibility. Hence, a single SU can have another choice other than aborting its connection as well as to maximize the overall system utilization by having a single connection shifting between channels to fill the white spaces. The process of this scheme is similar to BCRM, except that the handoff process is executed at the beginning of the PU appearance on a channel that is currently occupied by SU. Its system model is shown in Fig. 7b.

Fig. 9
figure 9

Handoff over PU channels

4.2.3 ECRM Model

Under this model, we merged the previous proposed MAC protocols, “FCRM” and “HCRM,” to generate a new enhanced MAC protocol abbreviated as ECRM. The ECRM protocol combines two main features, which are the spectrum handoff and the fragmentation techniques in order to maximize the benefits of these two features. The behavior of the spectrum handoff and fragmentation combination is shown in Fig. 10. As seen from the figure, the SU frame is given both the ability to be fragmented and switched (handed) over multiple PU channels to enhance the flexibility of SU given more options other than aborting its existing connection. As well as to maximize the overall system utilization by having multiple connections shifting between channels to fill the white spaces.

Fig. 10
figure 10

ECRM: Handoff combined with fragmented behavior

The enhanced CR MAC protocol model is depicted in Fig. 6c. The main steps of this protocol with spectrum handoff and frame fragmentation are shown as a Pseudo-code in Table 2.

Table 2 Pseudo-code for the ECRM protocol model

The complexity differs from one scheme to another based on the scheme process. The BCRM has the lowest complexity and the proposed ECRM has the highest complexity. The BCRM protocol only tries to allocate each SU frame into the white space of the channel if the frame size can fit in the allocated white space. The process of HCEM scheme is similar to BCRM, except that the handoff process is executed at the beginning of the PU appearance on a channel that is currently occupied by SU. This handoff process creates an additional complexity because of searching for an alternative available channel and the overhead of channel switching process. The FCRM protocol differs from BCRM by enabling the SU to split its frame based on a predefined fragmentation factor before starting its transmission. The packet fragmentation creates additional process and increase the scheme complexity.

Finally, under ECRM model, we merged the previous proposed MAC protocols, "FCRM" and “HCRM,” to generate a new enhanced MAC protocol abbreviated as ECRM to combine two main features in each MAC system, which are the spectrum handoff and the fragmentation techniques. Therefore, this scheme combines the complexity of both FCRM and HCRM schemes. Therefore, it has the highest complexity. However, the higher the complexity the higher the system gains.

5 Performance Measures and Results Discussion

In this section, the performance measures of the proposed models and the simulation setups are discussed thoroughly. Then the simulation results are discussed using different system configurations.

5.1 Performance Measures

In order to study and compare the performance of the proposed protocols, we have considered a number of performance measures. These measures include total channel utilization, SU channel utilization, loss probabilities of SU, and finally the SUs average delay. The definition of each measure is presented as follows:

  • Total System Utilization (CU): This is the utilization that comes from the valuable service time for both SUs and PUs (the utilization of users who completed their service time). It can be measured as follows:

    $$ {\text{SU}} = \frac{{\sum {\text{Useful Service Time}}}}{{{\text{Simulation Time }} \times {\text{No}}{\text{. of PU Channels}}}} $$
    (3)
  • SU Utilization (SUCU): This is the utilization that comes from valuable service time for SUs only. This measure can be defined as:

    $$ {\text{SUU}} = \frac{{\sum {\text{Useful SU Service Time}}}}{{{\text{Simulation Time}} \times {\text{No}}{\text{. of PU Channels}}}} $$
    (4)
  • Blocking probability: It is the ratio of the number of blocked SUs.

    $$ {\text{BP}} = \frac{{\text{Number of Blocked SUs}}}{{\text{Number of Arrived SUs}}} $$
    (5)
  • Dropping probability: It is the ratio of the number of dropped in-service SUs.

    $$ {\text{DP}} = \frac{{\text{Number of Dropped SUs}}}{{\text{Number of Arrived SUs}}} $$
    (6)
  • SU loss probability (LP): This is the total loss caused by blocking and dropping events. This measure can be defined as:

    $$ {\text{LP}} = {\text{BP}} + {\text{DP}} $$
    (7)
  • Average Delay (or waiting time) for the SUs. This is the average amount of time SUs spend in their queue waiting for the service. This measure can be defined as:

    $$ D = \frac{{\sum {\text{SU Waiting Time}}}}{{\text{Number of Departured SUs}}} $$
    (8)

5.2 Simulation Setup

In this section, we present the simulation parameters used to evaluate the proposed protocols. First, we developed a simulation program using NS3 in order to obtain the results of different proposed protocols in various scenarios. The results discuss the system performance measures including, system utilization, loss probability of SUs, and the average waiting time for SUs. We assume that the number of system channels (N) in the overall cases is five. Each channel has its own random and independent activity rate and is modeled using the ON–OFF model. During the OFF period, the SUs will have the chance to access the PU channel and use the unused spectrum. Each PU channel is modeled using M/M/1/K and the whole proposed CR protocol is modeled as M/M/C/K, where the duration time of the ON and OFF periods is assumed to be exponentially distributed. The main simulation parameters are listed in Table 3.

Table 3 Simulation parameters

5.3 Results Discussion

This section discusses the simulation results of the basic and proposed protocols. We present three main experiments to study the behavior of the proposals and compare them with the basic model as follows:

  • Experiment 1 Studies the performance measures of the SUs at varying PU loads.

  • Experiment 2 Studies the system utilization at varying SU arrival rates.

  • Experiment 3 Studies the performance measures of the proposed protocol with all features under special circumstances, e.g. higher SU queue size, higher number of PU channels, and high rate of SU fragmented traffic to study its performance from various aspects.

Experiment 1 This experiment focuses on studying the utilization behavior of SUs. The utilization of the system channels by SUs is studied at varying PU activity (PU channel utilization), which ranges from 1% until almost 99%, where each channel is fully utilized by PU users. In this section, the SU channel utilization, loss probabilities, and SUs average delay are investigated.

Figure 11 shows the useful SU system utilization versus the PU channel activity using BCRM, FCRM, HCRM, and ECRM protocols. The BCRM protocol gives the base results for the proposed CR protocols useful utilization. As we can see from the figure, the ECRM protocol at high SU loads exploits more useful utilization than the FCRM protocol at the beginning only because of the handoff technique used by ECRM protocol. Thereafter, the useful utilization is the same for both protocols because the system channels are fully occupied when we have an increasing PU activity and the handoff technique becomes useless. The protocol with handoff technique (i.e., HCRM) only has a better utilization than the BCRM protocol due to the switching the in-service SU to another free channel when the current channel is returned to PUs busy. However, the other two protocols have better utilization because they allow the SU frame to be fragmented into smaller chunks, which gives it the chance to be served in a short period of time before the next active PU period. Overall, the proposed ECRM protocol has the best performance because of the use of both fragmentation and handoff techniques. As the PU channel activity increases and becomes very high, the performance of all protocols becomes equal because of the usefulness of handoff and fragmentation techniques at a higher PU activity.

Fig.11
figure 11

SU useful utilization over PU activity

In Fig. 12, we compare the performance of all protocols in terms of the SU total loss probability. It is clear that one of the main causes of loss probability is when the PU appearance preempts the in-service SUs. Now, as we explained in the previous figure, the handoff and fragmentation techniques play a very important role in increasing the service completion rate of the in-service SUs. Hence, they increase the SU utilization and decrease their loss probability. Also, increasing the SU service completion rate improves the chance of queued SUs to join the service. Of course this improvement will diminish as the PU activity increases. The BCRM protocol has the lowest performance, while the FCRM protocol has a better loss probability than the HCRM protocol. This is because when we divide the SU frame into smaller ones (small fragment), the in-service SU will have more chances to complete its service in a shorter time period before the PU appearance, and hence, results in loss probability reduction. When the activity of PU reaches exceeds 60%, it means that the PU is utilizing the whole system channel with higher probability and hence the SU has no further opportunity to find free channels, and this scenario results in almost a complete loss.

Fig. 12
figure 12

SU loss probability over PU activity

The average delay of the SUs is compared against all the studied protocols. Figure 13 shows the average delay of SUs as the PU activity increases. As expected, increasing the service completion of in-service SUs using the handoff technique or fragmentation technique increases the chance of queued SUs to join the service. However, increasing the dropping probability of the in-service SUs also increases the chance of the queued SUs to join the next available channel. In other words, when the SUs’ rate of leaving the occupied channel increases because of either service completion or preemption (dropping), the chance for queued SUs to join the next available channel increases. This explains why the behavior of the BCRM protocol is similar to the behavior of the HCRM protocol. The ECRM and the FCRM protocols have more fragments because of using the fragmentation technique, so that the number of served frames is higher and the delay will be lower. This is because the SU delay is known to be the average waiting time in the system over the number of served frames. In addition, the performance of the ECRM and the FCRM protocols outperforms the BCRM protocol in terms of SU total loss probability and system utilization.

Fig. 13
figure 13

SU average delay versus PU activity

Experiment 2 In this experiment, we obtain the performance measures of all studied protocols in terms of the overall system utilization and the SU loss probability at high PU activity versus SU arrival rates. The PU activity is assumed to be 70%, while the SU load is varying. We use these configurations to show the improvements of the proposed protocols at high PUs activity, where the channel with lower PU activity always has room for improvements.

Figure 14 shows the overall system utilizations (by SUs and PUs) versus SUs arrival rates. As expected, the SU loads do not affect the PU utilization, because the PU has a higher priority and the ability to preempt any in-service SU occupying its channel when it becomes active. The main goal of the proposed ECRM protocol is to enhance the SU’s QoS by utilizing the unused spectrum in each PU channel during the OFF period. From the figure, we can clearly observe the superiority of the ECRM protocol where it can utilize all the free channels and records full system utilization at high SU’s arrival rates. This is because of the use of handoff and fragmentation techniques. The FCRM protocol with fragmentation outperforms the HCRM protocol with the handoff technique only. This is because the smaller SU fragments can utilize the smaller OFF periods (small spectrum holes) and completes its service faster than the SU with a bigger frame size that needs more service time to be transmitted and cannot fit into smaller OFF periods. However, the handoff technique still has a better improvement than the BCRM protocol because of the possibility of switching the in-service SU to another free channel when the PU becomes active. In general, using the ECRM protocol increases the system utilization by giving the SUs the chance to maximize the benefit of using all the free spectrums (white spaces).

Fig. 14
figure 14

Total system utilization versus SU arrival rates

Figure 15 shows the SU total loss probability at a high PU activity (70%) versus SUs arrival rates. The figure compares the performance of both the BCRM and ECRM protocols in terms of SU loss probability. As expected, as the arrival rates of the SU increase, its loss probability increases because of the limited spectrum holes when the PU activity is very high (70%). However, the ECRM protocol has the best performance compared to all other protocols because of its two efficient techniques. The handoff and fragmentation techniques that are employed in the ECRM protocol support the in-service SU to have a better chance of completing its service either by switching to another free channel or because of its smaller frame size that can fit into smaller OFF periods. In the case of the BCRM protocol, the loss probability has a constant average because it does not have any new techniques that can support the SU to transmit its frame through the appropriate OFF periods.

Fig. 15
figure 15

SU loss probability versus SU arrival rates

Experiment 3 In this experiment, we focus on investigating the performance of the ECRM protocol at different system configurations. The total system utilization, the SU total loss probability, and the average delay of SU are examined at different system configurations. These configurations include, increasing the number of system channels from 5 to 10 (C = 10), doubling the SU queue size (Q = 2000), and increasing the factor of fragmentation rate from 3 to 4 (F = 4).

Figure 16 shows the total system utilization using the ECRM protocol versus the arrival rates of the SUs. The PU utilization is added to the figure just to prove that it has not been interrupted by improving the performance of the SUs. In the figure, the total system utilization is investigated at a higher SU queue size and a higher fragmentation rate. As expected, as we decrease the size of the SU frames (having more fragments per frame), its chance to fit into the smaller OFF periods becomes higher and hence, its ability to complete its service also increases. Therefore, increasing the fragmentation rate will increase the system utilization because of the ability of SU to consume the spectrum of the smaller OFF periods and to consume most of the available spectrum. In other words, when the PU becomes active it will preempt the in-service fragments of the frame while the earlier fragments are served. Of course, this will be at the expense of having more frame overheads due to fragmentation. However, increasing the SU queue size has no direct impact on the system utilization. This is because when we have a higher PU activity and queued SUs, increasing the queue size can improve only the total blocking probability and increase the average delay of SUs. Finally, increasing the number of PU channels will provide more free spectrums and hence, the system will not reach its maximum utilization at an early stage when we have low to medium SU arrival rates compared to the situation when we have five channels only. However, at very high SU rates, the system will reach its maximum utilizations. Increasing the number of PU channels has a more positive impact on the SUs’ loss probability and the average delay as we will discuss in the next figure.

Fig. 16
figure 16

Utilization using ECRM protocol using multiple scenarios

In Fig. 17, the loss probability of SU is investigated versus its arrival rate. As expected, increasing the number of PU channels reduces the loss probability because having more channels increases the chance of having more free spectrums. Therefore, increasing the probability of having more free spectrum increases the chance of in-service SU to complete its service and hence, decreases its loss probability. When we increase the fragmentation rate, the service completion rate increases, especially at low to medium SU arrival rates. However, when the system utilization increases, increasing the fragmentation rate is useless at this stage. Finally, the figure shows that increasing the SU queue size has no positive impact on the loss probability. This is because the queue size has a direct impact on the average waiting time and blocking probability only. Therefore, the performance of the ECRM protocol has no improvements in terms of loss probability when we increase the SU queue size.

Fig. 17
figure 17

SU loss probability of ECRM protocol at multiple scenarios

Figure 18 shows the average delay of SU versus its arrival rate when we employ the ECRM protocol at different configurations. As expected, it can be seen that increasing the number of PU channels reduces the average delay. This is due to the chance of having free channel increases and thereby the queued SUs could be served early. However, when we increase the SU queue size, the SU average delay increases as the queue size has a direct relation to the average delay based on the Little Theorem and as defined in (6). Finally, increasing the fragmentation rate improves the average SU delay. This is because when we have a small frame size, its chance to find free spectrums that can fit with its service time increases. Therefore, the faster completion rate offered to the SU frame helps the queued SUs join the free channel in a faster way, and hence, decreases its average delay time.

Fig. 18
figure 18

SU Average delay of ECRM protocol using multiple scenarios

As a summarization, the discussed results proved that the ECRM protocol succeeded in providing the best results compared to the BCRM, FCRM, and HCRM protocols. This is because it employs the combination of two main features that can exploit the free spectrum in an efficient way. In order to enhance the proposed protocol, further study can be done to find the optimal size of fragmentation rate and SU queue size.

6 Conclusion

In this paper, we proposed an enhanced ECRM protocol in order to improve the radio resource utilization and provide better coordination over wireless mediums for secondary users (SUs). We started with the BCRM protocol then we added the handoff and fragmentation techniques. After studying the behavior of each technique, we proposed a new ECRM protocol with the combination of these two techniques in order to provide a significant role in the improvement of the implementation of CRNs.

The performance measures of the BCRM and the proposed ECRM protocol in terms of total system utilization, SU utilization, SU loss probability, and the SU average delay are studied and compared. From the results, we conclude that allowing the in-service SUs to be switched to another free channel improves all the performance measures. In addition, employing the SU frame fragmentation technique enhances the in-service SU completion rate and improves the performance of the ECRM protocol. In addition, the ECRM protocol that combines both the handoff and fragmentation techniques has the overall best performance compared to all other variant protocols that were under consideration. Finally, the performance of the ECRM protocol is examined in different scenarios, and it shows the superiority over other protocols. As a future work, further enhancement can be accomplished by finding the optimal system configurations in terms of the number of channels, queue size, and fragmentation rate.