Spectrum Allocation Strategies Based on QoS in Cognitive Vehicle Networks

The vehicular ad hoc network (VANET) is an important part of modern intelligent transportation systems (ITS), and its emergence has provided support for improving traffic safety and driving experience. The problem of spectrum scarcity has become evident due to the increasing demand for various VANET services. Using cognitive radio (CR) technology in VANET to solve the problem of spectrum scarcity has become a research focus in recent years. The existing spectrum allocation mechanism cannot effectively solve problems, such as high delay, uncertain quality of service (QoS), and low throughput. In this study, we investigate the spectrum allocation strategies in CR for VANET(CR-VANET). For different network optimization indicators under different load networks, we divide CR-VANET into two scenarios: high-load CR-VANET (HCR-VANET) and low-load CR-VANET (LCR-VANET). In LCR-VANET, we establish a model for maximizing throughput with two constraints and propose a channel allocation scheme based on a greedy algorithm (CASGA) to maximize the network throughput. In HCR-VANET, application services are divided into safe application services(SAS) and unsafe application services. To improve the acceptance probability of SAS, we also propose an SMDP-based channel allocation scheme (SMDP-CAS) to maximize the acceptance probability of SAS. Simulation results prove that CASGA and SMDP-CAS greatly improve the throughput of the network and the acceptance probability of SAS.


I. INTRODUCTION
The emergence of a large number of vehicles facilitates travel but causes safety problems, such as traffic collisions and traffic jams. As an important part of the intelligent transport system (ITS), vehicular ad hoc network (VANET) [1], [2] plays an important role in improving safety and comfort in transportation services. More than a decade ago, a dedicated short range communication (DSRC) was allocated to VANET, and IEEE wireless access standards (such as IEEE 802.11p and IEEE 1609.4) were developed to support vehicle communication in DSRC. The two main types of DSRC communication modes are vehicle to vehicle (V2V) and vehicle to infrastructure (V2I) [3], [4]. In V2I, vehicles communicate through on-board units(OBUs) and roadside units (RSUs) or cellular networks (LTE, 3GPP, and WiMAX). V2V aims to strengthen the real-time information sharing between vehicles, allow vehicles to communicate in real time, The associate editor coordinating the review of this manuscript and approving it for publication was Hayder Al-Hraishawi . update traffic information in a timely manner, and provide vehicles with a safe and comfortable experience.
Spectrum resources are crucial in wireless communication. With the rapid increase in vehicles in VANET, the demand for different application services has also increased exponentially, and the problem of spectrum scarcity has become apparent. The measurement results of spectrum utilization over the years have shown that many unused or underused licensed frequency bands exist in different spaces and times. To solve the problem of low spectrum utilization, cognitive radio (CR) technology is used in VANET to improve spectrum utilization, thereby reducing the wastage of spectrum resources and improving communication efficiency. Compared with VANET, CR for VANET (CR-VANET) [5] can capture available spectrum holes in the surrounding environment and provide an opportunity spectrum access (OSA) approach that allows unlicensed/secondary users (SUs) to use the spectrum without interfering with licensed/primary users (PUs) [6].
One of the main research foci in CR-VANET is to design specific spectrum management techniques to provide quality of service (QoS) guarantee for CR-VANET [5]. QoS guarantees are important for messages and signals related to vehicular safety. For example, in an emergency braking situation, the vehicle behind should be notified as soon as possible to leave enough time for other drivers to react. However, in a crowded traffic environment, providing such a QoS guarantee is difficult. On the one hand, a large number of vehicles causes spectrum shortage. On the other hand, the QoS of several important applications is not guaranteed because of the lack of an efficient spectrum allocation scheme.
In this study, we investigate the spectrum allocation strategies for CR-VANET. For different network optimization indicators under different load networks, we divide CR-VANET into high-load CR-VANET (HCR-VANET) and low-load CR-VANET (LCR-VANET). We establish different optimization problem models based on the optimization goals of networks with different loads. The main contributions of this work are as follows.
• To distinguish different load networks, we propose a standard to divide the network and study CR-VANET under different networks. In LCR-VANET, throughput is the standard for network optimization, and in HCR-VANET, we pay attention to the acceptance probability of security application services.
• In LCR-VANET, we establish a model for maximizing throughput under multiple constraints and propose a channel allocation scheme based on a greedy algorithm (CASGA) to maximize network throughput.
• In HCR-VANET, application services are divided into safe application services (SAS) and unsafe application services (UAS). To improve the acceptance probability of SAS, we propose a semi-Markov decision process (SMDP)-based channel allocation scheme (SMDP-CAS) to maximize the probability of SAS acceptance.
The remainder of the paper is organized as follows. We review related work in Section II. The cognitive vehicular network model is introduced in Section III. In Section IV, we establish the throughput optimization problem and propose CASGA to solve this problem in LCR-VANET. We establish a model for maximizing the reward function and propose an SMDP-CAS to solve this problem in HCR-VANET. We simulate the system model and analyze the simulation results in Section V. We conclude our work in Section VI.

II. RELATED WORK
Current research on CR-VANET focuses on various issues, including spectrum sensing and dynamic spectrum access (DSA) technology, cooperative communication, MAC protocol, routing protocol, QoS, and software-defined radio. Spectrum allocation is an important part of CR-VANET. An efficient spectrum allocation strategy is vital in alleviating the lack of spectrum resources, improving communication quality, and ensuring application service QoS. At present, many studies are being conducted on spectrum allocation in CR-VANET.
The author in [7] studied the problem of maximizing throughput in multiple SU and multi-channel opportunistic spectrum access networks. To solve the challenge of designing effective solutions in dynamic and unknown environments, the author described the optimization problem as a cooperative games to further prove that this is an orderly potential game. Nash equilibrium (NE) based on the best response algorithm for fair game was proposed. The author in [8] proposed a game theory spectrum access scheme for vehicles to access licensed channels opportunistically in a distributed manner. In particular, the spectrum access process was modeled as a non-cooperative congestion game. The existence of NE was proven, and its efficiency was analyzed by using the unified media access control protocol and ALOHA with time slots. In addition, a spectrum access algorithm was proposed to achieve efficient and fair spectrum access. The author in [9] used the divide-and-conquer scheme for resource channel allocation. The optimization problem was formulated as a joint game in the form of partitions to obtain a suboptimal solution. To maximize the throughput, the authors in [10] proposed a throughput-efficient channel allocation framework for multi-channel cognitive vehicle networks and pointed out that the problem was an NP-hard nonlinear integer programming problem. An NP algorithm was designed to solve the channel allocation problem. The author in [11] proposed a channel resource allocation scheme based on a semi-Markov decision strategy to solve the problem of shortage in channel resources in VANET. In this scheme, the CR-VANET channel allocation problem is considered. Channel allocation decisions are made through SMDP to maximize the overall system benefit.
CR-VANET has several other optimization aspects. The author in [12] proposed a resource allocation scheme based on SMDP to facilitate the peak signal-to-noise ratio (PSNR) and smooth playback of video streaming applications. To solve the coexistence problem between the vehicular network and 802.22 networks, the author in [13] described the coexistence problem as a mixed-integer non linear programming (MINLP) problem. Three algorithms have been proposed to solve the resource allocation problem. To solve the channel conflict problem in the channel switching of vehicle networks, the author in [14] proposed a new dynamic spectrum allocation algorithm (DSAARCC). The author in [15] introduced a graph coloring method to describe dynamic spectrum allocation intuitively. In [16], an improved decomposition-based multi-objective cuckoo search (MOICS/D) algorithm was proposed to improve the throughput and fairness of the network.
Other spectrum sharing strategies in CR networks also play a guiding role in spectrum allocation in CR-VANET. For example, in [17], interference alignment (IA) was applied to spectrum sharing in CR networks, and the author proposed three power allocation (PA) algorithms to maximize the throughput of SUs, the energy efficiency (EE) of the network, VOLUME 8, 2020 and the requirements of SUs, while guaranteeing the QoS of the PUs. To improve the sum rate of SUs while guaranteeing the secrecy rate of the PUs in CR networks, the author in [18] proposed an OTD scheme and an IA-based scheme.
To the best of the author's knowledge, no existing research has studied and distinguished different optimization goals under different CR-VANETs, which is the focus of the current study.

III. SYSTEM MODEL
In this section, we construct network, channel, vehicle, application service, and channel allocation models according to CR-VANET.

A. NETWORK MODEL
We use the highway as the network scenario of CR-VANET. The basic equipment includes the base station (BS) for communication, the RSUs, the PU, and the SU in CR-VANET. DSRC is used for communication. The RSUs are arranged along a section of the highway. Given that the distribution of RSU locations is not the focus of our discussion, we assume that the locations of RSUs are evenly distributed on the highway and cover the entire highway section. Then, the entire highway can be divided into unit areas by RSUs, and each RSU covers a section of highway with a width of D. Figure 1 shows the network scenario in a single RSU in CR-VANET. Within the coverage of the RSU, the PU is static and randomly distributed on the highway. We assume that the coverage of the PU is also random. Vehicle users can use OBU to determine the availability of the PU channel.

B. CHANNEL MODEL
In CR-VANET, it is assumed that the RSU detects N available channels and that all channels can meet the minimum service requirements for different services. The vehicle can use the channel when the PU is idle. X n (t) denotes the availability status of channel n at time slot t. X n (t) = 1 means channel n is idle at time t; otherwise, X n (t) = 0. In our channel model, whether the channel is busy or idle follows a stable Bernoulli random process above t.
Given that the RSU does not know the exact state of the channel, vehicle transmissions scheduled to a certain channel may collide or create conflict with the channel that the PU is transmitting. Similar to the existing CR network [19], [20], we assume that the PU can tolerate a certain collision probability, that is, the collision probability caused by the dispatching vehicle on channel n must not exceed γ n . This system parameter is determined by the PU channel [21]. With this collision probability constraint, RSU can calculate the maximum allowable scheduling time T n r on each channel. Collision probability P coll is calculated using Eq. (1).
Therefore, the maximum allowable transmission time T n r of each channel can be obtained by Eq. (1). Given that channel allocation begins at each scheduling cycle, the maximum duration of scheduling allowed on channel n is t n = min{T n r , T }, where T is the scheduling period.

C. VEHICLE MODEL
As an SU in CR-VANET, vehicle users differ from static cognitive nodes in traditional static cognitive networks because of their high-speed mobility. Considering vehicle mobility is essential in building vehicle user models [22]. The speed relationship between vehicles on the highway is expressed as where v i t is the speed of a vehicle at time t, a i t is the acceleration at time t, and ε is a random variable distributed between where f highway (v) is the probability density function of v i t . Hence, we can obtain the average speed v m of a moving vehicle user by using the equation The average scheduling period T in the CR-VANET range can be calculated as Figure 1 can be adopted as an example to analyze the moving process of the vehicle. U m (X um , Y um ) is the position of vehicle m, and P n ((X pn , Y pn ) is the position of PU n. The European distance S mn between the PU and the vehicle can be calculated as Owing to the limitation of the road structure in CR-VANET, the vehicle's movement trajectory is straight and the speed can be predicted. Therefore, the moving distance D m of vehicle m in time period [t, t + t] can be calculated as: The distance between vehicle m and PU n at t + t can be calculated as

D. APPLICATION SERVICE MODEL
Application services, such as pre-collision services for safety applications and map download services for non-safe applications, have been developed to meet the need for safety and entertainment in VANET. Assume that VANET has K different application services. Each application service is represented as A k , (0 ≤ k < K ). The transmission sequence of all services in channel n can be represented by a sequence set P n , where P n =< A 0 , A 1 , . . . , A K −1 > represents a transmission sequence for all services. In this sequence, A 0 is transmitted first, and A K −1 is transmitted last. The transmission time of the application service on channel n can be expressed as where Th(A k ) represents the delayed response threshold of the application service, L k is the size of A k , and r nk is the transmission rate of A k on channel n. r nk can be calculated as where B n is the bandwith of channel n, p m is the transmission power of vehicle m, σ is the Gaussian white noise power, and H n m (t) is the instantaneous gain of vehicle m on channel n.
where α is the path loss factor, β n m (t) obeys the exponentially distributed random fading mean, and s mn is the distance between vehicle m and channel n.

E. CHANNEL ALLOCATION MODEL
A channel can only be used by one application service at a time, but in time period T, the channel can transmit multiple application services. Figure 2 shows a model of channel allocation.
Once the transmission sequence P n on channel n is determined, the total transmission time t n of channel n is also determined.
The limitation of scheduling period T and the maximum transmission time limit tolerable T n r are considered.

IV. PROBLEM FORMULATION AND SOLUTION
We need different optimization goals under different load networks. Hence, we divide the CR-VANET into HCR-VANET and LCR-VANET by using where U (t) is the amount of requested data by all vehicles and P(t) is the maximum amount of data transmitted in CR-VANET. C(t) > 1 means that the CR-VANET is HCR-VANET; otherwise, the CR-VANET is LCR-VANET.
In HCR-VANET, the QoS of all application services cannot be guaranteed, even with the best channel alloction scheme. Therefore, our optimization goal is to guarantee the QoS of SAS in HCR-VANET. Meanwhile, in LCR-VANET, we need to design a spectrum allocation scheme that will ensure the maximum throughput efficiency.

A. LCR-VANET 1) PROBLEM MODEL IN LCR-VANET
In LCR-VANET, the number of vehicles is M , and the number of available channels is N . In this problem model, x mn is used to describe the result of channel allocation. When x mn = 1, channel n is allocated to vehicle m; otherwise, x mn = 0. Matrix A represents the result of channel allocation in LCR-VANET.
Assuming that vehicle m requests A m at this time, U mn is the expected throughput when vehicle m uses channel n. U mn can be calculated as Matrix U is denoted as the throughput matrix, and each element in U can be calculated with Eq. (15). The total throughput U within the channel allocation result A in LCR-VANET VOLUME 8, 2020 can be calculated as x mn · U mn , ∀m ∈ [0, M ), n ∈ [0, N ). (16) The optimization problem model that maximizes the total throughput U in LCR-VANET can be expressed as C1 indicates that the total transmission time of all services on channel n must be less than the maximum allowed transmission time on channel n. C2 indicates that the same vehicle can only be assigned to one channel at the most. The optimization problem model involves solving A to maximize the throughput in LCR-VANET.

2) CASGA
We propose CASGA to solve Eq. (17). CASGA uses a 2D greedy search strategy. The specific CASGA distribution plan is shown in Algorithm 1. Search for the maximum position m, n in U.

3:
Calculate t mn using Eq. (9) 4: if t mn ≤ t n then 5: In Algorithm 1, we search for the location of the maximum value in U and confirm A. At the same time, we determine whether C1 is satisfied when x mn = 1. If it is satisfied, then that allocation is feasible; otherwise, it will search for the max t mn for vehicle m. To meet C2, we need to set the allocated row in U to 0 to ensure that it will not be searched in the next search. A is obtained when the search is finished.

B. HCR-VANET
In HCR-VANET, we consider two main types of application services, namely, SAS and UAS. The arrival of SAS and UAS obeys the Poisson distribution of λ S and λ U , respectively.

1) PROBLEM MODEL IN HCR-VANET
In this section, we use the SMDP to analyze channel allocation in a single RSU. The SMDP here includes four parts: state space, decision space, state transition probability, and reward function.
In HCR-VANET, the system state is determined by the number of channels allocated to SAS and UAS. The state space can be defined as where s represents the state of the system; N S and N U are the numbers of SAS and UAS acceptted by the system at this moment, respectively; and e is the event that occurred. Table 1 summarizes the events and corresponding decisions. a = 0 means the system rejects the SAS or UAS request, and a = (1, k) means the system accepts the SAS or UAS request and releases the application services in the number of k that have been accepted. a = −1 pertains to the decision when the service is completed or the vehicle leaves the system. At this time, the system maintains the original state without any changes.
The system completes decision a in state s. The duration of the current decision and the next decision is set to τ (s, a). Research shows that τ (s n , a n ) is exponentially distributed. β(s, a) is the average rate of events taking decision a in s. β(s, a) = τ (s, a) −1 can be denoted as where ϕ = λ S + λ U + N S µ S + N U µ U . µ S and µ U are the average service time of SAS and UAS, respectively. When decision a occurs, we define the next state as s . In accordance with system state s and decision a, we present the following discussions.
When s = (N S , N U , A S ), a = (1, k), Otherwise, When the system state is s and the decision is a, the reward [23] can be expressed as  w(s, a) can be expressed as = (1, k).
where w U and w S are the rewards for accepting UAS and SAS, respectively. The Bellman equation (26) can be formulated using the discount reward model [23].
After normalization, the reward function is The maximization discount reward model problem can be expressed as

2) CHANNEL ALLOCATION SCHEME BASED ON SMDP
In finite state space s, all possible decisions, Act s , need to be discussed.
When {s|s(e) ⊆ {D S , D U }, decision a is defined, and it is easy to determine. However, many decisions exist when {s|s(e) ⊆ {A S , A U }. Hence, we need to design corresponding search algorithms to find all possible decisions. The search algorithm is described in Algorithm 2. After searching for all possible decisions in state-space s, we must study the channel allocation. In this section, we propose SMDP-CAS to solve the problem in Eq.(29). SMDP-CAS uses numerical iteration to determine the maximum reward in a different decision. The detailed description is presented in Algorithm 3.

V. NUMERICAL RESULTS
In this section, we analyze the simulation results for LCR-VANET and HCR-VANET.

A. LCR-VANET
We maximize the network throughput in LCR-VANET and simulate an RSU. The coverage of the RSU is set to 1 km. VOLUME 8, 2020 Algorithm 3 SMDP-CAS 1: Set v(s) = 0 and i = 0 2: Search for Act s by algorithm 2 3: 5: back to 2,i + + 6: end if 7: The number of vehicles is M , and the number of PU channels is N . We compare CASGA with game theory algorithm (GT) from three aspects: throughput, spectrum utilization, and acceptance probability of SAS. Figure 3 shows the change in throughput with the number of vehicles, number of channels, and velocity. Figure 3(a) shows that the throughput varies with the number of channels when we set M = 20 and M = 30 for comparison. CASGA greatly improves the throughput compared with GT. The change curve of throughput indicates that in LCR-VANET, the throughput increases linearly, and when it reaches HCR-VANET, the throughput stabilizes. Figure 3(b) shows that the throughput varies with the number of vehicles when we set N = 7 and N = 15 for comparison. The saturation throughput of CASGA is greatly improved compared with that of GT, and even in HCR-VANET, CASGA has a greatly improved throughput. Through an analysis of Figure 3, we can conclude that CASGA can greatly improve the throughput in CR-VANET.

2) SPECTRUM UTILIZATION
Spectrum utilization here refers to the ratio of the time that the channel is used by the vehicle to the maximum available time of the channel. Figure 4(a) shows that spectrum utilization varies with the number of channels when we set M = 20 and M = 30 for comparison. The spectrum utilization rate decreases as the number of channels increases because as the number of channels increases, the network gradually transitions from a saturated state to an idle state. Moreover, CASGA is more advantageous than GT in improving spectrum utilization, especially in HCR-VANET. Figure 4(b) shows that spectrum utilization varies with the number of vehicles when we set N = 8 and N = 20 for comparison. The spectrum utilization increases with the   Through an analysis of Figure 4, we can conclude that CASGA can greatly improve and maximize the spectrum utilization in CR-VANET.

3) ACCEPTANCE PROBABILITY OF SAS
The acceptance probability of SAS is an important indicator for evaluating network security. Increasing the acceptance probability of SAS can guarantee network security. Figure 5(a) shows that the acceptance probability of SAS varies with the number of channels when we set M = 20 and M = 30 for comparison. The acceptance probability of SAS increases as the number of channels increases, eventually reaching 100%. This result is achieved because the network is HCR-VANET when the number of channels is small, and the network changes to LCR-VANET when the number of channels is gradually increased. Figure 5(b) shows that the acceptance probability of SAS varies with the number of vehicles when we set N = 8 and N = 20 for comparison. When the number of vehicles is small (LCR-VANET), the acceptance probability of SAS for both algorithms is 100%, but as the number of vehicles gradually increases (HCR-VANET), the SAS acceptance of the CASGA algorithm decreases rapidly. Through an analysis of Figure 5, we can conclude that CASGA can guarantee the probability of SAS acceptance in LCR-VANET but cannot guarantee the probability of SAS acceptance in HCR-VANET. Thus, we need to optimize the acceptance probability of SAS in HCR-VANET.

B. HCR-VANET
In this section, to evaluate the performance of SMDP-CAS, we compare it with CASGA and the game theory algorithm (GT) to verify that SMDP-CAS greatly improves the SAS acceptance probability. The simulation parameters are shown in Table 2. The simulation experiment is performed in 1000 iterations, and 100 experiments are performed to determine the average. The simulation results show the acceptance probability of SAS, the acceptance probability of UAS, and the reward as a function of N , λ S , and λ U . VOLUME 8, 2020   even when N is small, the acceptance probability of SAS is maintained at a very high value. This finding proves that SMDP-CAS can greatly improve the acceptance probabil- ity of SAS. Figure 6(c) shows the variation in the reward function with N for the three algorithms. In HCR-VANET, the reward of SMDP-CAS is the largest, indicating that VOLUME 8, 2020 the reward function we set is effective. In HCR-VANET, the reward increases as N increases. However, in LCR-VANET, the reward decreases as N decreases because an increase in N increases the system cost.
2) VARIES WITH λ S λ S and λ U are the average arrival rates of SAS and UAS, respectively. To study the acceptance probability of SAS and UAS varying with λ S , we set λ U = 5. We also set N = 2 and N = 6 for comparison. Figure 7(a) indicates that as the λ S increases, the acceptance of SAS decreases. Regardless of how large λ S is, SMDP-CAS can guarantee the maximum acceptance probability of SAS. Figure 7(b) shows that the acceptance probability of UAS varies with λ S . Using SMDP-CAS reduces the acceptance probability of UAS. Comparison of the rewards in Figure 7(c) indicates that when SMDP-CAS is used for spectrum allocation analysis, the reward of the system far exceeds that of GT and CASGA. The growth trend of the reward function shows that when the acceptance of SAS gradually increases, the system gradually reaches saturation; hence, the reward value gradually stabilizes. When the system refuses to accept SAS, the reward decreases due to the system cost and eventually stabilizes.

3) VARIES WITH λ U
In Figure 8, we set λ U = 2. Figure 8(a) indicates that regardless of how λ U changes, the acceptance probability of SAS in SMDP-CAS always maintains the maximum value. Figure 8(c) is different from Figure 7(c) in that the reward decreases when λ U increases. This is because accepting UAS to increase the reward is limited, and it will increase the system cost.

VI. CONCLUSION
We study the spectrum allocation problem in CR-VANET. The optimization vary under different network scenarios. Given this condition, we divide CR-VANET into two scenarios: HCR-VANET and LCR-VANET. Then, we design corresponding system and problem models in accordance with the different scenarios. A model for maximizing throughput with two constraints is established in LCR-VANET, and we propose CASGA to optimize the throughput. Through comparative experiments, we prove that CASGA can greatly improve the throughput and spectrum utilization in LCR-VANET. To solve the problem of low acceptance probability of SAS in HCR-VANET, we propose SMDP-CAS and establish a reward function to select the channel allocation strategy. Comparison of SMDP-CAS with GT and the greedy CASGA proves that SMDP-CAS greatly improves the acceptance probability of SAS in HCR-VANET.