Performance Analysis of Cognitive Radio Networks with a Two-part Queue

In a cognitive radio network (CRN), a preempted secondary user (SU) is placed in a call level queue to wait for accessing another free channel. If the availability of channels is transparent to SUs, packets will be generated during their waiting time and the performance of the CRN will be influenced by which way to handle these packets. In this paper, the call level queue is departed into two parts, delay queue and discard queue. Here, an analytical model is developed to derive the formulas for both call level performance measures (i.e., call blocking probability) and packet level performance measures (i.e., packet delay, packet loss ratio and throughput). Numerical results show that theoretical models are consistent with simulation results. The major observations include (i) The performances of an SU degrade as the call arrival rate increases. (ii) With the increase of the delay queue length, the SU call blocking probability and packet delay increase, while the packet loss ratio and throughput decrease. (iii) Adopting different delay queue length causes a smaller effect on call blocking probability and throughput than on packet loss ratio and packet delay.


INTRODUCTION
With the rapid growth in demand for wireless communications, the spectrum resources become scarce.According to Federal Communications Commission (FCC), the unlicensed portions of the spectrum in which most wireless networks operate are heavily occupied, whereas the licensed portions of the spectrum are sporadically used [1].In a CRN, an unlicensed user (SU) opportunistically accesses a spectrum hole, which is a channel assigned to a licensed user (Primary User, PU) but not being used at a particular time and geographic location [2].With the help of the cognitive radio technology, the SUs can access these spectrum holes without affecting the PUs [3].The utilization of the radio spectrum can be improved significantly by employing the cognitive radio technology.However, this channel cannot be continuously utilized by the SU due to the presence of the PU.Thus, an SU must vacate the channel once detecting a PU appearance in it [4].At the same time, the SU will scan all the channels and switch to another unused one if available; otherwise, it will be preempted.A preempted SU can either leave the system or wait in a call level queue, and accordingly, its connection is terminated or suspended.The performance study of a CRN with such SUs' behaviors is important to understand the performance of the whole CRN.
There are some studies on the call level performance analysis of CRNs [5][6][7][8][9][10][11][12][13][14][15].In [5], the forced termination *Address correspondence to this author at the School of Electronic and Information Engineering, South China University of Technology, Guangzhou, 510640, China; Tel: 13929591016; E-mail: aries.zm@gmail.comprobability, blocking probability are compared for SUs with different traffic patterns.Zhu in [6] proposes a channel reservation scheme for a licensed spectrum sharing system and finds that forced termination probability can be greatly reduced through the reservation.In [7], a finite queue is introduced to store the newly arriving SU if there is no idle channel available, which is able to significantly reduce the SU call blocking probability and non-completion probability.The SUs are classified into two priority classes in [8].A number of channels are reserved for the high priority SUs and the optimal reservation can be obtained.In [9], a mathematical analysis for CRN with imperfect sensing results is introduced.The call blocking probability, the termination probability and the spectrum utilization are analyzed.In addition, the performance of a CRN under realistic channel switching agility is studied in [10].This work shows that the spectrum access capability and efficiency can be significantly lesser than what existing works usually claim.In [5][6][7][8][9][10], an SU is assumed to leave the system and terminate its connection once it is preempted.While in [11], Tang introduces a preemption queue for SUs to suspend their connections.A SU remains in the preemption queue until another channel is released.Expressions for the blocking probabilities and waiting times are derived.In [12], non-real-time calls are allowed to wait in buffers, while real-time calls are not allowed.The performance measures are derived in terms of service completion time, blocking probability and forced termination probability for both real-time and non-real-time traffic.In [13], the state dependent access probabilities for SUs are optimized so that the spectrum resources can be efficiently and fairly shared by the SUs in an opportunistic way without interrupting the primary usage.
In [14], some channels are reserved for high-priority SUs handoff.Call blocking probability and mean handoff delay are derived.Moreover, the preemption queue is proved to be able to reduce the SU blocking probability while increasing its throughput [15].In all of the studies above, the packet level policies in a CRN are not considered.But according to our previous works [16], if the availability of channels is transparent to SUs, packets will be generated by them during their suspending period and the performance of a CRN will be influenced by which way to handle these packets.In this paper, we consider the preempted SUs are saved in a call level queue.The call level queue is departed into two parts, delay queue and discard queue.If a preempted SU waits in delay queue, packets are delayed and saved in a packet buffer, which are sent once the SU gets a channel again.On the other hand, when it is in discard queue, one packet is discarded in a time slot.Furthermore, a model is proposed to analyze the performance of a CRN with such a two-part queue at both the call level and packet level, and the formulas for PU and SU call blocking probability, packet loss ratio, packet delay, and throughput are derived.

SYSTEM MODEL
The following notation is used in discussion.
• N: the total number of channels in the system.
• λ p : the call arrival rate of PUs.
• λ s : the call arrival rate of SUs.
• 1/µ p : the mean of the call duration of PUs.
• 1/µ s : the mean of the call duration of SUs.
• Q: the length of the delay queue.
• P bp : the PU call blocking probability.
• P bs : the SU call blocking probability.
• P dis : the discarding probability.
• P d : the delaying probability.
• P l : the packet loss ratio.
• D: the packet delay.
Consider a CRN with N channels being shared by PUs and SUs.The call level model for a CRN is shown in Fig. (1).The arrivals of PUs and SUs are modeled as Poisson processes with rates of λ p and λ s , and the corresponding call duration is exponentially distributed with means of 1/µ p and 1/µ s , respectively.We assume that one PU or SU requires one channel for service.For an SU call arrival, it is accepted only if there is a free channel.For a PU call arrival, since the existence of SUs is transparent to PUs, it is admitted if the number of PUs in service is less than N.When an accepted SU is preempted due to a PU arrival, the SU senses all the channels and switches to an idle one if available; otherwise, it is placed in a call level queue to suspend its connection.When channels become available again, the SUs suspended in the queue are reconnected back to the system in firstcome-first-served (FCFS) order.The call level queue is departed into two parts, delay queue and discard queue.We assume that the length of the delay queue is Q.The first Q SUs save packets in its packet buffer until an idle channel is available, while SUs behind them just discard those packets to insure acceptable delay.
During an SU call duration, one packet is generated in each time slot.The generated packet is sent if the SU gets an idle channel to transmit.When the SU waits in the preemption queue, the packet is dropped or delayed, which depends on the position of the SU.Each SU has a packet buffer, where all the delayed packets are saved.At the end of the call duration, if the packet buffer is not empty, the service for the SU cannot end and the extra service time starts.In a time slot during the extra service time, one buffered packet is sent or discarded if the SU accesses an idle channel or waits in the discard queue, respectively.For example, as shown in Fig. (2), the total service time is divided into two parts.In the first part, i.e., the call duration time, seven packets are generated by an SU, three of which are delayed and saved in the packet buffer.In the second part, i.e., the extra service time, those buffered packets are sent or discarded if the SU gets a channel to transmit or it is in discard queue, respectively.The service cannot end until the call ends and the packet buffer become empty.
The spectrum sharing for SUs and PUs in a CRN can be modeled as a two-dimensional Markov model with states (i, j).Let P(i, j) be the stationary probability of the state (i, j) .The state space ! is given by != {(i, j) / 0 " i " N;0 " j " N} (1) In order to simplify the expressions of a formula, we define two functions !(i, j) and I t (i, j ) as and where t(i, j) is a function of i and j .

PERFORMANCE ANANLYSIS
Since a PU accesses a channel as there is no SU, the PU's arrival rate and departure rate is λ p and µ p , respectively.If the total number of users in the system is smaller than N, a newly arrival SU is admitted, and its arrival rate is λ s ; otherwise, the SU is blocked, and its arrival rate is zero.If an SU is in communication state or discard queue, the SU's service ends as the call ends and its departure rate is µ s .When an SU is in delay queue, its service can not end and its departure rate is zero.Fig. (3) shows the state transition diagram of a CRN.As shown in the picture, the transition rate from state (i, j) to state (i, j-1) is jµ s for the states satisfying i+j<N.Under this scenario, there are j SUs in communication state, and their departure rates are µ s .The transition rate from state (i, j) to state (i, j-1) is (N-i)µ s for the states satisfying N<i+j<N+Q.Under this scenario, there are N-i SUs in communication state and j-(N-i) SUs in delay queue, and their departure rate are µ s and zero, respectively.The transition rate from state (i, j) to state (i, j-1) is (j-Q)µ s for the states satisfying i+j≥N+Q.Under this scenario, there are N-i SUs in communication state and j-Q-(N-i) SUs in discard queue, and their departure rate are µ s .
The steady-state balance equations for a CRN are listed below.

Call Level Performance Analysis
An PU's call blocking probability is the probability that there is no free channel for the newly arrival PU, that is, the probability that the number of PUs is greater than or equal to N, so the PU's call blocking probability P bp is An SU's call blocking probability is the probability that there is no free channel for the newly arrival SU, that is, the probability that the total number of users is greater than or equal to N, so the SU's call blocking probability P bs can be expressed as P bs = I i+ j!N P(i, j) The mean number of SUs in the system is n = jP(i, j) If the total number of PUs and SUs is smaller than N, no SU is in delay queue; If the total number of PUs and SUs is greater than N but smaller than N+Q, i+j-N SUs are in delay queue; otherwise, there are Q SUs in delay queue.So the mean number of SUs in delay queue is An SU's delaying probability is the ratio of the number of SUs in delay queue to that of admitted SUs, is, If the total number of PUs and SUs is smaller than N+Q, no SU is in discard queue; otherwise, there are i+j-N-Q SUs An SU's discarding probability is the ratio of the number of SUs in discarding state to that of admitted SUs, that is,

Packet Level Performance Analysis
The packets generated by a SU are sent or discarded when it is in communication state or discarding state, respectively.So the packet loss ratio is, In the CRN, an SU's delayed packets are saved in its packet buffer.Let the buffer length x(i) be the amount of the packets saved in the buffer in a certain time slot i.The total buffer length !i j is defined as the sum of the buffer length from time slot i to j.Assuming that the length of an SU call duration is n (n>0 is an integer), and END (END≥n is a random variable) is the end of the total service time for the SU.
From time slot 1 to n, one packet is generated at every time slot and delayed with a probability P d .If a packet is delayed in time slot i, it increases the total buffer length during the call duration by n-i+1.Thus ! 1 n is The extra service time lasts from time slot n+1 to END, and one buffered packet can be sent or discarded with a probability 1-P d in each time slot.The value of !i END (n＜i＜ END) depends only on x(i-1).Suppose . Hence the relationship between !(k) and !(k " 1) can be given by and !(k) can be derived as Where (1) ξ is the total buffer length from time slot i to END when the buffer length is 1 in time slot i-1.!(1) can be given by From Equations ( 19) and (20 Since the probability that x(n) is k means that k packets are delayed during the call duration time, that is the total buffer length in the extra service time is From Equations ( 17) and ( 23), the total buffer length within the SU's total service time can be expressed as Because the call duration is exponentially distributed with means of 1/µ s , the probability that the length of an SU call is n is Therefore, the mean of The average length of a packet flow generated during an SU's service time is 1/µ s , so the SU's packet delay can be calculated according to Little Theory [17] as follows The throughput for SUs is defined as the total number of packets sent by all the successfully completed SUs in a time slot [18].Let n c and n p be the average number of complet- ed.
SU calls per time slot and successfully transmitted packets per SU, respectively.The throughput can be given by the product of n c and n p .Since the length of a time slot is much smaller than a call, the number of admitted and completed SUs in a time slot can be given by the admitted and completed rate, respectively.The number of SUs admitted in a time slot is n a = (1!P bs )" s (28) As we known as the queue theory [17],the admitted rate is the same as the completed rate when the system works in a steady state.So the number of completed SUs in a time slot is also ) We know that the mean length of an SU packet flow is µ s -1 ,so the number of successfully transmitted packets per SU is From Equations ( 29) and (30), the SU throughput is

NUMERICAL RESULTS
The proposed system models for CRN are simulated in MATLAB.In the simulation, the arrival and departure processes of PUs and SUs are randomly generated according to the corresponding system parameter.The channel accessing process is performed according to the call level model.The policies for the generated packets are performed according to the packet level models.Each user generates one packet in a time slot during the call duration.The length of the time slot is set to 1.The call blocking probability is obtained as the ratio of the number of blocked users to the total number of generated users.The packet loss ratio is obtained as the ratio of the number of dropped packets to the total number of generated packets.The packet delay is obtained as the ratio of the total delay of all the packets to the total number of generated packets.The throughput is obtained as the ratio of the total number of successfully transmitted packets of all the SUs to the total number of simulation time slots.To evaluate the accuracy of the analytical model, we compare the results obtained from the analytical model and the simulation.The parameters are set as follows: N=17, µ p =0.01 and µ s =0.01.The PU arrival rate ranges from 0.03 to 0.09.The SU arrival rate is set to be 0.03 and 0.09.The length of the delay queue is set to be 0, 1 and N. Symbol T and S in the figures indicates theoretical and simulation results, respectively.
Figs. (4)(5)(6)(7)(8) show the simulated and analytical results for PU call blocking probability, SU call blocking probability, packet loss ratio, packet delay and throughput of a CRN varying with PU, SU call arrival rates and the length of the delay queue.It can be seen that the proposed analytical models fit the simulation results very well.Fig. (5) shows the simulated PU call blocking probability and the theoretical results for the CRN.As the PU call arrival rate λ p increases, fewer channels are available, which causes an increase in PU call blocking probability.Additionally, as the SU call arrival rate λ s and the length of the delay queue Q varies, PU call blocking probability does not change.It can be concluded that the SUs performs transparent for PUs.Fig. (5) shows the simulated SU call blocking probability and the theoretical results for the CRN.As the call arrival rate λ p or λ s increases, less channels are available and mo-reSUs contend for the available channels, which causes an increase in SU call blocking probability.Additionally, the SU call blocking probability is greater when the length of the delay queue is longer.This is because that longer delay queue length causes heavier traffic load and more SUs in waiting state.Fig. (6) shows the simulated packet loss ratio and the theoretical results for the CRN.As the call arrival rate λ p or λ s increases, the packet loss ratio increases.This is because fewer channels are available, which causes more SUs waiting in the preemption queue.Additionally, the packet loss ratio is smaller when the length of the delay queue is longer.This is because that longer delay queue makes more SUs in delay queue.Fig. (7) depicts the simulated packet delay and the theoretical results for the CRN.As the call arrival rate λ p or λ s increases, the packet delay increases.This is because fewer channels are available, which causes more SUs in waiting state.Additionally, the packet delay is greater when the length of the delay queue is longer.This is because that longer delay queue causes heavier traffic load and more SUs waiting in the delay queue.PU call arrival rate, λ p PU call blocking probability, P bp λ s =0.03,Q=0,T λ s =0.09,Q=0,T λ s =0.03,Q=N,T λ s =0.09,Q=N,T λ s =0.03,Q=0,S λ s =0.09,Q=0,S λ s =0.03,Q=N,S λ s =0.09,Q=N,S   Fig. (8) shows the simulated throughput and the theoretical results for the CRN.As the call arrival rate λ p or λ s increases, fewer SUs are accepted in the system and more packets are discarded, which causes a decrease in SU throughput.Additionally, the difference of the length of delay queue can not make much difference to throughput.This is because that a variety of the delay queue length makes an opposite change in call blocking probability and packet loss ratio.

CONCLUSION
In this paper, the preempted SUs are suspended to wait for another channel to avoid direct leaving.Packets are discarded or saved when the SU waiting in discard queue or delay queue, respectively.Analytical models are developed to study the call level and packet level performances of a CRN, which provides an understanding of the connection between the performances of these two levels.The formulas for the PU call blocking probability, SU call blocking probability, packet loss ratio, packet delay and throughput are derived.Numerical results show that the proposed analytical model fits the simulation results very well.The performances of a CRN degrade as the PU or SU call arrival rate increases.The call blocking probability and packet delay are smaller when the length of the delay queue is shorter, while the packet delay is greater.Different delay queue length can not make much difference to call blocking probability and throughput, but has a large effect on packet loss ratio and packet delay.

CONFLICT OF INTEREST
The authors confirm that this article content has no conflict of interest.

Fig. ( 4
Fig. (4).PU call blocking probability relative to the call arrival rates of PUs and SUs.

Fig. ( 5
Fig.(5).SU call blocking probability relative to the call arrival rates of PUs and SUs.
Fig.(7).Packet delay relative to the call arrival rates of PUs and SUs.