Abstract
Spectrum sharing fairness is an important topic in cognitive radio ad hoc networks (CRAHNs) and cognitive radio sensor networks (CRSNs). Consensus-based protocols can provide light-weight and efficient solutions for CRAHNs and CRSNs but the theoretical ground needs to be investigated for spectrum sharing fairness. In this paper, we investigate the convergence condition when applying a consensus-based protocol to spectrum sharing while ensuring spectrum sharing fairness. Based on the local observation and local control scheme using spectrum-related information, an individual cognitive node can effectively perform the spectrum sharing. Then we propose a consensus-based protocol for spectrum sharing. Supported with computer simulation results, we show the effectiveness of using the proposed consensus-based protocol to solve the spectrum sharing problems in CRAHNs and CRSNs.
1. Introduction
As a result of the development of cognitive radio (CR) technology, the concept of cognitive radio ad hoc networks (CRAHNs) has been proposed in 2009 [1]. A CRAHN is essentially an ad hoc network composed by CR nodes (or CRs) and primary users (PUs) applying the cognitive radio technology in CR transceivers. As such, the CRs in CRAHNs do not favor central coordination when performing spectrum sharing processes. Instead, CRs have to perform local observation most of the time. With the same concept, the cognitive radio sensor network (CRSN) [2] was coined out in 2009, where each sensor node in a CRSN can be considered as a CR with limited hardware and capability to obtain surrounding information.
As an important research topic in CRAHNs and CRSNs, spectrum sharing schemes have to perform spectrum allocation based on local observations, while ensuring fairness in these schemes. Without keeping fairness, the network may suffer from uneven spectrum allocation to the CRs, subject to the frequent link disconnections during data communications. As such, an important problem in spectrum sharing is how to ensure the fairness of spectrum allocation using local observation and local decision.
In this paper, we explore how to use the consensus protocol to address spectrum sharing fairness in CRAHNs and CRSNs. We will first introduce the concept of local control schemes, by which a CR can locally perform spectrum sharing process with sensing inputs and decision outputs. Then we define and analyze the spectrum sharing fairness issue in CRAHNs. Based on this analysis, we propose a consensus-based protocol to perform the spectrum sharing process, which can address the defined fairness issue.
The remainder of the paper is organized as follows: in Section 2, we discuss the related work in the literature; in Section 3, we mainly discuss the local control scheme for spectrum sharing; Section 4 gives an analytical model for the defined fairness concept; in Section 5, we propose a consensus-based communication protocol for CRAHNs and CRSNs and perform simulation-based analysis; Section 6 concludes the paper and discusses future work.
2. Related Work
A CRANH is a network composed by CRs and PUs in an ad hoc manner in a changing radio environment induced by time, location, and PU activities. In order to ensure successful data transmissions, spectrum resource needs to be properly shared. As such, with a spectrum sharing module, a CR is able to share spectrum resources among CRs [1]. As an example of a CRAHN shown in Figure 1(a), the CRs are colocated with PUs. PUs and CRs are able to move. In order to make CRs aware of the available spectrum bands, the spectrum sharing module in each CR is running so that changing spectrum resources in a region can be shared with CRs. Similarly, a CRSN needs the spectrum sharing module to ensure spectrum resources available to sensor nodes (SNs) as shown in Figure 1(b). Besides, if we consider a spectrum sharing scheme, we need to choose a spectrum sharing model. There are two competing models of spectrum sharing [3]: (1) sharing among equals and (2) sharing between licensed primary and secondary, where the former can be considered as the underlay technique and the latter can be considered as the overlay technique (i.e., a CR does not use the spectrum bands occupied by the PUs). We adopt the latter throughout the paper.

An example of (a) a CRAHN and (b) a CRSN.
2.1. Spectrum Sharing Schemes Based on Local Control
Because CRAHNs and CRSNs favor local observations, we assume that each CR performs a so-called local control scheme. A local control scheme allows a CR to use information from local observations in order to make spectrum sharing decisions. A local control scheme is expected to perform distributed operations for CRs in a control system model (which will be discussed later). Each CR in the CRAHN runs a local control scheme with sensing inputs and decision outputs for spectrum sharing.
There are several schemes or algorithms related to local control schemes that have been proposed in the literature. A graph coloring-based scheme has been proposed in [4]. This scheme is essentially a global optimization algorithm, which is centralized in nature and is required to be recomputed whenever there is a change in the network. Compared to a centralized scheme, a distributed scheme is more suitable for a CRAHN and a CRSN due to its robustness in varying radio environments (e.g., topology and spectrum availability, etc.). A distributed spectrum allocation scheme, referred to as local bargaining, has been proposed in [5], where CRs can self-organize and form a local group to improve a system utility. Results in [5] show that the communication overhead using local bargaining can be significantly reduced compared to a greedy coloring algorithm. However, the local bargaining scheme relies on coordination, so frequent communication efforts to exchange coordination message are required. A device-centric spectrum access approach for the spectrum allocation problem is introduced in [6], where five different rules are applied to individual CRs. These rules are slightly inferior to local bargaining [5], but they have lower computational complexity and communication overhead.
Swarm intelligence algorithms have been proposed in the literature to solve spectrum sharing problems. In [7], a spectrum sharing problem is solved by an insect colony-based algorithm. In [8], an algorithm based on the schooling mechanism of fish is proposed to solve the spectrum sharing problem. However, both papers do not give a formal proof for the convergence condition, which is important when applying swarm intelligence algorithms to spectrum sharing issues.
Swarm intelligence algorithms belong to a more general class of protocols, called consensus protocols, which are inspired by observing the flocking or schooling phenomenon in nature. In fact, consensus protocols have been used for data fusion in sensor networks, robotic control, and multiagent systems (MASs). Li et al. [9] have applied the consensus protocol to spectrum sensing in order to control the fusion of sensing data.
The above references have given hints of how to use consensus protocols in CRNs, but they hardly address spectrum sharing fairness in CRAHNs and CRSNs. In this paper, we will formulate the convergence condition when applying a general consensus protocol, which is necessary to theoretically show the applicability of consensus protocols in spectrum sharing for CRAHNs and CRSNs. Moreover, we will discuss how to use the consensus protocol to address the spectrum sharing fairness.
2.2. Applicability of a Local Control Scheme in CRAHNs, CRSNs, and Sensor Networks for CRAHNs
We discuss how to apply a local control scheme in these types of networks due to the characteristics of the CRAHNs, CRSNs, and sensor networks for CRAHNs.
Compared to classical ad hoc networks, CRAHNs are able to deal with the problems caused by changing radio environment and to protect licensed user's transmissions. Compared to classical cognitive radio networks (CRNs), CRAHN inherits some important features from ad hoc networks, such as node mobility, hop-by-hop spectrum availability, and unidirectional links. Other features in CRAHNs include spectrum-dependent links, topology control, multichannel transmission, and spectrum mobility, implying more challenges than those in either classical CRNs or ad hoc networks. Due to the lack of central network entities in CRAHNs [10], each CR node necessitates that all spectrum-related CR capabilities and distributed operations must be based mostly on local observations.
In CRSNs, each cognitive sensor node has cognitive capability and the network is usually intensively deployed with colocated PUs. Therefore, this type of networks inherits the similar cognitive modules as those in CRAHNs. A CRSN can use similar local control schemes in the spectrum sharing module. A CRSN, which has limited coverage and power supply, can be considered as the extension of a CRAHN, so the local control schemes can be applied to CRSNs.
Moreover, a local control scheme is suitable for another network paradigm called sensor networks for CRAHNs, where sensor nodes are aided for cognitive actuation. With local observation and local knowledge, sensor nodes perform the collective behavior for spectrum sharing, monitoring, and decision. The enabling technology for this network, called sensor network-aided cognitive radio, is discussed in [11]. As the local control scheme on sensor nodes in this network is very similar to the CRs in a CRAHN, we will not give detailed discussion for this network in this paper.
Based on the aforementioned discussion, we see that CRAHN is a more general network prototype than the sensor network for CRAHNs or the CRSN, and a local control scheme for CRAHNs is applicable to CRSNs. Therefore, we will focus on how the local control scheme can be applied to CRAHNs.
3. Revisit of Spectrum Sharing in the Perspective of Local Control Schemes
3.1. Radio Environment
The radio environment in CRAHNs and CRSNs is subject to change from time to time, which is the major problem for the spectrum sharing function. Typically, a change of radio environment can be caused by
PU activities; interference during communications; spatial-temporal characteristics of radio signals.
In this paper, we only consider the first two factors.
As an example, Figure 2 shows that CRs are deployed in an area with a changing radio environment. Each CR senses and observes the local radio environment. When CRs request the spectrum bands occupied by PUs, they need to invoke local control to share spectrum resources. A natural question one may raise is “how the local control for spectrum sharing can be performed by using local observation?” In order to answer the question, we introduce a block diagram to present a local control scheme, in which each CR will run for a spectrum sharing process.

A CRAHN deployed in a radio environment.
3.2. The Framework of Local Control Schemes
In Figure 3, a local control scheme framework can be represented in a block diagram. In this block diagram, when a CR receives a sensing input from sensors (e.g., a spectrum sensor or a global positioning system device, etc.), together with feedback information, a CR will process the information and make a spectrum sharing decision. At the sensing input, due to the different sensing capabilities, a CR may have comprehensive, partial, or strictly limited sensing information. At the junction of sensing input and feedback, we can adopt arbitrary types of combinations, where we use the symbol “

Framework of a local control scheme.
To give an example for the aforementioned framework, we can consider a local control scheme in each CR in a CRAHN where each CR only takes the local information as sensing inputs, such as the network-related information and spectrum information from neighbors. After running a process for spectrum sharing functions in the local control scheme, a CR will make a decision of what spectrum bands to use based on the available spectrum resources. We will show a more detailed example in Section 5.
4. Fairness in Spectrum Sharing
Definition 1 (fairness).
The spectrum resource allocation is fair to each CR at time t if the available spectrum resources at time t are evenly distributed among CRs.
In this paper, we mainly consider the available spectrum bands as a spectrum resource requiring fairness. The fairness of spectrum sharing is important as (1) it can help ensure equal communication opportunity for each CR; (2) it best responds to the changing radio environment in terms of available spectrum bands.
In order to achieve fairness by local observation, each CR tries to achieve fairness by considering the number of available spectrum bands of surrounding neighbors. In order to achieve this goal, we propose to use a consensus feedback in the local control scheme, which can be mathematically formulated in the following.
Suppose the CRAHN or CRSN can be represented by a graph
With the aforementioned notations, in order to measure fairness, we use the following expression:
From (1), the fairness can be ensured if we can make sure that the number of spectrum bands is evenly distributed among CRs. However, since the CRAHN performs hop-by-hop communication, a one-hop time delay τ is inevitable when receiving the information of spectrum availability from immediate neighbors. Then, (1) can be transformed as
In fact, the challenge of using the consensus protocol is to make sure the domain of
Proposition 2.
Suppose
Proof.
The discrete consensus protocol can make sure to reach the average
From the mapping function
As there are some cases that not all the CRs have the same spectrum bands, that is, different groups of nodes have different degrees of fairness, while the degree of fairness needs to be defined to reflect the case.
Definition 3 (degree of fairness).
We refer the value of consensus feedback as a degree of fairness for a node, which is defined as
Definition 4 (fairness group).
A set of CRs with the same degree of fairness is called a fairness group (FG), that is, group i and group j are in the same fairness group, if
The concept of fairness group is useful when describing the heterogeneous nodes that require different spectrum bands. Moreover, the concept can be used to virtually divide a large-scale network into different groups with different degrees of fairness.
In order to show the stability shown in Proposition 2, we can see in Figure 4, by using Nyquist criterion, the two Nyquist plots on the top show the fairness solution for spectrum sharing is stable, as we can see that the point (−1, j0) is not encircled. However, the Nyquist plot at the bottom of Figure 4 shows the spectrum fairness solution for spectrum sharing is unstable. If the time delay of the links is beyond the maximum value, the system is unstable. In other words, if the hop-by-hop time delay in a CRAHN is over the maximum value, the fairness cannot be guaranteed.

Analytical results for stability when using the consensus-based feedback. Nyquist plots with different time delays τ and with maximum degree of three in the CRAHN.
5. Protocol Design and Experimental Results
5.1. System Model
In this section, we will mainly perform computer simulations to show the convergence performance of the local control scheme without a consensus feedback and with a consensus feedback for spectrum sharing in CRAHNs. The general system model for computer simulations is based on Figures 2 and 3, where each CR performs a local control scheme in a CRAHN. CRs will use a common control channel to communicate with each other for the information of spectrum availability. Moreover, we will focus on the spectrum allocation performance and convergence performance of the local control scheme, while other analysis like throughput analysis is beyond the scope of this paper.
In order to evaluate an open-loop local control scheme (i.e., the local control scheme without a consensus feedback), we use a grid topology in the CRAHN with the number of node, M, where each CR is denoted by the row number and column number in a grid network, that is,
Figure 5 shows the results of the abovementioned open-loop local control scheme in different scenarios, where the spectrum utilization results can reflect the convergence performance of the scheme and the results are smoothed every 20 iterations. The spectrum utilization is defined as the ratio of already allocated spectrum bands to a CR and the total available spectrum bands to a CR. From Figure 5, we can see that, although the spectrum bands are randomly selected based on the neighbor's spectrum availability and the parameter λ, the spectrum utilization can show a certain pattern. By changing the value of λ from 1.0 to 1.2, a phase transition happens. When

Results of the proposed open-loop local control scheme for spectrum allocation in a CRAHN.
From this example, we can conclude that the overall performance in terms of spectrum utilization is to some extent controllable by using the limited local information. However, as the convergence cannot be achieved, this controllability may not be sufficient to some applications as more variables should be considered. Furthermore, we can see the possible structure of a local control scheme with local information, where the local control scheme described above is an open-loop local control scheme without any feedback. Therefore, the local information may be helpful to spectrum sharing if we employ it in a closed-loop local control scheme with a feedback.
We will use the spectrum information to calculate the consensus feedback in the closed-loop local control scheme in the following simulations.
5.2. Protocol Design
Before doing a further simulation using the consensus feedback, we propose a communication protocol based on the theory in Section 4. The protocol is expected to show the applicability of using a consensus feedback to solve the fairness problem for spectrum sharing fairness. The protocol is briefly described in Algorithm 1, where Step (1) aims to process the proposed consensus-based feedback from neighboring nodes, while Step (2) performs standard data communications in the RTS/CTS MAC protocol. For example, after a CR receives the handshaking frames with spectrum information from neighboring CRs, it will update its local cache with available spectrum band indexes and the fairness group it belongs to from the value p. Then, a CR can know the available spectrum bands from the neighbors' feedbacks and then inform the other CRs in the similar way.
In addition, in order to determine which spectrum bands the neighboring CRs are using, we assume that a CR node can acquire this information by overhearing the neighboring CRs' communications. A feasible and economic way of overhearing that information is by encapsulating a data field containing that information and piggybacking it in a frame sent by a neighboring CR. For example, the consensus feedback is derived from the spectrum information piggybacked in protocol-specific frames or packets, such as request-to-send (RTS) or clear-to-send (CTS) frames in an IEEE 802.11-based MAC protocol. The slotted time characteristic in the 802.11-like MAC protocol can also meet the requirements of the proposed protocol. Therefore, the proposed protocol can be readily integrated in the IEEE 802.11-based CRAHN. More importantly, the proposed consensus-based protocol will not result in extra communication efforts or cause delays affecting throughputs.
Now we analyze the complexity of the proposed protocol. We denote by M the number of CRs and denote by d the average degree of a CR. The spectrum sensing takes
Now we analyze the power consumption of the proposed protocol based on RTS/CTS handshaking procedure. We take the typical value of the RTS frame length and CTS frame length as 20 bytes and 14 bytes, respectively, and we consider the power consumption model for 802.11 transmissions with 2 Mbps speed in [14]. The power consumption of sending an RTS frame and receiving a CTS,
5.3. Computer Simulation Results
In this section, we show the results based on the proposed consensus-based communication protocol, implemented using the simulator NetLogo 4.1 [15]. We will compare the proposed protocol with a classical CR scheme, called the device centric Rule-A [6], where a so-called property line measure, calculated from the available spectrum bands of neighboring CRs, is used for spectrum sharing. We choose Rule-A for comparison because it is the most similar scheme to our proposed protocol with basic local information (i.e., connectivity and spectrum availability of neighboring CRs) without extra communication efforts; other schemes like the local bargaining scheme or graph coloring scheme are centralized and require extra information through extra communication efforts. Moreover, the max-min fairness based schemes, which have a different spectrum sharing objective from the proposed Definition 1, will not be considered in this paper.
Suppose the number of spectrum bands at a CR at the beginning is randomly allocated. Each CR performs the proposed consensus-based protocol to ensure the number of spectrum bands is decided by the consensus feedback from its immediate neighbors. The consensus-based communication protocol will be executed once in an iteration; and therefore a successful run needs several iterations. Considering PU activities, the spectrum band availability varies at the beginning of each run. Moreover, we keep the total number of available spectrum bands in the network as 1900 for the following simulations.
Next, we describe the system model for this computer simulation. In Figure 6, a dense CRAHN with 350 CR nodes (i.e.,

A randomly distributed CRAHN with 350 CRs and initially allocated spectrum bands.
We compare the convergence performance using the metric of unallocated spectrum bands after running the proposed consensus-based protocol and device centric Rule-A. The results are shown in Figures 7 and 8.

Convergence performance of the proposed consensus-based protocol and Rule-A.

Convergence performance of the consensus-based protocol and Rule-A in multiple iterations.
The convergence performance of Rule-A and the proposed consensus-based protocol is shown in Figure 7, where we can see that the proposed consensus protocol converges very quickly, whereas Rule-A has stable convergence performance in one iteration. At the end of each iteration, all the CRs are allocated with spectrum bands. The reason that the consensus protocol is better is the consensus spectrum availability information is accurate during the spectrum sharing process, while the device centric Rule-A uses the poverty line as a feedback, which does not accurately estimate the spectrum availability of CR nodes.
In Figure 8, we can see how the consensus-based protocol converges over multiple iterations, where at the end of each iteration (i.e., each run of the protocol) all the nodes can be successfully assigned with desired spectrum bands. We use a randomly generated topology for the CRAHN in each iteration epoch, during which the consensus protocol will converge as expected, that is, it can make all the spectrum bands be shared among all the CRs. Moreover, the convergence time is quite stable even if we change the network topology before each iteration. In addition, the spectrum information mentioned in Step (1) of Algorithm 1 in this simulation is the spectrum bands.
In order to see the fairness performance in different network sizes, we plot Figure 9, where the fairness measure is calculated by (2). From Figure 9, we can see that the fairness measure of Rule-A is larger than that of the proposed consensus-based protocol in all four network sizes. This is because the Rule-A cannot converge and thus the spectrum bands can hardly share among the CRs. As such, the proposed consensus protocol has better fairness performance than Rule-A. Furthermore, we can see how the spectrum sharing goal is achieved by these two algorithms, where we count the number of CRs with distributed spectrum bands in Figure 9. Figures 9(a)–9(d) show that the proposed consensus-based protocol can fairly distribute and meet the spectrum sharing goal better than Rule-A.

Fairness performance versus different network sizes when (a)
Next we discuss the fairness group in the spectrum sharing process. First, we show the intermediate results of using the consensus protocol for spectrum allocation. In Figure 10, different leading nodes in FGs are indicated with arrows, and, in the initial stage, only the leading nodes have been allocated with spectrum bands. From Figure 10(a), we can see the CRs running the consensus protocol can adjust the spectrum availability based on a leading node, which responds to the spectrum changes, and thus result in spectrum reallocation on neighboring CRs. The neighboring CRs will run the proposed consensus-based protocol to spontaneously change their spectrum bands. In other words, the leading node can share the spectrum bands to the rest of the CRs in this case. Similarly, in Figures 10(b) and 10(c), the leading nodes can share the spectrum bands with the other CRs. Therefore, we can see that the nodes following the spectrum information of the leading node belong to the same FG. Furthermore, if the leading nodes are considered as cluster heads reflecting the accurate changing radio environment, all the CRs in a cluster can instantly be informed of the spectrum change accordingly. If we consider the extreme case that the number of FGs equals one, we can actually convert this case to the one shown in Figure 6.

Intermediate spectrum sharing results in CRAHN when (a)
In order to see the convergence performance of the proposed consensus-based protocol versus different FGs, we compare the convergence performance in three networks with one FG, two FGs, and three FGs, respectively. The experimental results are shown in Figure 11, where all the nodes can be shared with spectrum bands at the end of each run. Moreover, we can see that the convergence time per iteration when

Convergence performance with different number of FGs.
In addition, as we have evaluated the fairness performance when

Fairness performance in a network when (a)
6. Conclusion
In this paper, we mainly explore the effectiveness of using a consensus-based protocol to solve the fairness problem in spectrum sharing. In order to analyze the convergence condition using a consensus protocol, we introduce the local control scheme as we can consider the consensus procedure as the consensus feedback in the system block diagram of the local control scheme. In this way, the convergence condition is identical to the system stability of the local control scheme. Furthermore, we have proven and shown the applicability of using a proposed consensus-based protocol for spectrum sharing problems in CRAHNs or CRSNs. We show the effectiveness of applying the proposed consensus-based protocol to a randomly deployed network, by which the desired convergence and fairness can be achieved. When we show the cases of applying the concept of FG in the spectrum sharing for CRAHNs or CRSNs, the CR nodes that lead to spectrum changes are subject to being affected by PU activities, which result in spectrum availability. In addition, although in a small-scale network, a centralized spectrum sharing scheme may be more efficient than the proposed consensus-based protocol, the proposed consensus-based protocol is economic, robust, and efficient for keeping spectrum sharing fairness in a large-scale network.
In the future work, we will elaborate a more sophisticated consensus-based protocol taking advantage of more kinds of spectrum information by local observations.
