Efficient Channel Selection and Routing Algorithm for Multihop , Multichannel Cognitive Radio Networks with Energy Harvesting under Jamming Attacks

We study jamming attacks in the physical layer of multihop cognitive radio networks (MHCRNs) where energy-constrained relays forward information from the source to the destination. Meanwhile, a jammer can transmit interfering signals on a channel such that all ongoing transmissions on this channel will be corrupted. In this paper, all jammers can attack only one of the predefined channels in each time slot. Moreover, they can randomly switch channels to start jamming another channel at the beginning of every time slot. The switching behavior is assumed to follow a Gaussian distribution. Due to limited battery capacity in the relays, energy harvesting is utilized to solve the energy-constrained problem in the cognitive radio network. Subsequently, relays are able to harvest energy from non-radio frequency (non-RF) signals such as solar, wind, or temperature. In this paper, we determine the throughput/delay ratio as a key metric to evaluate the performance inMHCRNs. Owing to the limited battery capacity in the relays and the jamming problem, the source needs to select proper relays and channels for each data transmission frame to optimize overall network performance in terms of end-to-end delay, throughput, and energy efficiency. Therefore, we provide two novel multihop allocation schemes to maximize achievable end-to-end throughput while minimizing delay in the presence of jammers. Through simulation results, we validate the effectiveness of the proposed schemes under multiple jamming attacks in MHCRNs.


Introduction
The cognitive radio network (CRN) has become a key solution for inefficient spectrum utilization due to its dynamic spectrum sharing.Cognitive radio users are allowed to share the spectrum bands, which are licensed to the primary users (PUs) [1][2][3][4].By periodically sensing and adapting to the environment, secondary users (SUs) can utilize spectrum bands that are not currently used by PUs [5,6].This is considered an overlay approach in CRN.For an underlay approach, SUs can be allowed to concurrently use the spectrum bands originally allocated to PUs only if interference is regulated to below an acceptable threshold [7,8].Most of the previous works only focused on the sensing and utilization of spectrum holes in frequency or time domains.Meanwhile, improved utilization of spectrum holes based on location information of the PUs and the SUs has not been investigated in a systematic way.
Location information can help find spectrum holes, and a cognitive user may be encouraged to use the spectrum owned by the primary user furthest away to avoid severe interference.The location information can be obtained by using a global positioning system (GPS) or other localization methods [9,10].
However, cognitive radio has also encountered various types of security threats, as well as challenges in the networks, due to the open nature of the cognitive radio architecture [11,12].Many studies have focused on practical attacks in IEEE 802.11 networks at the physical (PHY) layer.One of the serious attacks that affect CRN security is jamming, which can be either a single-channel or a multiple-channel attack.For a single-channel-jamming attack, a malicious attacker continuously transmits high-power interfering signals on a channel.As a result, current communications between users on this channel are totally disrupted.Nevertheless, this jamming attack is not so effective because the attacker must constantly transmit interference signals and, hence, requires large energy consumption.Moreover, it is quite easy for users to switch to other channels that are not jammed.In addition, the attack can easily be detected due to the high-power interference signal.Subsequently, a more effective type of jamming attack is to simultaneously jam multiple channels.However, if the number of channels is high, this still requires too much energy to attack.Unfortunately, by taking advantage of cognitive radio technology, attackers can automatically switch among all the channels to enhance the jamming.
To tackle jamming attacks, SUs first detect attackers by collecting data on noise in the network to build a statistical model [13].With this, SUs are always able to differentiate between interference signals and noise when the jammer attacks a channel.There are two main strategies to defend against attackers [14].The first is to use frequency hopping, such that as the SUs identify jamming attacks, they immediately switch to other unjammed channels for transmission.The second is to execute a spatial retreat in which the SUs escape from the zone of the jamming to other positions out of jamming range.However, the spatial retreat method may induce SUs to drop their current communication.
Relaying is emerging as a key enabling solution to solve problems in CRNs.For instance, relaying can improve the system and secrecy capacity when the user suffers from fading, shadowing, or malicious attacks [15].Ruan and Lau [16] and Zhang et al. [17] conducted joint power allocation and hop-relay selection to maximize end-to-end throughput and enhance power savings.Wang et al. [18] proposed a routing mechanism to avoid malicious relays and minimize routing delay.Wu et al. [19] also focused on defending against jamming attacks using a Markov decision process, where SUs can perform dynamic access to multiple channels for an antijamming defense.
In recent times, energy harvesting has emerged as an appealing technique to solve energy-constrained problems of wireless networks.Energy harvesting can provide perpetual energy for the battery without manual recharging or physical replacement.In an energy-harvesting CRN, cognitive users are powered by harvested energy either from non-RF signal sources (solar, wind, temperature, etc.) [20] or from RF signals from base stations [21,22].Xu et al. [23] investigated the end-to-end throughput maximization problem in a multihop energy-harvesting cognitive radio network, and their simulation results verified the superiority of a joint optimal time and power allocation algorithm, compared to other solutions, through different scenarios.
In this paper, we investigate spectrum allocation for multihop and multichannel transmissions of energy-harvesting CRNs in the presence of jamming attacks.In addition, the energy-constrained issue is also considered in this paper.With an energy harvesting technique, energy-constrained relays are able to harvest non-RF energy from the ambient environment to maintain their operations.Subsequently, we propose multihop channel allocation schemes to deal with the jamming and constrained-energy problems.More specifically, by estimating the considered quality of service (QoS) (e.g., end-to-end throughput, delay time) through a number of considered data frames, the source can select the best channels and relays to optimize the network performance (with high QoS) in the presence of jamming attacks.Numerical results are presented to show that the proposed schemes are superior, compared with optimal unrelated and random schemes.
The remainder of this paper is organized as follows.In Section 2, we describe the system model of multihop and multichannel cognitive radio network.In Section 3, we define the problem formulation of this paper.In Section 4, the proposed schemes are presented.In Section 5, we validate the proposed schemes through the simulation results.Finally, in Section 6, we conclude the paper.

System Model
In the paper, we consider a multihop and multichannel data transmission between a secondary transmitter (source) and a receiver (destination) in which, due to a limited transmission range, the source needs to select the best relays to forward its data to the destination.The relays in this paper are energy-constrained devices equipped with a non-RF energyharvesting component to prolong operation.Specifically, relays are able to harvest energy from non-RF signals and use it for spectrum sensing and data transmission phases.This paper is an expanded version of [24], where the energyconstrained problem was not taken into account.Thus, obtaining the best relay that has a finite capacity battery, and the best channel for MHCRNs in the context of jamming attacks to optimize network performance, is a key motivation for this paper.
The network consists of a source (), a destination (),  relays ( = {  |  = {1, 2, . . ., }}), and  jammers ( = {  |  = {1, 2, . . ., }}).For the sake of simplicity, we assume that both  and  have a fixed power supply such that they always have enough energy to transmit and receive data.The relays still can harvest energy while implementing sensing or data communication phases.The total amount of harvested energy in each relay is stored in a battery with a finite capacity,  ca .
The destination is located far from the source such that they are currently not within transmission range of each other.Therefore, relays are responsible for assisting the source to transmit data frames to the destination, and there are  free channels ( = {  |  = {1, 2, . . ., }}) in the CR network.Before the data transmission phase, SUs perform spectrum sensing to find out whether the channel is currently secure (i.e., there is no jamming signal) or not.The source is assumed to have the information on all relays (position, remaining energy) at the beginning of each data frame time.Therefore, it updates the information before selecting the relay to transfer each data frame.Figure 1 shows an example of source and destination SU pair in the multihop and multichannel cognitive radio network with the assistance of multiple relays in the presence of attacks by multiple jammers.Each user can only transmit the data within its transmission range,   .In this paper, we consider a low mobility context in which the spectrum environment varies slowly, such that we can conduct the user and channel assignment based on the location information and the network topology must be updated periodically.For such a spectrum allocation scenario, the source needs to establish an optimal route to the destination and assign suitable channels to every link in the route.Therefore, by providing a proper channel allocation scheme, we can guarantee the highest secure data transmission along the whole route while still minimizing the delay of the communications.

Random Channel Switch Model of Jammers.
In the paper, jammers independently attack channels, and each jammer can only attack one channel in specific time slot  within its jamming range,   .An attacker starts jamming a channel at the beginning of each time slot and can also automatically switch to jam another channel for the next time slot.We assume that the set of available channels defined for all jammers is the same in the network.However, each jammer randomly switches between channels over time slots according to the jamming probability following the Gaussian distribution.Therefore, the jammers may attack different channels within their jamming range in two consecutive time slots.For example, if a jammer   attacks channel  1 at time slot , it may either switch to attack channel  2 or keep attacking channel  1 at time slot  + 1, based on the jamming probability.
We further assume that jammers always have enough energy to attack the channels.Thus, they always attack cognitive users in predefined channels.Besides, each jammer has its own corresponding channel index during jamming attacks on the network.The jamming probability of a jammer on channel   follows a Gaussian distribution: where   and  2  are the channel-jamming index mean and channel-jamming index variance, respectively, of jammer   , and    represents the index of channel   .

Energy-Harvesting Model.
A relay is equipped with a separate hardware component such that it can independently harvest extra energy from the ambient environment over every time slot.It harvests energy in both sensing and transmission phases.Therefore, the energy harvested by relays in the previous time slot will be stored in a finite capacity battery and can be used for the next time slot.
The harvested energy of relays in a whole time slot is given as follows: where  represents the total amount of energy successfully harvested by relay   .
is the probability of energy successfully harvested by relay   .
In this paper, the time for completing the transmission of a data frame is referred to as the frame time,  fr .A data frame sent from every subsource and subdestination pair is assumed to take a time slot duration.It also means that frame time may change for every frame due to the different chosen routes.Let  ts denote the number of total time slots required to transfer a frame from the source to destination over a chosen route.Then, the harvested energy of relay   after one frame time will be given as where ℎ  denotes the number of time slots successfully harvested during  ts time slots.For simplicity in this paper, we ignore the energy for the signal receiving circuit and the energy for decoding at the relays.If a data frame is transferred successfully from the source to destination, the updated energy of relay   , which belongs to chosen route  *  for data frame   at the beginning of   th fr , can be expressed as where    0,−1 represents the updated energy of relay   at the beginning of frame time   th −1 fr ;   ,   , and  ca are sensing energy, transmission energy, and battery capacity of the relay, respectively.Meanwhile, the updated energy of other relays that do not belong to chosen route  *  for data frame   at the beginning of   th fr is given by

Problem Formulation
In [24], we proposed a scheme to select the optimal route and maximize the SU's successful-transmission probability under the jamming attack scenario.The scheme is responsible for finding all the best channels for each link (hop) in the possible routes from the source to destination, wherein Ψ max represents a set of possible routes that have the corresponding maximum successful-transmission probability in   max

𝑠
. More particularly, each link of a route in Ψ max is allocated the best channel to forward data, which is denoted as a linkchannel pair.That is, a link-channel pair is defined as the bestallocated channel for a link, which can be obtained through the previous work [24].Consequently, the proposed scheme from that paper will be adopted as one part of these schemes for the multihop channel allocation presented in this paper.
In this paper, we investigate the solution for dynamically selecting the best routes (best relays and channels) to deliver a number of data frames  fr (from the source to destination) such that the cognitive network can achieve the best performance under the energy-constrained problem.By estimating the throughput and delay over a number of specifically considered data frames (described later in Section 4) for all data frames, the problem formulation can be given as follows: where Ψ = { 1 ,  2 , . . .,  |Ψ| } represents a set of possible routes (from source to destination);    and    are throughput and delay of data frame   , respectively; Ω * including { * 1 ,  * 2 , . . .,  *  fr } represents a set of the best chosen routes for each data frame (form first frame to the total number of delivered frames),  fr .This paper considers a strict constraint where the energy of cognitive relays is limited, and jammers can attack the channels in any time slot.Inefficient utilization of relays and channels can significantly affect the throughput and delay, as well as the utilized energy efficiency of the system, especially in the case of energy-constrained devices and jamming attacks.Hence, obtaining an optimal solution for multihop cognitive communications is a challenging work in this study.In the next section, we describe two novel schemes to solve this problem.A flow chart of the proposed algorithm is depicted in Figure 2.

Multihop Channel Allocation Schemes
In this section, we provide two novel multihop channel allocation schemes to solve the energy-constrained and jamming problems, such that the source can choose the best linkchannel pairs for each data frame transmission.
The proposed algorithm is composed of a channel allocation process and a route selection process.In channel allocation process, we adopt a scheme in [24] wherein the set of the best link-channel pairs of all routes from the source to the destination is obtained.We merely consider the jamming attack problem to allocate the best channel for each hop between the source and destination.Subsequently, we get a set of possible routes, Ψ max , with a set of link-channel pairs,   (  V , , and a set of corresponding maximum successfultransmission probabilities,   max  .  V and represent the link of route  and the best chosen channel for link   V , respectively.In the route selection process, we focus on selecting the best route, which has the assigned channel obtained from the channel allocation process, for each data frame transmission to optimize the multihop cognitive radio network performance.
In the second part, we provide two schemes to deal with limited-energy devices.In particular, we provide schemes to effectively select the best route for every data frame by estimating the expected throughput and delay for a number of considered data frames.Let us consider some formulas to establish schemes before describing the main part in more detail in the next subsection.
The probability that arbitrary user  is attacked by jammer   on channel   is    (  , ) =    (  ) if user  is located within jamming range of jammer   .Otherwise,   cannot attack user  due to the jamming range limitation, that is,    (  , ) = 0.The probability that user  will not be jammed by   on channel   is given by where users  ∈ {,,  },   ∈ , and   ∈ .The probability of user  not being jammed on channel   (i.e., the probability that there are no jammers in the area that can attack user  on channel   ) is expressed as The probability of successful transmission on channel   for link  that can establish a connection between two users,  and , is then defined as where ,  ∈ {, ,   } and   ∈ .The probability of successful transmission for route  is thus given by where  V is the link of route , || is the number of links on route , and Γ  V represents the length of link  V .At the beginning of data frame   , the source will update the energy of all relays According to the updated information, we can determine the corresponding energy of the relays that belong to each individual route,   , as follows: where |  | represents the total number of relays in route   .The notation [⋅] indicates that the index of each relay is arranged in ascending order of each relay in route   .A set of successful-transmission probabilities for all possible routes in Ψ max is defined as where |Ψ max | denotes the total number of all possible routes in the network.
Frame time duration refers to the time for transferring the data through the total number of hops in a chosen route.It may vary in each data frame.For instance, the first data frame time will be three (time slots) if the source chooses a route having two relays.However, the second data frame time would be four (time slots) if the source selects another route that consists of three relays.After selecting a route for the current data frame, the source must wait to transmit the next one until the data frame time of that route finishes.Once the data frame time is finished, the source will again decide on a route to deliver the next data frame.
Nevertheless, without estimating rewards such as throughput and delay for other future data frames, selecting only the most favorable route for a data frame at the beginning of the current data frame time is not always the best solution with a large number of data frames.That is because the rest of the available routes (after selecting the previous one) may provide poor quality (e.g., the low throughput or the long delay).In this paper, therefore we propose two estimation schemes to enhance the quality of the multihop cognitive radio network in which both end-to-end throughput and delay are considered with the number of considered data frames.

Scheme 1.
In this scheme, we provide a method to estimate metrics of QoS such as end-to-end throughput and delay and optimize overall quality of the multihop cognitive radio network.These factors play crucial roles in evaluating multihop cognitive network performance.This scheme allows the source to consider all routes at the beginning of each data frame even including routes having insufficientenergy relays.This is because insufficient-energy relays could be available (having sufficient energy for forwarding) after the current forwarding phase finishes.Hence, this scheme allows each relay to forward data as it has enough energy in its turn even though its remaining energy is insufficient at the beginning of the route selection process.
In the channel allocation process, the source updates all relay and jammer information at the beginning of each data frame.Then, it will find a set of possible routes, Ψ max , in which a set of best link-channel pairs  *  (  V , ) is included, as well as a set of the corresponding maximum successful-transmission probabilities,   max  .  V denotes link V of route , and    V  is the best channel  allocated to link V of route .After allocating the best link-channel pairs for all hops of each route in order to obtain Ψ max , we finally select the best route to transfer every data frame.
In the route selection process, the source decides the number of considered data frames,   , to estimate the sum of the expected throughput/delay ratio through a number of considered data frames over different choices.Meanwhile, a set of possible choices, based on the number of considered data frames, is given as Ω = {Ω  |  = {1, 2, . . ., |Ω|}}, where Ω  = { , |  = {1, . . .,   }}.However, allocating the best choice is still affected by the energy of the relays due to their limited battery capacity.Therefore, to enhance MHCNRs performance we also consider the total energy that relays harvest after each time frame.
A set of energy-harvesting cases based on a number of considered data frames is given as where  ℎ,,, = ∏  =1    ℎ,,, represents the energyharvesting probability for the case (, , ).
In case any of the relays in the allocated route of frame  does not satisfy the energy forwarding requirement (  +   ), the source needs to define the successful recovery probability of the insufficient-energy relay.That is because the relay is able to forward the data frame if it satisfies the energy forwarding requirement.For example, at the beginning of time slot , the third relay of the allocated route does not have enough energy; however, it can still be available (i.e., having enough energy) to forward the data frame after harvesting enough energy during three time slots.For that reason, we define a set of insufficient-energy relay of allocated route for frame  as Ω = { R ,, 1 , . . ., R ,, | Ω| }, where R ,, represents the insufficient-energy relay in allocated route  ,, .Then, the requirement for harvested energy of relay   for forwarding is given as The successful recovery probability of relay R ,,  is computed as follows: where The expected throughput of frame  is calculated as The throughput/delay ratio is expressed as where  ,, = | ,, | is the delay duration of the allocated route in frame .After computing the expected throughput/delay ratio of the cases with indexes , , and  s.t. = {1, . . .,   }, we define the best harvested energy case, , as follows: Then, the best choice with index  (i.e., allocated routes for each considered data frame) will be selected as   7) for  = 1 : |Ω| do (8) for  = 1 : |Ω  ℎ | do (9) Initialize remaining energy of relays with the initial energy at the frame time index  = 1.(10) for  = 1 :   do (11) Update energy of relays. ( Energy of all relays in chosen route is sufficient.(13) Calculate  ,, as Eq. ( 13).( 14) else (15) Define a set of insufficient-energy relays in allocated route Ω = { R ,, 1 , . . ., R ,, | Ω| }. (16) Calculate required energy of relays in Ω, as Eq. ( 14). ( 17) Calculate successful recovery probability of each relays in allocated route  R ,,  as Eq (15).(18) Calculate successful recovery probability of allocated route   ,, as Eq. ( 16).(19) Calculate expected throughput for frame ,  ,, as Eq. ( 17) (20) end if (21) Calculate delay time  ,, = | ,, |. (22) Calculate throughput/delay ratio Γ ,, as Eq. ( 18). ( 23) Calculate remaining energy of relays as Eq. ( 4). ( 24 So, now we can obtain the best choice, which is represented as Afterwards, the source will select the first allocated route in the set of considered data frames ( = 1) for its current data frame.Note that frame index  denotes an estimated data frame and can only be applied to select the best choice in the route selection phase.It is not the index of the real data frame that the source currently wants to transmit.Likewise, the source will repeatedly define the best choice for the next data frames by using this scheme until finishing its transmission (i.e., transmit the total number of intended data frames).Consequently, by estimating the throughput/delay ratio, transmitted data frames are forwarded over secure and efficient routes to increase overall network performance in the presence of jamming attacks.The proposed scheme 1 for multihop channel allocation is shown in Algorithm 1.

Scheme 2.
In this scheme, we select the routes that have sufficient-energy relays for forwarding at the beginning of each data frame time.It means the source will ignore all insufficient-energy relays in the current time slot, and only sufficient-energy routes are taken into consideration.In fact, the route selection process is quite similar to scheme 1, except that the number of route candidates is reduced.It guarantees that once the source selects the best route for the current data frame, the transmission is only affected by jammers during the frame time, not the energy in relays anymore because the source selects a sufficient-energy route at the beginning of each data frame time.According to this scheme, the amount of harvested energy by relays will be used for the next data frame transmission.
First, the source will define Ψ max and   max

𝑠
. Then, it defines a set of insufficient-energy relays: Ω = { R1 , . . ., R| Ω| }.After that, it defines a set of sufficient-energy routes, as follows: where Ψmax = {r 1 , . . ., r| Ψmax | } represents a set of insufficientenergy routes in the current time slots.In the next step, the source will establish a set of possible choices Ω.All possible routes (including insufficient-energy routes in frame  = 1) can be selected for the next data frame transmissions; that is,  >= 2, because, after the data frame time of the data frame ( = 1), insufficient-energy routes may become available (getting sufficient-energy routes).Similar to scheme 1, after defining the energy-harvesting cases and the probability of energy harvesting cases, the expected throughput of each case with indexes , , and  can be computed with (13).
Algorithm 2: Multihop channel allocation scheme under attack in the physical layer.
Note that insufficient-energy relays are ignored in the route selection phase of scheme 2. Therefore, the successful recovery probability of the allocated route will not be considered.Next, we calculate the delay  ,, and throughput/delay ratio Γ ,, for each case.Finally, the best choice, Ω  * , is obtained as in scheme 1.According to this scheme, the best set of routes with the best channels and corresponding relays will be allocated for every data frames of the multihop cognitive transmission from the source to destination.Finally, the proposed scheme 2 for multihop channel allocation is shown in Algorithm 2.

Simulation Results and Analysis
In this section, we verify the performance of the two proposed schemes by using a MATLAB simulation.We consider a CR network in a normalized area (1 × 1).To evaluate the efficiency of our proposed algorithm, we keep the source and destination in fixed positions which are far from each other (i.e., no direct transmission from source to destination).The relays and jammers are randomly distributed in the network.There are 1.5 × 10 3 data frames sent from the source to the destination.Simulation parameters are listed in Table 1.In simulations, we make a comparison with two other schemes: an optimally unrelated scheme and a random scheme.In the optimally unrelated scheme, the relays and channels are allocated by using the maximum successful-transmission probability of the routes for every data frame.In the random scheme, spectrum allocation is randomly performed.
Figure 3 shows the average end-to-end throughput of the transmission between the source and destination versus the harvested energy of the relays.The curves show that the average throughput increases as the harvested energy increases.The two proposed schemes obtain higher throughput than the optimally unrelated scheme and the random  scheme.Observe that scheme 1 provides more throughput than scheme 2. That is because scheme 1 considers more routes and has more chances to select the route with a higher successful-transmission probability.
In Figure 4, we investigate the relation between the average delay and the harvested energy of the relays.The curves show that delay in the schemes decreases as the harvested energy increases.This implies that, for the large amounts of harvested energy, the relays are able to harvest it quickly, and they easily have enough energy to forward the data; hence, the source gets more opportunities to choose the best route with minimum delay.The curves in Figure 1 also verify that the proposed schemes outperform the other two methods.However, the delay in scheme 1 is longer than that in scheme 2. This is due to the fact that scheme 1 has to face the energy-constrained problem of the relays when it selects insufficient-energy routes.That induces more delay if the insufficient-energy relays do not recover in time.
Figure 5 shows the relation between the average throughput/delay ratio and harvested energy of the relays.The curves show that Γ increases as    ℎ increases.According to Figure 3 and Figure 4, the throughput/delay ratio in Figure 5 shows the effectiveness of the two proposed schemes, as compared with the two other schemes under different amounts of harvested energy by the relays.
Figure 6 shows the relation between energy efficiency and the harvested energy of the relays.It is obvious that energy efficiency increases as the harvested energy of relays increases.This is because the source has more chances to select the most efficient route.The energy efficiency in Battery capacity e ＝； (energy units) scheme 1 is the greatest among the others.The curves prove the greater efficiency of the proposed schemes, as compared to the other two methods.
Figure 7 shows the relation between average throughput and the battery capacity of the relays.We can see that average throughput increases with a larger battery capacity of the relays.The higher throughput can be obtained because the source can select the best routes more times thanks to the higher capacity of the relays.
In Figure 8, the relation between average delay and the battery capacity of the relays is shown.It is obvious that the delay decreases as the battery capacity of the relays increases.It is because using the best routes several times provides less delay.Battery capacity e ＝； (energy units) Battery capacity e ＝； (energy units) Proposed scheme 1 Proposed scheme 2 Optimally unrelated scheme Random scheme Similarly, the relation between average throughput/delay ratio versus the battery capacity of the relays is shown in Figure 9.It is observed that a higher battery capacity of relays can provide better quality.Besides, the curves show the effectiveness of the proposed schemes with various levels of battery capacity.
In Figure 10, the relation between energy efficiency and the battery capacity is shown.Intuitively, using a higher battery capacity can give higher energy efficiency in the network because the source deals with the less energyconstrained problem.
Figure 11 shows average throughput/delay ratio against the number of jammers.We find that when the number of jammers increases, the achieved throughput decreases.This is because as more relays attack on channels, the chosen routes become less secure.That results in low network performance.
In order to confirm the energy efficiency of the proposed schemes versus the number of jammers, simulation results in Figure 12 are presented.In this case, the energy efficiency of the schemes decreases as the number of jammers increases.Nevertheless, the curves show that the proposed schemes obtain higher energy efficiency than the other schemes with different numbers of jammers in the network.
In general, the two proposed schemes provide higher efficiency on network performance, compared with the other schemes.More particular, scheme 1 is superior to scheme 2 in terms of end-to-end throughput and energy efficiency.However, scheme 1 causes more delay than scheme 2.

Conclusion
In this paper, we considered a multihop, multichannel data transmission between two secondary users in a CR network in which the source cooperates with relays to transfer data to the destination under jamming attacks.The energyconstrained problem in a CR network was taken into account.Hence, we proposed two novel schemes using energyharvesting technique to allocate the best relays and channels over hops to transfer the number of data frames from the source to the destination.Simulation results were provided to prove the efficiency of the proposed schemes compared to an optimally unrelated scheme and a random scheme.Finally, the simulation results confirmed that good network performances can be obtained by applying the proposed methods to MHCRNs in the presence of the jamming attack.

Figure 1 :
Figure 1: An example of source and destination SU pair in the multihop and multichannel cognitive radio network under jamming attacks.

StartFigure 2 :
Figure 2: A flowchart of the proposed algorithm.

Figure 4 :
Figure 4: Average delay according to the harvested energy of relays.

Figure 5 :Figure 6 :
Figure 5: Average throughput/delay ratio according to the harvested energy of relays.

Figure 8 :
Figure 8: Average delay according to the battery capacity of relays.

Figure 9 :
Figure 9: Average throughput/delay ratio according to the battery capacity of relays.

Figure 10 :
Figure 10: Average energy efficiency according to the battery capacity of relays.

Figure 11 :Figure 12 :
Figure 11: Average throughput/delay ratio according to the number of jammers.
of relay R in route  ,, .It also means that the relay R has with the number of successful energy-harvesting time slots ℎ  within