Pre-phase Improvement For Distributed Spectrum Sensing in Cognitive Radio Networks

This paper considers a pre-phase of spectrum sensing in cognitive radio networks (CRNs), which is about how to choose a channel for spectrum sensing. We take the time dimension, spectrum dimension, and spacial dimension into account and propose a sense-in-order model. In this model, each node maintains four states regarding each channel, based on the neighbors’ shared information. We construct a state transition diagram for the four states and design an algorithm for every node to calculate the probability of choosing each channel. Extensive simulation results testify to the performance of our model. In addition, we conduct experiments on the USRP/Gnuradio testbed to prove the main part of the sense-in-order model with directional antennas. Experimental results show that the average success percentage under the settings of the testbed is above 70%.


Introduction
Cognitive radio networks (CRNs) [1] are the promising solution to the channel (spectrum) congestion problem nowadays.Primary users in CRNs are privileged users, whose transmissions should not be interfered with.Each node (secondary user) in a CRN is capable of sensing the available channels and can make opportunistic use of them without causing interference to primary users.During the process, one of the most important phases is spectrum sensing.
Spectrum sensing in CRNs is an important phase, in which secondary users determine if a channel is available.Lots of work has been done on how to achieve an accurate result through spectrum sensing [2][3][4][5][6][7][8].There are usually multiple channels in CRNs.However, each secondary user cannot sense all of the channels simultaneously.Therefore, each time a secondary user needs to find one channel for transmission, it will pick one channel for sensing.If the channel is unavailable, it needs to adjust its parameters and switch, as to sense another channel.For example, in Fig. 1, there is a pair of primary users, T X and RX.The secondary user u is in the interference range (the amoeba shape) of T X, which is using the channel m 1 to send data to RX.There is a total of three channels (m 1 , m 2 , m 3 ) in the network.If u needs to use one channel, it will pick one channel from the three channels.Since there are no differences among the three channels from u's point of view, it is possible that u will pick m 1 for sensing.Then, after u finds out that m 1 is unavailable based on the sensing results, it needs to switch to another channel and sense again.However, if u can have some information about the three channels before sensing, it may avoid m 1 and select other channels for sensing.To some extent, both the delay and the energy consumption can be reduced.
Our focus here is not the spectrum sensing technology itself.Instead, we consider how to choose a channel for sensing for each node at the beginning, so that the probability of switching to sense another channel is reduced.This is also called the pre-phase of spectrum sensing.We propose a sense-in-order (SIO) model, which provides each node with an order for spectrum sensing.The order is determined before the spectrum sensing, and is maintained in the form of a list by each node.When a node needs to find a channel for data transmission, it can look up the list and select a channel that has a higher probability of being available for sensing.In this way, each node knows the order in which to sense; this results in a reduction of switches among channels during spectrum sensing.
To determine the order of channels for sensing, both the space and time dimensions are considered.Firstly, the space factor influence lies in that nodes in a similar geographical area usually share similar channel information.One node can broadcast its sensing results to other nodes.Secondly, the time dimension is also very important, due to the dynamics of primary users.For each node, the channel information received more recently is more likely to be accurate.Based on the information from both dimensions, we identify four different states and their transitions for every channel, which are maintained on each node.Based on the states of different channels, each node is able to divide the whole channel into several different subsets.Each subset is assigned with a probability of being chosen.We also take conflict avoidance into account, since nodes in close locations are very likely to choose the same channel for sensing.
Most previous models in CRNs assume that the primary and secondary users transmit in all directions.In fact, with the developments regarding the directional antenna, more channel opportunities can be created if the angle dimension can be taken into account for spectrum sensing.This is because the primary and secondary users are able to share the same channel, even in the close geographical area.Therefore, based on the above SIO model, we propose a more complex model, in which each node is equipped with a four-directional antenna.
Aside from more channel opportunities, the usage of directional antennas also brings more challenges into our sense-in-order model.In our model, each node collects data from four directions.Since all of the directions are adjacent to each other, and the interference range of primary users may cover multiple directions simultaneously, a single node may receive different results about the same channel from one direction.We describe the problem that is brought about by directional antennas, and propose a methodology for each node, to determine the order of sensing in each direction.
To testify to our scheme, for the model with directional antennas, we conduct experiments using our USRP (universal software radio peripheral) testbed.We collect the data from our experiments and predict the channel availability for sensing in each direction, based on our scheme under a simplified model.We also implement a multi-hop topology and use the testbed to prove the performance of our SIO model.
The main contributions of our paper lie in the following aspects: • We propose an SIO model for the pre-phase of spectrum sensing, which determines the order of selecting channels to sense for each node, based on the information from both space and time dimensions.It can reduce the delay and energy cost during the spectrum sensing phase.
• We identify the possible states for every channel on each node and define the transition among the states, based on the signal that the node receives and the valid time period.
• We improve our model by taking the angle dimension into account.Both the opportunities and challenges brought about by directional antennas are presented.We make use of fourdirectional antennas and show how to determine the order for sensing on each direction.
• We collect data through our experiment, based on the USRP/Gnuradio platform.Using this data, we testify for the main part of our sense-inorder model that uses directional antenna and the multi-hop model.
The remainder of our paper is organized as follows: In Section 2, the related works are introduced.Section 3 is about our problem formulation.We describe our sense-in-order model in Section 4. The improved model that considers the angle dimension is presented in Section 5.The simulations are shown in Section 6.The experiment using USRP/Gnuradio regarding our model with directional antennas is described in Section 7. We conclude our paper in Section 8.

Related Works
Our related works section is made up of three parts.The first part is about the cooperation among secondary users during spectrum sensing in CRNs.The second part is about a recommendation-based system in CRNs.The third is about the applications that use directional antennas.
Cooperative sensing is studied in [2,[9][10][11].The main concept of cooperative sensing is that different secondary users share their sensing results to achieve a more accurate result about the spectrum availability.Their differences are about the fusion among different users' sensing results.[9] considers a soft combination of the observed energies based on the Neyman-Pearson criterion.An optimization scheme is proposed in [11], which uses a coordinator to make decisions.The above works focus on the spectrum sensing phase, which is based on the collaboration among different secondary users.Their key point lies in the fusion of different sensing results and the throughput optimization.However, our model is about how to select channels for sensing before the spectrum sensing phase, in order to reduce the costs of energy and delay.
A recommendation-based model is proposed in [12,13].The authors are inspired by the recommendation system for e-commerce, and they have each node recommend channels to other nodes for spectrum sensing.However, their model only considers the appearance of primary users in the recommended channels.In fact, channel availabilities depend not only on primary users, but also on secondary users.Our model considers four different situations in each channel, which reduces the amount of conflicts among secondary users.
Different antenna models have been proposed in wireless networks [14,15].They are mainly about the neighbor discovery scheme in wireless networks, where each node is equipped with directional antennas.In [14], the authors propose an efficient broadcasting scheme using directional antenna in ad hoc wireless networks.Their scheme is based on 2-hop neighborhood information, and does not rely on location or angle information.Authors in [15] propose an efficient neighbor discovery model, which relies neither on omnidirectional antennas, nor on time synchronization.The technologies of directional antennas are the preliminaries of our algorithm, and ensure that our sense-in-order model can be improved through directional antennas.

Problem Statement
In this section, we first describe the background and motivation of our problem.Then we formulate our problem by defining our objective and constraints.

Background and Motivation
There are usually multiple channels in CRNs.Due to the unpredictability of primary user activities, the availability of each channel is dynamic.Because secondary users need to be able to make opportunistic use of the channels, spectrum sensing is one of the most important phases.Specifically, before transmission, nodes in CRNs need to find an available channel to access at that time.Therefore, one problem arises: which channel should be selected for sensing first?If the node happens to select a channel that is occupied by primary users for sensing, then it needs to switch to another channel and repeat the sensing again.Since switching from one channel to another channel for sensing consumes energy and also increases the delay, it is very important for each node to know which channels are more likely to be available, so that the number of switches in spectrum sensing can be reduced.
Since nodes within the close area face a similar channel situation, we consider having each node share its known channel availability information with its neighbors.These neighbors can make use of the shared information, and thus may have a preference for some channel when they need to pick one channel for sensing.For example, in Fig. 1, the two primary users, T X and RX, are in a session.The three secondary users, u, v, and w, are unable to use the channel that is occupied by the primary users.When u needs to transmit before v and w, it will sense the channel availability.If u can share its sensing results with v and w, v and w may avoid sensing the unavailable channels later when they need to transmit because of u's information.In the remainder of the paper, we use u to denote any node that shares the sensing results, and v to denote any node that needs to pick up a channel for transmission.
Besides, there are two more factors that influence the effects of the sensing results shared by other nodes: • Valid time duration: The pattern of primary users' active sessions is random, which contributes to the dynamics of the channel availabilities.Therefore, after a time period, the sensing results shared by other nodes may be invalid, e.g., some previously available channels become unavailable.Thus, there should be a valid time duration for the shared sensing results.
• Interference by secondary users: Besides the influence from primary users, the interference caused by secondary users is also inevitable.For a secondary user, although some channels are free from primary users, they may still be unavailable if they are occupied by other secondary users nearby.Thus, during the sensing phase, secondary users should also try to avoid sensing the channels that are occupied by other secondary users.
Therefore, to build the order of channels for sensing on each node, the space and time domain factors should be considered.Also, the influences of both primary and secondary users should be considered separately.

Problem Formulation
We consider a CRN with N nodes and M channels.There is a set of primary users whose active patterns are random.When a primary user is active, nodes in its interference range are unable to use the channel that is occupied by the primary user.We assume that there is a common control channel (CCC) in the network, which is used by secondary users to share the sensing results.Each node does not sense the channel until it needs to find a channel for transmission.Also, we assume that the sensing results of each node are accurate.To identify the different sensing results, we have the following two definitions: Definition 1.A channel is sensed as available if and only if it is neither occupied by primary users, nor secondary users.
When the channel is sensed as available, the secondary users can access the channel and use that for transmission.Otherwise, secondary users need to switch to another channel for sensing, which costs more energy and delay.We assume that the delay and energy cost of each switch from one channel to another channel for sensing is a constant.Therefore, we can use the following counter to identify the cost.Definition 2. The cost C v of each node v (v ∈ N ) during the spectrum sensing phase is calculated as the number of switches among channels that are needed until an available one is found.
The goal of our model is to provide an order of channels for sensing so that the cost during the spectrum sensing phase is minimized.The objective can be written as: To achieve the above goal, different channel situations need to be considered.The potential conflict issues among secondary users also must be taken into account.Next, we present our sense-in-order model and discuss our solution.

Sense-in-order Model
In this section, we first introduce the state transition diagram for every channel on each node.Then, we describe how to determine the sensing order among different channels for each node, based on their states.We also show the performance of our algorithm by discussing the conflict issues and by giving some analysis regarding our algorithm parameters.

Construct State Transition Diagram
As we discussed in Section 3, the influences of both primary users and secondary users need to be considered when sorting the channel order for sensing.For each channel m (m ∈ M), its unavailability may be because it is either occupied by primary users or secondary users.If m is occupied by node u, then it is possible for other nodes to know when u is finished using channel m, since u is able to broadcast related information through the CCC.However, if m is occupied by primary users, nodes in N are unable to know when m is available again.This is because under many real situations, due to the security and performance issues, primary users would not like to communicate with secondary users.
In our model, each node broadcasts its sensing results through the CCC, which is about whether or not one channel is occupied by primary users.Based on our assumptions in Section 3, each node does not sense the channel until it needs a channel for transmission.Thus, if the node finds an available channel, it will access that channel.It will also broadcast when it accesses, and when it quits, that channel to other nodes.This can be done by broadcasting different signals over the CCC.We give the three following types of signals that can be sent by a node u: • P O m : channel m is occupied by primary users; • SO m : channel m is free from primary users but is occupied by the secondary user who sent this signal; • SF m : Secondary user finishes transmission and quits from channel m.
To simplify our model, we assume that there is no loss of the signal transmission over the CCC.If channel m is occupied by secondary users, node u will avoid sensing that channel since SO m was received previously by u until the SF m was received.Based on the received signals, a node v is able to identify four different states, S = {S i , 1 ≤ i ≤ 4}, for a channel m.We use < S i , m > to indicate that channel m is in state S i : • < S 1 , m >: m is occupied by primary users; • < S 2 , m >: m is not occupied by primary users, but is occupied by the secondary user: • < S 3 , m >: the secondary user previously using m has finished transmission and has quit from m; • < S 4 , m >: no signal is received about m.
The above four states are maintained on node v itself.For < S 1 , m >, node v is not sure about whether the primary users have finished transmission on m if no other sensing results are received from other nodes.For < S 2 , m >, node v should avoid sensing m until v receives the signal SF m .For < S 3 , m >, node v should assign higher probabilities for selecting m to sense.For < S 4 , m >, v is not sure about the availability of m, either.
Besides, the weight of each signal's accuracy should consider the following two aspects: • spacial domain: The channel state information that is received from the closer area is more accurate.Therefore, the channel state information that is sensed by the node itself is usually more reliable than the information shared by others.
• time domain: The message that has been received more recently is usually more accurate.This is due to the dynamics of primary users' and secondary users' activities.Some channels that were available in the previous time slot may possibly become unavailable in the next time slot.
In our model, each node only collects one-hop neighbors' information, and updates the channel states.Since the interference area of a primary user is usually much larger than that of a secondary user, nodes within one-hop distance may very possibly share similar information.This is normally true in real life scenarios.Therefore, there is no need to distinguish the weight of the information shared by a node's neighbors, based on their distance to this node.In our simulation, we will study the influence of spacial factors.
The time domain matters more than the spacial domain.Firstly, as we explained above, the information that has been received more recently is more reliable.The channel state should be updated according to the most recently received information about that channel.Secondly, the channel states may vary without being known by any node.For example, node v identifies channel m as state S 1 .However, after a time period, the primary users finish using m, which is unknown by v. Therefore, we add a valid time period T for S 1 , S 2 , and S 3 .If no signal is received about channel m during T , node v will change from < S 1 , m >, < S 2 , m >, or < S 3 , m > to < S 4 , m >.
The state transition diagram among different S i of a single channel m maintained on node v is shown in Fig. 2. The initial state of each channel is S 4 .A state transition occurs when a signal from another node is received, or the valid time period T expires.Each node maintains a state identification for each channel, and updates the state based on Fig. 2. Each state is updated based on the most recent signal in the time domain.Since primary users have higher privileges on each channel, P O m could be received no matter what the previous state was.State S 3 can only be reached from S 2 , since we assume that there is no packet loss.Each node will mark the channel as S 2 after receiving SO m , and will not update the state as S 3 or S 4 before SF m is received.Thus, there is no valid time expiration issue for state S 2 .

Sort Sensing Order
Since each node stores the state for every channel, it now can define preferences for different channels when it needs to select one channel for sensing.
Firstly, every node divides the whole channel set into four (at most) different subsets, based on the state of each channel.For node v, the whole channel set M is divided into four subsets ), channel m is identified as state S i by node v. Next, we define the order or probability of each subset being chosen.Here, the probability of a subset being chosen equals the sum of the probability that any channel in that subset will be chosen.Definition 3. The probability of M v (S i ) being chosen is: where: |M v (S i )| denotes the number of channels in M v (S i ). ( 2) means that the channels identified as state S 2 will not be chosen for sensing.This is because these channels are definitely unavailable, according to the discussions in previous sections.The relationships in (3) are due to the fact that channels on state S 3 are more likely to be available than channels on S 1 and S 4 .W i is the weight assigned for choosing each channel set M v (S i ).This means that, although a channel is sensed to be occupied by primary users, it is still possible that it is available when sensed by node v, since primary users at that time may finish a transmission.(4) ensures that For different channels in M v (S 4 ), the probability of each one being chosen is the same.For different channels in M v (S 1 ) and M v (S 3 ), the probability of a single channel m being chosen should also be related to the amount of time that m has been in that set.The longer that m has been in M v (S 1 ) or M v (S 3 ), the less accurate that the state of m will be.Node v maintains a time duration, t m , to indicate how long m has been in that sate.Then we define the probability that a single channel m will be chosen: .
For a channel m ∈ M v (S 1 ), a longer t m means that m is more likely to be available, since primary users have a higher probability of finishing with m.For a channel m ∈ M v (S 3 ), a smaller t m indicates that m has a higher probability of being available.When t m grows larger, it is more possible that m may be taken by primary users without notifying node v.
Algorithm 1 is for a node v to define the order of channels for sensing.Node v keeps overhearing the CCC and monitoring if T m expires for each m.When v needs to select a channel for sensing, it first decides which subset M v (S i ) is to choose.Then, from the selected M v (S i ), it chooses the channel for sensing.This maintains the priorities among different M v (S i ), which are stated above.Also, since ∑ m∈M p m v = 1, there is always one channel that can be chosen when a node senses the channel.
We now take a toy example to illustrate how to calculate the probability.Suppose that there are 3 total channels, {CH1, CH2, CH3}.For node v, the state of each channel has been updated based on the above state transition diagram.Assume that M v (S 1 ) = {CH1} and M v (S 3 ) = {CH2, CH3}.Suppose that T − t CH2 = 1 and T − t CH3 = 2. Set W 4 /W 1 = 1.5 and W 3 /W 4 = 2.Then, based on equation (4), we can get W 1 = 3  7 and W 3 = 9 7 .Therefore, P v (S 1 ) = 1 7 and P v (S 3 ) = 6  7 .Finally, the probabilities of choosing each channel for sensing are:

Some Analysis
We first discuss the performance of our model by considering the possible conflict issues.Since nodes in Algorithm 1 Order of channels for sensing 1: while v is in the network do 2: if a signal about m is received over CCC | T m expires then

3:
Update the state for m based on Fig.  if v needs to transmit then 5: pick the set M v (S i ) based on P v (S i ) 6: pick a channel m ∈ M v (S i ) based on p m v a close area maintain similar states for each channel, when multiple nodes among them need to pick a channel for sensing at the same time, it is very possible for them to choose the same channel.However, in our model, the likelihood of conflicts occurring can be reduced by adjusting W i in the expression of P v (S i ).If conflicts happen more often when choosing channels from M v (S i ), the W i is reduced, which on the other hand, may reduce the channel utilization as well.Our scheme does not ensure optimal values of W i .We will show the effects of adjusting W i on the whole cost in our simulation.The probability of each channel being chosen by a node v is not only determined by W i , but is also determined by the number of channels in the same state, |M v (S i )|.Therefore, it is not always true that the probability of the set of channels in state S 3 being chosen is higher than the set of channels in S 1 or S 4 .This is compatible with the real situation.For example, when no channel is in state S 3 , the probability of choosing channels from set M v (S 3 ) should be 0.However, when the number of channels in each state is equal, channels in M v (S 3 ) are more likely to be chosen than channels in other states.
Besides, we are unable to predefine the values of W 1 , W 2 , and W 3 , due to the limitations of equations ( 3) and (4).However, the relationship among them can be defined.Each node can then calculate the probability for each channel dynamically, as shown in the above example.

Improved Model with Directional Antenna
One of the previous assumptions is that all users, (i.e., primary users and secondary users,) transmit in all directions.However, with recent developments in the technology of directional antenna, multiple users can be multiplexed into the same channel at the same time in the same geographical area.In this improved model, we add one dimension to our model, which is the angle dimension.
We consider a model in which each secondary user is equipped with a directional antenna that is able to work in four different directions.We assume that each node can send over one direction, while overhearing from four directions through the CCC on one channel.
As shown in Fig. 3, there are two primary users, TX and RX, who are active and occupy a channel.The secondary users, u, v, and w, are located in the interference area of the primary users.Instead of being unable to use the channel that is occupied by the two primary users, with the directional antennas, they are now able to use that channel from one of the four directions.Therefore, the channel availabilities are improved for each secondary user.
Along with the more channel opportunities, the introduction of the angle dimension also brings problems to our sense-in-order model.Next, we focus on how to determine whether one channel is available in one direction, based on the information provided by neighbors.For any state S i , S i ∈ S, we use 1 to denote that S i is true and 0 to denote that S i is false on each direction for every channel.The above state transition diagram can be easily extended here, by adding two substates for each S i and corresponding signals on each direction.Here, we concentrate on how to determine if a single state S i is true or false for each direction.
For a single node, if it receives a signal of a state in one channel, the node will set the state of that channel to 1. Otherwise, it will set it to 0. We use aaaa to denote whether a state is true in four quadrants.Each quadrant denotes a direction.Obviously, a = 0 or 1.The problem is that, for a single state, it is possible that one node can have 16 different sequences from four directions in regarding to the same channel.For example, 1110, 0011, etc.This is because each direction is adjacent to another, while the interference area may cover part of multiple directions together.Nodes at different positions each direction may broadcast different signals simultaneously.When one node hears different sequences within a close time period, it may be difficult to decide which direction is available.For example, node v may receive 1110, 1100, 0100, or 0110, regarding a single state on the same channel at the same time from four directions.This is because some of v's neighbors are in the interference area, while some are outside the area.However, in this example, node v can decide from the sequences that the second quadrant is true for the current state, and the fourth quadrant is more likely to be false, since all sequences contain 1 for the second quadrant and 0 for the fourth quadrant.
The method we use here is a weight-based scheme, which considers both the number of signals received, and the time at which the signal was received.As we explained before, the signal that has been received more recently is more accurate.We use T T to denote the time period since receiving the signal 1, and T F to denote the period since receiving the signal 0, on each direction regarding each state.We also define a valid time period, T ′ , for each signal.Signals received before T ′ will be ignored.Then, each node is able to calculate the probability of a state being true or false on each direction for one channel, by using the following equation: .
Since P T + P F = 1, each node determines that a state is true on one direction for one channel if P T > 0.5, and false if P F ≥ 0.5.After the state is decided, the previous sense-in-order model can be applied for each direction.We will testify for this performance through conducting an experiment based on the USRP/Gnuradio platform.

Simulations
In this section, we present our simulations for our model.We first introduce the parameter settings and give the performance metrics for comparison.Then, we show the simulation results from different aspects.

Simulation Settings
We randomly generate a number of nodes which make up a one-hop network.Each node is able to overhear messages along the CCC, and can also broadcast to all other nodes.Each node gets a randomly received session request, and stays in that session for several time slots.For a node, when a session request comes, it needs to pick a channel to sense.Also, we generate a number of primary users who randomly become active at some time slots.A channel is unavailable when it is occupied by a primary user or a secondary user.The simulation setting parameters are shown in Table 1.There are two sets of parameters.One is the network parameters.Another set is the algorithm parameters.We will describe them separately.
The network parameters contain the number of nodes, the number of total channels, the number    of primary users, and the active session duration of both primary users and secondary users.In the following parts, we evaluate the performance of our model through varying the three parameters (number of nodes, number of channels, and number of primary users).The range of active session durations for primary users and secondary users is shown in Table 1.The time duration of primary users' sessions is longer than that of secondary users' sessions.For a secondary user that is active in transmission, if a nearby primary user appears and takes up that channel, it needs to interrupt the current transmission, broadcast the corresponding channel state to other nodes, and pick another channel to sense.
The algorithm parameters include the settings of W i , i = {1, 2, 3, 4}.As discussed in the above section, we can define the relationships among them.In our simulation, we vary the values of W 3 /W 4 and W 4 /W 1 (W 2 = 0), and we compare the influences on the performance.Also, by having the values of W 3 /W 4 and W 4 /W 1 , each node is able to calculate W i , i = {1, 2, 3, 4} easily using linear equations.
Considering that the objective of our model is to minimize the number of switches among channels during spectrum sensing according to Definition 1, we measure the performance of our model using the success percentage, which is defined as the ratio between the number of times that available channels are sensed, and the total number of times that we attempt to sense channels.
To better evaluate our algorithm, we also implement two other algorithms: • The basic algorithm: SIO-SO(sense-in-order model with self information considered only).Specifically, nodes running SIO-SO do not share their sensed channel information among neighbors.Each node only uses its sensed channel information and history to decide each channel's state.• The self weighted more algorithm: SIO-SC (sensein-order model with self information weighted more).The SIO-SC takes the spacial factor into consideration.Each node running SIO-SC assigns more weight to the channel information sensed by itself, since it is one that is "closest" to itself.We assign a valid time window for each node's own sensed channel state, denoted as T SC , where T SC < T .Any signal received from its neighbors within T SC regarding the same channel state information would be ignored.If any signal is received between T SC and T , the channel state would be updated according to the received signal.If no signal received before T expires, the channel state would return to S 4 , which is the same as our sense-in-order model.Therefore, SIO-SC is the same as SIO without antenna when T SC = 0.
We compare the success percentage among four algorithms, SIO with antenna, SIO without antenna, SIO-SC, and SIO-SO.The simulation results are presented in the next part.

Simulation Results
We first compare the four algorithms, SIO with Antenna, SIO without Antenna, SIO-SC and SIO-SO.We vary the three network parameters (number of nodes, number of channels, and number of primary users) and calculate the average success percentage in the whole network.T SC for SIO-SC is set as 10.The results are shown in Fig. 4. We can tell that the SIO with antenna model achieves the best performance, while the SIO-SO is the worst one.This proves that the channel opportunities still increase when secondary users are equipped with directional antennas.Also, in Fig. 4(a), the performances of all four algorithms increase when the channel number increases.In Fig. 4(b), when the number of nodes increases, the performance of all four algorithms is lowered.This is because the number of session requests increases as the nodes increases, which would result in a decrease in the channel opportunities.In Fig. 4(c), the performances of all four algorithms decrease when the number of primary users increases.For a better comparison, we also study the performance differences between the SIO without antenna model and the SIO-SO scheme over a time period.The SIO with antenna scheme has a similar trend as the one without antenna, which is not shown here.We vary the number of primary users and record the success percentage along a time duration.The results are in Fig. 5.It shows that when the primary users become fewer, the performances of both schemes increase.However, the performance of the SIO-SO scheme increases more slowly than our model.For a constant number of primary users, over a time period, the performance of the SIO-SO scheme does not change too much, while our scheme increases.This is because, as time goes by, the information collected by each node about the channel availabilities becomes more accurate.Nodes are more likely to choose the available channels for sensing.
The influence of T SC on SIO-SC is studied in Fig. 6.The performances of both algorithms decrease as the primary users become more.When T SC = 0, the two algorithms have the same success percentage.When the value of T SC increases, the gap between the two algorithms increases.Therefore, under the network settings, updating channel states based on neighbors' instant information provides a better performance, which also proves that the time factor influences more than the spacial factor.
The influences of the algorithm parameters are shown in Fig. 7.The SIO with antenna is not shown here due to the same reason as above.We calculate the success percentage at different time slots when running the simulation.In Fig. 7(a), the value of W 3 /W 4 is set as a constant 2.5, while the value of W 4 /W 1 varies in {1.5, 2, 2.5}.It shows that when the time increases, the performances of the three settings become better.However, at the beginning phases, the W 4 /W 1 = 2.5 achieves the best result.As time goes by, at time slot 20, the W 4 /W 1 = 1.5 is the best among the three.In Fig. 7(b), the the value of W 3 /W 4 varies in {2, 2.5, 3}, while the value of W 4 /W 1 is set as a constant 2. The performances of the three settings are better when the time slot increases.Besides, the performance of the setting W 3 /W 4 = 3 performs the best at the initial phases when the time slot is 10.The performance of the setting W 3 /W 4 = 2.5 exceeds the setting W 3 /W 4 = 3 when the time slot is 20.

Experiments
We conduct experiments using USRP/Gnuradio to testify for both our directional antenna model and the multi-hop SIO without antenna model.The equipments we use are USRPN200s.

Directional Antenna Model
For our directional antenna model, we conduct a real and simplified experiment for each node to determine whether a state is true or false on one channel in each direction.
We put four USRPN200s in each quadrant as a one-hop neighbor for a virtual node, and one more USRPN200 to simulate a primary user, as shown in Fig. 8.We simplify our SIO model and only test whether the state S 1 is true or false for each channel.Each node only senses the channel when a session request comes, and does not really occupy that channel for transmission.We control the coming session requests to be relatively frequent, so that each node senses channels frequently.Therefore, no other states exist in our simplified experiment here besides S 1 .We only need to determine whether state S 1 is true or false for the virtual node.There are five channels in our settings (1.2996GHz, 1.2998GHz, 1.3GHz, 1.3002GHz, 1.3004GHz).The primary user follows a random active pattern.We manually change the location of the primary user, while the positions of the four secondary users are constant.One of the active patterns that we generated in 60s is shown in Fig. 9.Each secondary user overhears the channel availabilities when it becomes active.The active pattern for each secondary user is also random.An active secondary user only senses the availability of its selected channel, and does not transmit real data to other nodes.We collect the sensing results and the time slot at which the sensing results are sent.We assign each secondary user an ID (1∼4), and denote each quadrant.We set the valid time period T ′ in Section 5 as 20s here.When a primary user is detected, the frequency diagram on the secondary user is shown in Fig. 11 (we only show three frequency diagrams as examples here).Besides the channel availability, each secondary user also records the time slot at which the corresponding spectrum sensing happens.
We collect data from four secondary users and generate a set of random accessing requests for a virtual node who is assumed to receive these sensing results.When a session request comes, we use the collected data for calculation and choose a channel for sensing .We collect whether the picked channel is available over a time duration, and calculate the probability of the chosen channel being available.The result is shown in Fig. 10.To better show the trend of the results, we apply regressions on the four lines, which are the success percentages in four quadrants.Although they are not stable, they are always above 0.7, which is a high success percentage.

Multi-hop Model
For the multi-hop model, we place five USRPN200s to construct a multi-hop topology, as shown in Fig. 12.Four USRPs are SUs, and the remaining one is the primary user.To show the influences on the sensing results caused by nodes at different positions, we keep the primary user busy, and collect the sensing results on frequency 1.2996GHz over a constant time.We set the gain as 35, and record the amplitude.The sensing results are shown in Fig. 13.The four lines denote the four nodes with different distances(ft) to the primary user.In our following experiment, if the amplitude of a channel sensed by a node is less than -70dB, the node would mark that channel as available.We generate the active session sequences for each node.Then we apply the algorithm of the SIO without the antenna model.Similar to the above subsection, there are a total of 5 channels in our settings.Again, we calculate the success percentage, compared to each node.The results are shown in Fig. 14.The two nodes that are 12 and 14 ft.away from the primary user have higher success percentages than the two nodes that are 3 and 6 ft.away from the primary user.This is because of the interference caused by both the primary user and secondary users.Also, the success percentage increases as the time increases, which testifies to the performance of our algorithm.

Conclusion
In this paper, we focus on how to choose a channel for sensing for each node in cognitive radio networks (CRNs).We propose an SIO model for the pre-phase of spectrum sensing.Each node maintains four different states for each channel.We construct a state transition diagram and a corresponding algorithm for each node to calculate the probability of each channel being chosen for sensing.We also extend our SIO model by adding the angle dimension.Each node is equipped with a four-directional antenna, which increases the channel opportunities.A weight-based scheme is proposed to determine whether a state is true for one channel in each direction.We perform extensive simulations to show the performance of our model.We study the influence of the network parameters and our algorithm parameters.We also implement two other algorithms for a better comparison.The simulation results show that our model outperforms others.Moreover, we conduct a real experiment using USRP/Gnuradio to testify for our weight-based scheme in the model with directional antennas, and also the multi-hop model.The results show the high success percentage of our scheme.

Figure 1 .
Figure 1.Sense-in-order can reduce delay and save energy.

Figure 4 .
Figure 4. Comparison of success percentage when varying network settings.

4 Figure 7 .
Figure 7.Comparison of success percentage when varying algorithm settings.

FigureFigure 6 .
Figure Study the influence of time.

Figure 11 .
Figure 11.Primary signals are detected on three channels.