# 1. Introduction

Radio spectrum is a precious, limited and scarce resource which is completely regulated by authorized bodies like Federal Communication Commission (FCC) and Ofcom. CR technology is proposed as a novel solution [1] for the conflicts between the spectrum scarcity in unlicensed band and low spectrum utilization in licensed band. Unlicensed users equipped with CRs may in future be able to sense and opportunistically utilize a licensed spectrum when the corresponding licensed user is not utilizing it. In the existing DSA/CR terminology, licensed users are called the primary users and unlicensed users the secondary users [2]. The key idea behind the DSA is to maximize the efficiency of the spectrum while ensuring the interference caused to the primary users is kept at a tolerable level. The secondary users are allowed to share the licensed spectrum only when the primary users have not occupied. This spectrum occupancy awareness can be achieved by spectrum sensing algorithms such as energy detection, matched filtering and feature detection [3]. Upon identifying the free spectrum, the secondary users can use it for their own communication without causing interference to the primary users. This approach of CR is called Hierarchical Access Model [4]. In addition, Spectrum Underlay is another approach of CR which aims at operating below the noise floor of primary users by using Ultra Wide Band techniques.

Standards like WiFi (IEEE 802.11), WiMAX (IEEE 802.16) and Zigbee (IEEE 802.15.4) include CR techniques to some extend in the form of coexistence, power control and dynamic selection of frequencies [5]. From the standardization perspectives of CR, the first milestone in the development of CR is the IEEE 802.22 WRAN standard, which proposes a CR based physical and MAC layer for the use of TV bands by the CR users on a non-interfering basis [5]. CR and DSA architectures and concepts are further developed by SCC41 / P1900 standards group [6].

The spectrum sharing among the primary and secondary users can be either in the form of cooperation or in the form of coexistence. The coexistence model of spectrum sharing enforces that the secondary user is responsible for the intricacies of spectrum sharing and no changes in the primary system is needed. In this paper, we adopt the opportunistic use of spectrum holes among the different forms of coexistence. Cooperation among the primary and secondary users need some form of interaction between them. For example, the primary user can demand payment from the secondary user and offer spectrum for their use.

The application of CR technology to DSA has created interest in developing spectrum access algorithms and policies for making efficient use of idle spectrum. In this context, there are several contributions which modeled the primary user - secondary user interactions using Markov models for dynamic spectrum sharing [7-12]. In [7,8], the authors proposed a centralized scheme for dynamic spectrum access using CTMC model of primary user - secondary user interaction. They proposed a primary prioritized Markovian access framework based on CTMC and evaluated the optimum access probabilities for the secondary users to maximize their throughput. Their contribution does not include the errors arising from spectrum sensing. The authors of [9] proposed a spectrum access scheme using CTMC with optimal channel reservation for secondary users. In [10] the authors evaluated the performance of opportunistic spectrum access using a two dimensional Markov model for a military environment. In [11], a framework based on Discrete Time Markov Chain for spectrum channelization between primary-secondary spectrum sharing was proposed. Their work included errors resulting from spectrum sensing for the performance evaluation and extended in [12] for flexible spectrum channelization schemes. A simple spectrum allocation algorithm based on 4D Markov chain model was presented in [13] for heterogeneous networks.

CR networks of the future may consist of primary and secondary users belonging to multiple networks operated by different service providers. This led to the distributed access coordination solutions as opposed to the centralized ones. To this end, there are several distributed schemes proposed in the literature. In [14], a distributed algorithm for learning and cognitive medium access using a Multi Armed Bandit model was proposed based on the assumption of an independently and identically distributed (iid) distribution of primary user transmissions. In [15], a game theoretic framework and no regret learning algorithm was proposed for distributed adaptive channel allocation. Another distributed approach to optimize the efficiency of spectrum allocation using a local bargaining mechanism was proposed in [16]. Thus in the literature, there are several centralized and distributed DSA schemes showing successful enhanced performance to increase the spectrum efficiency. Distributed DSA using a Markovian model was proposed in [17-18] both for perfect sensing and imperfect sensing. The throughput performance for one primary and two secondary users using a Distributed Primary prioritized Markovian Access (DPMA) algorithm was calculated. They did not consider a generalized scenario for performance evaluation and they assumed the spectrum sensing error parameters such as probability of detection and probability of false alarm. A detailed comparison of the existing models with the proposed is shown in Table.1.

**Table 1.**Comparison of the proposed and the existing models

In this paper, the spectrum access pattern using CTMC has been extended for a generalized scenario in which the spectrum sensing errors are incorporated from energy detection based spectrum sensing. The use of the proposed CTMC model for both centralized and distributed spectrum access approaches have been justified and the expected results based on the CTMC model are presented. The main objective of the CTMC based spectrum access algorithm is to optimize the throughput for multiple secondary users operating in the licensed spectrum of a single primary user. A detailed study on the use of access probabilities for the secondary users to achieve maximum throughput optimization is carried out. The performance of the algorithm is analyzed both for primary and secondary users in terms of throughput, access probability variations and interference.

Further this paper is organized as below: in Section 2 the System Model is discussed; in Section 3, Energy detection for spectrum sensing is explained; Section 4 describes the CTMC model for spectrum access; Simulation results and analysis are presented in Section 5; Section 6 is the conclusion of the paper.

# 2. System Model

We consider a primary-secondary system consisting of a primary network with one primary user and a CR network composed of N secondary users, each secondary user being equipped with a rudimentary CR system. The CR system model is either centralized or distributed depending on the architecture. The system model for the distributed CR system and centralized CR system with the proposed spectrum access scheme are shown in Fig. 1 and Fig. 2 respectively.

**Fig. 1.**CR System with Distributed DSA

**Fig. 2.**CR System with Centralized DSA

In the distributed approach [16], the CR system employs a spectrum sensing algorithm at the physical layer. The spectrum sensing algorithm is responsible for the primary channel occupancy detection. The results of the spectrum sensing algorithm are reported to the MAC layer at the end of every sensing. The MAC layer is incorporated with the spectrum access algorithm based on CTMC model of primary user – secondary user interactions. Initially, if the spectrum is found to be free, the secondary user accesses the spectrum with a probability α and other secondary users trying to access the spectrum at the same time can cause interference to the existing user. The concurrent occurrence of secondary users is less likely in a CTMC based model. Nevertheless, the interference can be controlled by a proper access probability assignment. The access probability values are calculated by the secondary users on their own based on the sensing outcome and the instantaneous interference encountered by the secondary user such that their throughput is maximized. In such a distributed scheme, the CR system should necessarily have an interference measurement unit to measure the interference experienced by the secondary user with other secondary users.

In the centralized scheme [7], each secondary user individually senses the primary spectrum and reports the results to the central base station via the common control channel. The fusion center in the CR base station is responsible for providing the access probabilities to the secondary users based on the sensing results and the service requests of the secondary users. The fusion center calculates the access probability such that the throughput attained by the secondary user is maximized.

The proposed model can be applied for any kind of spectrum access approach. In either case, the computation of access probabilities is very important and the actual method of computing the access probabilities is described in sec 4. Thus, we present the performance of the CTMC model which offers a wide range of applicability with high degree of practicality.

# 3. Energy Detection for Spectrum Sensing

In this section, we discuss the spectrum sensing mechanism performed by the CR system to identify the occupancy of the primary user. Spectrum sensing is performed periodically and it greatly depends on various aspects like channel conditions, hidden user problem, sensitivity of the sensing device, etc [19]. Consequently, the reliability of the sensing outcome may be limited. Spectrum sensing can be modeled as a binary hypothesis testing problem as,

When the primary user is present and the sensing algorithm selects H0, it is a mis-detection. Alternatively, when the primary user is not present and the sensing algorithm selects H1, it is a false alarm. The performance of the sensing algorithm can be defined by the following probabilities: probability of false alarm pf = Prob(H0/H1), probability of mis-detection pmd= Prob(H1/H0) and the probability of detection pd = Prob(H1/H1). The probabilities pd and pmd are complementary, given by pd = 1-pmd. It is often desirable to have low pf and high pd. However, there always exists a tradeoff between the two values. Receiver Operating Characteristic (ROC) curves are useful in exploring the relationship between the two probabilities, pd and pf which is a measure of sensitivity and specificity of the spectrum sensing technique respectively [19].

Energy detection is one of the most popular techniques employed for spectrum sensing. The energy detector, measures the energy received on the primary band over an interval of time and states the channel condition as occupied (H1) if the signal energy is greater than a predefined threshold or unoccupied (H0) otherwise [19]. The energy is computed using,

where Ti(y) is the test statistic (energy) computed at the ith sensing, xi(n) is the signal observed on the primary band and M is the number of samples considered for energy detection over the particular interval of time. The decision is to distinguish between the two hypotheses using a predefined fixed threshold λ, given by,

Closed form solutions can be obtained for pd and pf [20]

where based on the assumptions:

The decision threshold is calculated using,

where pf(tar) is the target probability of false alarm.

Thus, the test statistic is compared with the decision threshold, the state of the channel is identified and the results are reported to the spectrum access algorithm.

In a centralized scheme, the sensing is performed by the individual secondary user and the results are reported to the CR base station. The base station is employed with fusion algorithms [21] and evaluates the state of the channel as busy or idle.

The CR base station fuses the binary decisions according to the logic rule [21],

where Di (i = 1,2,…N) is the binary decision of local observation, n is an integer threshold which represents ‘n out of N’ voting rule. If n =1, the voting rule is the OR rule and n=N corresponds to the AND rule. Apart from this, few other fusion rules [22] are Chair-Varshney (CV), Likelihood Ratio Test based on Channel Statistics (LRT-CS), Equal Gain Combining (EGC), maximum ratio combining (MRC) can also be used.

In a distributed scheme, the CR system independently sense the channel condition and arrive at a decision or the secondary users in the CR network can exchange their sensing outcome via a common control channel and use any of the fusion rules to arrive at a final decision.

The sensing outcome in either case is reported to the spectrum access algorithm and the access probability values are calculated. The CTMC model for the spectrum access of secondary users, using which the access probability are calculated is described in the following section.

Cooperative sensing schemes are often vulnerable to Byzantine attacks in which malicious users send false decisions to the fusion centre so as to degrade the sensing performance. This necessitates the exclusion of potential attackers from participating in sensing. Many attacker detection and exclusion schemes are proposed in the literature [23-27]. Solutions for Byzantine attacks have been obtained in the optimal sense using minmax approach, game theory, based on Markovian model with conditional frequency check statistics and by using Hidden Markov Models. Our model assumes that all the secondary users are genuine users. Decision fusion in the presence of malicious users will degrade the performance of the system. The existence of Byzantine attacks for our model deserves further study and will be extended as future work.

# 4. CTMC Model for Spectrum Access

In this section, the CTMC model for DSA involving one primary user and multiple secondary users is studied. Fig. 3 shows the CTMC state transition diagram for DSA with one primary user P and one secondary user A. Similarly, the CTMC state transition diagram for DSA with one primary user P and two secondary users A and B is shown in Fig. 4 [16], which can also be extended to N number of secondary users. A system with single primary user (P) and two secondary users (A and B) is considered for illustration. The primary-secondary spectrum sharing is modeled as CTMC based on the assumptions of Poisson arrival of service requests (λ) and exponentially distributed service rates (μ). The arrival rates of the users P, A and B are denoted by λP, λA and λB respectively. Similarly the service rates for P, A and B are denoted by μP, μA and μB.

**Fig. 3.**CTMC State diagram for one primary and one secondary user

**Fig. 4.**CTMC State diagram for one primary and two secondary users

The state transition diagram of Fig. 4 is explained as follows. S0 is defined as the idle state of the spectrum. If the secondary user A (or B) tries to access the spectrum, it first senses the spectrum. If the spectrum is found idle with no false alarm, the CTMC transits from S0 to SA (or SB) at a rate of (1-pf)αAλA (or (1-pf) αBλB), where αi, is the access probability of the secondary user i, i∈{A,B}. To guarantee the spectrum access opportunity for the secondary user, the probability of false alarm pf should be maintained low. If secondary user A (or B) completes its service before any request from secondary user B (or A), the CTMC transits to S0 with a rate of μA (or μB). Otherwise, the state transition will be SAB with a rate of αBλB (or αAλA) where both secondary users share the spectrum. However, primary user may appear anytime during either A’s or B’s service or when both share the spectrum. If the secondary users identify the arrival of primary user, the CTMC transits to state SP with a rate of (1-pmd)λP. When the secondary users mis-detect the arrival of primary, the CTMC transits to SPA, SPB or SPAB correspondingly with a rate of pmdλP. The above three states represent the possibilities in which the primary user gets interfered with the secondary user’s communication and does not contribute to throughput. The probability that the CTMC is in these states should be avoided to protect the primary user from interference. This is possible only if the probability of mis-detection pmd is very low. The spectrum sensing algorithm employed in the physical layer should be efficient enough to reduce the mis-detection probability. Thus the probability of false alarm reduces the spectrum access opportunities to the secondary user and the probability of mis-detection cause interference to the primary users. The description of the CTMC states is shown in Table 2.

**Table 2.**State description of the CTMC

The CTMC introduced for one and two users can also be extended to multiple secondary users. For N number of secondary users, then the total number of states in CTMC is 2N+1. If S = [1,2,….N], the overall state space can be expressed as,

where state (1,[0,…,0]) denotes the state where the primary user is operating in the spectrum alone and the state {(0,φS)} represents that only the secondary users are in service. Similarly, the state {(1,φS)} represents that both the primary and secondary users interfere due to imperfect sensing.

For the generalized CTMC model, the state diagram can be represented as an N+1 dimensional hypercube. Each vertex of the hypercube represent a particular state in {(φP,φS)}, the edges are bidirectional which represent the user’s beginning or end of transition. The state probabilities can be obtained by solving the set of linear equations given in Table 3.

**Table 3.**Algorithm to solve the state probability for CTMC with imperfect sensing

For each secondary user, the number of states in which it is in service is 2N-1, out of which there are 2N-2 states do not contribute to throughput and represent the interference with the primary user. If N increases, the contention for spectrum also increase and each user share less spectrum on an average. For N=2, the state probabilities are denoted by,

Each probability in p can be viewed as the ratio of allocation time to that particular state to the entire reference time [7]. The throughput of a particular secondary user can be evaluated by taking the product of the particular state probability that the secondary user is in service and the capacity achieved by the secondary user when operating in that band. The analytical solution to determine the state probability for one primary and one secondary user is derived in Appendix.

If RP, RA, RB are denoted as the maximum achievable capacity values of primary user P, secondary users A and B respectively, the average throughput per user can be expressed as,

where RA’ and RB’ are the capacities of the secondary users A and B when they coexist. The capacity values Ri and Ri’ can be evaluated by [7],

where W is the communication bandwidth, Pt is the transmission power of the secondary user, N0 is the Additive White Gaussian Noise (AWGN) power and Gij is the channel gain of ith transmitter to jth receiver.

**Fig.5**ROC Curve of Energy detector

**Fig. 6.**Symmetric distribution of CR

**Fig. 7.**Each user’s throughput Vs Arrival Rate λA (Symmetric interference)

**Fig. 8.**Asymmetric distribution of CR

**Fig. 9.**Each user’s throughput Vs Arrival Rate λA (Asymmetric interference)

**Fig. 10.**Overall Throughput Vs Arrival Rate λA (Symmetric interference)

**Fig. 11.**Throughput Vs No. of secondary users

In a centralized approach, the fusion centre calculates the access probabilities such that the throughput achieved by the secondary users is maximized. For a two user scenario, we formulate this as an optimization problem where the goal is to determine the access probability of the secondary users αA and αB such that the system performance is maximized as given by,

where pj and pkj are the state probability values obtained using algorithm given in Table 3. As the closed form expression for αj is difficult to obtain, their values can be numerically solved as shown in Fig 12. In a distributed scheme, one heuristic technique [18] to obtain the access probability which is expected to maximize the throughput is by using the idle probability p0 as the access probability from the perspective of that secondary user.

**Fig 12.**Throughput performance with access probabilities

As the number of secondary users (N) increase, the numbers of states grow exponentially. But this approach of assigning access probabilities to the users eliminates the need for power control to manage the interference [8]. In a dynamically changing spectrum environment, when global optimization approaches are used for power control to manage interference, for changing number of secondary users, the network needs to re-optimize the power allocation completely. This results in high complexity and overhead when there are frequency service requests. Hence the proposed approach considerably reduces the complexity involved in interference management with access probability assignment and maximizes the average throughput in the long run.

# 5. Simulation Results and Analysis

In this section, the performance of CTMC based spectrum access algorithm for secondary users is analyzed. Initially, the ROC performance of the energy detector is analyzed for the extraction of pd and pf values. Secondly, the throughput for two secondary users is studied. The overall throughput performance of the secondary users is compared with a CR-CSMA based random access scheme. We also compare the performance of the proposed scheme with access probability assignment against the case with no access control. The overall performance gains achieved by the secondary users are clearly identified. The analysis is also extended for multiple secondary users. In addition, the maximum throughput is explored numerically using the optimum access probabilities. Finally, the collision probability analysis is performed based on the access probability.

## 5.1 Performance of the Energy Detector

The performance of the energy detector between pf and pd are evaluated using ROC curves. The decision threshold is obtained based on pf. The number of samples M considered for the analysis of energy detection is varied from 500 to 5000. The state of the channel (H0/H1) is determined by comparing the decision threshold with the calculated energy. The detection probability pd is obtained both analytically and by Monte Carlo simulations. From Fig. 5, it is observed that the probability of detection increases as the number of samples increases for a fixed probability of false alarm.

The probability of detection pd and probability of mis-detection pmd are obtained for false alarm probabilities pf of 0.01, 0.05 and 0.1. The number of samples M considered for the analysis is varied from 500 to 5000 as shown in Table 4. It is clearly evident from the table that when the probability of false alarm increases, probability of mis-detection decreases and vice versa. Since the probability of mis-detection should be less to protect the primary user from interference with the secondary users, further analysis is carried out using pf = 0.1 and pmd = 0.001.

**Table 4.**ROC values extracted from Fig. 5

## 5.2 Secondary User Throughput Analysis

For this analysis, one primary and two secondary users are considered. The parameters considered for the analysis are shown in Table 5.

**Table 5.**Simulation Parameters

In case one, symmetric interference between the secondary users A and B is assumed. The transmitter and receiver location of the secondary users are shown in Fig. 6. The throughput performance of secondary users A and B for perfect sensing (pf = 0 and pmd = 0) and imperfect sensing (pf = 0.1 and pmd = 0.001) are shown in Fig.7. From (12) and (13), for the locations stated above, it is clear that RA = RB > RA’= RB’. Thus, when λA < 85s-1, the throughput of the secondary user A is less than the throughput of the secondary user B. This is because the secondary user A has limited access to the spectrum than secondary user B till λA =85s-1. When λA = λB, the throughput of both the users are identical as they experience similar channel conditions and service requests. When λA > 85s-1, the throughput of secondary user B is reduced. Under perfect sensing, the throughput is better for secondary users A and B without affecting the throughput of the primary user. For the parameters considered as shown in Table 5, the primary user occupancy is 45.95% under perfect sensing. For imperfect sensing, the throughput of the primary user is slightly reduced to 45.89%, since low value is considered for mis-detection probability.

In case two, asymmetric interference between the secondary users A and B is assumed. The transmitter and receiver location of the secondary users are shown in Fig. 8. In this scenario, from (12) and (13), RA > RB > RA’> RB’ since the channel for secondary user B is inferior to secondary user A. Thus the average throughput of secondary user B is lesser than that of secondary user A as shown in Fig. 9. It is observed, similar to case one, the primary user spectrum occupancy is unaffected for perfect sensing and is 0.06% less for imperfect sensing. The average throughput performance of secondary users is tabulated in Table 6.

**Table 6.**Throughput Performance of secondary users A and B

In both cases one and two, the throughput performance of the spectrum access algorithm using the proposed CTMC model is analyzed for two secondary users without access control i.e., spectrum access probabilities are not assigned to the secondary users. The proposed scheme is also compared with the CSMA based random access scheme [29] in Fig. 10. For this comparison, a symmetric distribution of the transmitter receiver pair is assumed. A time slotted CSMA scheme is considered with the slot size of 5ms. We see that the overall throughput gain of the proposed is better than the CSMA for increasing arrival rates of secondary user A. This is because the secondary users are not allowed to utilize the spectrum simultaneously. However in the proposed scheme, secondary users can simultaneously share the spectrum and properly assigned access probabilities will enhance the overall performance gain. A similar performance can also be achieved in an asymmetric interference scenario. The access control probabilities provide control over the spectrum access and optimize the overall throughput of the secondary users. Thus, in the following section, the overall throughput for N secondary users is analyzed with and without access control and the use of access probabilities to the secondary users is justified.

## 5.2 Spectrum Access among Multiple Secondary Users

Fig. 11 shows the overall throughput for increasing number of secondary users without access control for both perfect and imperfect sensing. The spectrum access among multiple secondary users should be controlled by properly assigning the access probabilities. This can be accomplished through centralized or distributed approach which depends on the secondary network architecture. As the number of user increases, the average throughput per user is highly reduced, since the contention for spectrum is intense and each user shares a little spectrum.

The overall throughput of secondary users with and without access control probabilities is compared as shown in Fig.12 both for perfect and imperfect spectrum sensing. As the access probability is reduced, the secondary user throughput increases. From Fig.13, it can be observed that there exists a particular access probability for which the throughput is maximum. Hence, the access probability which maximizes the throughput is obtained numerically for the secondary users and assigned to them. It is also noted that the access probability which maximizes the throughput varies for increasing number of secondary users. With access control, the CTMC based spectrum access scheme achieves 12% to 42% higher throughput on an average. The throughput comparison for with and without access control is illustrated in Table 7.

**Fig. 13.**Throughput Vs Access probability

**Table 7.**Throughput comparison for with and without access control

From Fig.14, the collision probability, which is the probability that the primary user get interfered with the secondary users, is observed. The collision probability increases with the access probability of secondary user and increases with increasing number of secondary users. Fig. 15 shows the variation of collision probability with increasing probability of mis-detection for various access probability values. It is evident that the collision probability decreases with decrease in access probability.

**Fig. 14.**Collision Probability Vs Access probability

**Fig. 15.**Collision Probability Vs Probability of mis-detection

# 5. Conclusions

In this paper, a flexible spectrum access scheme using CTMC suitable for centralized or distributed CR network is presented. The proposed model can support a wide range of implementation possibilities. Secondary users perceive the behavior of the spectrum occupancy as a CTMC model. The primary spectrum occupancy awareness is achieved by sensing techniques. Based on the statistics of the secondary users and the sensing results, access probabilities are assigned to the secondary users such that the throughput of the secondary users is maximized. The tradeoff between the secondary user throughput and the sensing accuracy is studied. The performance of the scheme with and without access probability control is compared. The throughput degradation with respect to the increasing number of secondary users is analyzed. The possible probability of collision is also analyzed for various access probabilities. Simulation results show that for the abovementioned situations, these access probabilities help the secondary user to increase their throughput and reduce the interference.