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

Authors: Pham-Duy Thanh; Hiep Vu-Van; Insoo Koo
Journal: Security and Communication Networks
 (2018)

---

## Abstract

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 in MHCRNs. 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.


---

## Body

## 1. 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–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 Section2, 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.


## 2. 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 energy-harvesting 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 energy-constrained 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 (S), a destination (D), N relays R=Rf∣f=1,2,…,N, and M jammers J=Ji∣i=1,2,…,M. For the sake of simplicity, we assume that both S and D 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, eca.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 areQ free channels C=Ck∣k=1,2,…,Q 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.Figure1 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, Rt. 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.Figure 1
An example of source and destination SU pair in the multihop and multichannel cognitive radio network under jamming attacks.


### 2.1. Random Channel Switch Model of Jammers

In the paper, jammers independently attack channels, and each jammer can only attack one channel in specific time slott within its jamming range, Rj. 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 Ji attacks channel C1 at time slot t, it may either switch to attack channel C2 or keep attacking channel C1 at time slot t+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 channelCk follows a Gaussian distribution:(1)PJiCk=12πσi2e-ICk-μi2/2σi2,where μi and σi2 are the channel-jamming index mean and channel-jamming index variance, respectively, of jammer Ji, and ICk represents the index of channel Ck.


### 2.2. 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:(2)ehRf=ε,withprobabilityPhRf0,withprobability1-PhRf,where ε represents the total amount of energy successfully harvested by relay Rf. PhRf is the probability of energy successfully harvested by relay Rf.In this paper, the time for completing the transmission of a data frame is referred to as the frame time,Tfr. 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 Nts 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 Rf after one frame time will be given as(3)eh,NkRf=εhs, where hs denotes the number of time slots successfully harvested during Nts 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 Rf, which belongs to chosen route rj∗ for data frame Fj at the beginning of Tfrjth, can be expressed as(4)E0,jRf=minE0,j-1Rf-es-et+eh,NkRf,eca,∀Rf∈rj∗, where E0,j-1Rf represents the updated energy of relay Rf at the beginning of frame time Tfrjth-1; es, et, and eca 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 rj∗ for data frame Fj at the beginning of Tfrjth is given by(5)E0,jRf=minE0,j-1Rf+eh,NkRf,eca,∀Rf∉rj∗.


## 2.1. Random Channel Switch Model of Jammers

In the paper, jammers independently attack channels, and each jammer can only attack one channel in specific time slott within its jamming range, Rj. 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 Ji attacks channel C1 at time slot t, it may either switch to attack channel C2 or keep attacking channel C1 at time slot t+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 channelCk follows a Gaussian distribution:(1)PJiCk=12πσi2e-ICk-μi2/2σi2,where μi and σi2 are the channel-jamming index mean and channel-jamming index variance, respectively, of jammer Ji, and ICk represents the index of channel Ck.


## 2.2. 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:(2)ehRf=ε,withprobabilityPhRf0,withprobability1-PhRf,where ε represents the total amount of energy successfully harvested by relay Rf. PhRf is the probability of energy successfully harvested by relay Rf.In this paper, the time for completing the transmission of a data frame is referred to as the frame time,Tfr. 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 Nts 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 Rf after one frame time will be given as(3)eh,NkRf=εhs, where hs denotes the number of time slots successfully harvested during Nts 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 Rf, which belongs to chosen route rj∗ for data frame Fj at the beginning of Tfrjth, can be expressed as(4)E0,jRf=minE0,j-1Rf-es-et+eh,NkRf,eca,∀Rf∈rj∗, where E0,j-1Rf represents the updated energy of relay Rf at the beginning of frame time Tfrjth-1; es, et, and eca 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 rj∗ for data frame Fj at the beginning of Tfrjth is given by(5)E0,jRf=minE0,j-1Rf+eh,NkRf,eca,∀Rf∉rj∗.


## 3. 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 Psrmax. More particularly, each link of a route in Ψmax is allocated the best channel to forward data, which is denoted as a link-channel pair. That is, a link-channel pair is defined as the best-allocated 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 framesNfr (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:(6)Ω∗=r1∗,r2∗,…,rNfr∗=argmaxrj∈Ψ∑j=1Nfrτrjtrj, where Ψ=r1,r2,…,rΨ represents a set of possible routes (from source to destination); τrj and trj are throughput and delay of data frame Fj, respectively; Ω∗ including r1∗,r2∗,…,rNfr∗ represents a set of the best chosen routes for each data frame (form first frame to the total number of delivered frames), Nfr. 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.Figure 2
A flowchart of the proposed algorithm.


## 4. 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 link-channel 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, Srlvr,Cklvr, and a set of corresponding maximum successful-transmission probabilities, Psrmax. lvr and Cklvr represent the link of route r and the best chosen channel for link lvr, 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 usern is attacked by jammer Ji on channel Ck is PJi(Ck,n)=PJi(Ck) if user n is located within jamming range of jammer Ji. Otherwise, Ji cannot attack user n due to the jamming range limitation, that is, PJi(Ck,n)=0. The probability that user n will not be jammed by Ji on channel Ck is given by(7)PJ¯iCk,n=1-PJiCk,n,where users n∈S,D,Rf, Ck∈C, and Ji∈J. The probability of user n not being jammed on channel Ck (i.e., the probability that there are no jammers in the area that can attack user n on channel Ck) is expressed as(8)PJ¯Ck,n=∏i=1MPJ¯iCk,n.The probability of successful transmission on channelCk for link l that can establish a connection between two users, a and b, is then defined as(9)Psl=PJ¯Ck,aPJ¯Ck,b,where a,b∈S,D,Rf and Ck∈C. The probability of successful transmission for route r is thus given by(10)Psr=∏∀lv∈r,v=1rPslv,Γlv≤Rt,where lv is the link of route r, r is the number of links on route r, and Γlv represents the length of link lv.At the beginning of data frameFj, the source will update the energy of all relays E0,jRf=E0,jR1,E0,jR2,…,E0,jRN. According to the updated information, we can determine the corresponding energy of the relays that belong to each individual route, rm, as follows:(11)E0,jRfrm=E0,jR1rm,E0,jR2rm,…,E0,jRrmrm, where rm represents the total number of relays in route rm. The notation · indicates that the index of each relay is arranged in ascending order of each relay in route rm. A set of successful-transmission probabilities for all possible routes in Ψmax is defined as(12)Psrmmax=Psr1max,Psr2max,…,PsrΨmaxmax, 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.


### 4.1. 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 insufficient-energy 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 Sr∗(lvr,Cklvr) is included, as well as a set of the corresponding maximum successful-transmission probabilities, Psrmax. lvr denotes link v of route r, and Cklvr is the best channel k allocated to link v of route r. 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,Nc, 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 Ω=Ωw∣w={1,2,…,Ω}, where Ωw=rw,u∣u={1,…,Nc}. 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Ωeh=Ωw,zeh∣z={1,2,…,|Ωeh|}, where Ωw,zeh=Ωw,z,ueh∣u={1,…,Nc} and Ωw,z,ueh=eh,w,z,uRf∣f={1,2,…,N}. Here w, z, and u represent the index of possible choices, energy harvesting cases, and considered data frames, respectively. The set of corresponding energy-harvesting probability cases is also given as ΩPeh=Ωw,zPeh∣z=1,2,…,ΩPeh, Ωw,zPeh=Ωw,z,uPeh∣u={1,…,Nc}, and Ωw,z,uPeh=Ph,w,z,uRf∣f={1,2,…,N}.If all relays in the route of frameu have enough energy to forward the data frame, the expected throughput of frame u is calculated as follows:(13)τw,z,u=Psrw,z,umaxRcTPh,w,z,u, where Ph,w,z,u=∏f=1NPh,w,z,uRf represents the energy-harvesting probability for the case (w,z,u).In case any of the relays in the allocated route of frameu does not satisfy the energy forwarding requirement (es+et), 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 t, 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 u as Ω~={R~1rw,z,u,…,R~|Ω~|rw,z,u}, where R~rw,z,u represents the insufficient-energy relay in allocated route rw,z,u. Then, the requirement for harvested energy of relay Rf for forwarding is given as(14)εR~frw,z,u=es+et-E0R~frw,z,u.The successful recovery probability of relayR~frw,z,u is computed as follows:(15)δR~frw,z,u=1-∑hs=0εR~frw,z,u-1PhR~frw,z,uhs,IR~frw,z,u, where PhR~frw,z,u(hs,IR~frw,z,u) denotes the successful energy-harvesting probability of relay R~frw,z,u with the number of successful energy-harvesting time slots hs within IR~frw,z,u time slots. Note that IR~frw,z,u is an order of relay R~f in route rw,z,u. It also means that the relay R~f has IR~frw,z,u time slots to harvest enough of the required energy for the data frame forwarding phase. The successful recovery probability of frame u is given by(16)δrw,z,u=∏f=1Ω~δR~frw,z,u.The expected throughput of frameu is calculated as(17)τw,z,u=Psrw,z,umaxδrw,z,uRcTPh,w,z,u.The throughput/delay ratio is expressed as(18)Γw,z,u=τw,z,utw,z,u, where tw,z,u=|rw,z,u| is the delay duration of the allocated route in frame u. After computing the expected throughput/delay ratio of the cases with indexes w, z, and u s.t. u={1,…,Nc}, we define the best harvested energy case, z, as follows:(19)Γw,z∗=argmaxz∑u=1NcΓw,z,u.Then, the best choice with indexw (i.e., allocated routes for each considered data frame) will be selected as(20)Γw∗=argmaxwΓw,z∗.So, now we can obtain the best choice, which is represented as(21)Ωw∗=r1∗,…,rNc∗∣r1∗,…,rNc∗∈Ψmax.Afterwards, the source will select the first allocated route in the set of considered data frames (u=1) for its current data frame. Note that frame index u 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.Algorithm 1:Multihop channel allocation scheme under attack in the physical layer.
(1) Input:  S, D, Rf, Ji, Ck, PJi(Ck), PhRf, Nc. (2) Output:  Obtain the best choice Ωw∗={r1∗,…,rNc∗}∣r1∗,…,rNc∗∈Ψmax. (3) Find Ψmax, Psrmax as Eq. ((7)–(10)). (4) Find a set of possible choices Ω=Ωw∣w={1,2,…,Ω}, Ωw=rw,u∣u={1,…,Nc}. (5) Define a set of energy harvesting cases Ωeh, Ωw,zeh, Ωw,z,ueh. (6) Define a set of energy harvesting probability cases ΩPeh, Ωw,zPeh, Ωw,z,uPeh. (7) for  w=1:Ω  do (8) for  z=1:|Ωeh|  do (9) Initialize remaining energy of relays with the initial energy at the frame time index u=1. (10) for  u=1:Nc  do (11) Update energy of relays. (12) if  ∀E0Rfrw,z,u≥es+et    // Energy of all relays in chosen route is sufficient. (13) Calculate τw,z,u as Eq. (13). (14) else (15) Define a set of insufficient-energy relays in allocated route Ω~={R~1rw,z,u,…,R~|Ω~|rw,z,u}. (16) Calculate required energy of relays in Ω~, as Eq. (14). (17) Calculate successful recovery probability of each relays in allocated route δR~frw,z,u as Eq (15). (18) Calculate successful recovery probability of allocated route δrw,z,u as Eq. (16). (19) Calculate expected throughput for frame u, τw,z,u as Eq. (17) (20) end if (21) Calculate delay time tw,z,u=|rw,z,u|. (22) Calculate throughput/delay ratio Γw,z,u as Eq. (18). (23) Calculate remaining energy of relays as Eq. (4). (24) end for (25) end for (26) Define the best index z, with Γw,z∗=arg⁡maxz⁡∑u=1NcΓw,z,u. (27) end for (28) Define the best index w, with Γw∗=arg⁡maxw⁡(Γw,z∗).


### 4.2. 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 Psrmax. Then, it defines a set of insufficient-energy relays: Ω~={R~1,…,R~Ω~}. After that, it defines a set of sufficient-energy routes, as follows:(22)Ψmax=Ψmax∖Ψ~max, where Ψ~max={r~1,…,r~Ψ~max} represents a set of insufficient-energy 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 u=1) can be selected for the next data frame transmissions; that is, u>=2, because, after the data frame time of the data frame (u=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 w, z, and u can be computed with (13).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 delaytw,z,u and throughput/delay ratio Γw,z,u for each case. Finally, the best choice, Ωw∗, 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.Algorithm 2:Multihop channel allocation scheme under attack in the physical layer.
(1) Input:  S, D, Rf, Ji, Ck, PJi(Ck), PhRf, Nc. (2) Output:  Obtain the best choice Ωw∗={r1∗,…,rNc∗}∣r1∗,…,rNc∗∈Ψmax. (3) Find Ψmax, Psrmax by using Eq. ((7)–(10)). (4) Find a set of insufficient-energy relays Ω~={R~1,…,R~Ω~}. (5) Find a set of insufficient-energy routes Ψ~max={r~1,…,r~Ψ~max}. (6) Define a set of sufficient-energy routes Ψmax as Eq. (22). (7) Find a set of possible choices Ω=Ωw∣w={1,2,…,Ω}, Ωw=rw,u∣u={1,…,Nc}. (8) Define a set of energy harvesting cases Ωeh, Ωw,zeh, Ωw,z,ueh. (9) Define a set of energy harvesting probability cases ΩPeh, Ωw,zPeh, Ωw,z,uPeh. (10) for  w=1:Ω  do (11) for  z=1:|Ωeh|  do (12) Initialize remaining energy of relays with the initial energy at the frame time index u=1. (13) for  u=1:Nc  do (14) Update energy of relays. (15) Calculate expected throughput for frame u, τw,z,u as Eq. (13). (16) Calculate delay time tw,z,u=|rw,z,u|. (17) Calculate throughput/delay ratio Γw,z,u as Eq. (18). (18) Calculate remaining energy of relays as Eq. (4). (19) end for (20) end for (21) Define the best index z, with Γw,z∗=arg⁡maxz⁡∑u=1NcΓw,z,u. (22) end for (23) Define the best index w, with Γw∗=arg⁡maxw⁡(Γw,z∗).


## 4.1. 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 insufficient-energy 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 Sr∗(lvr,Cklvr) is included, as well as a set of the corresponding maximum successful-transmission probabilities, Psrmax. lvr denotes link v of route r, and Cklvr is the best channel k allocated to link v of route r. 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,Nc, 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 Ω=Ωw∣w={1,2,…,Ω}, where Ωw=rw,u∣u={1,…,Nc}. 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Ωeh=Ωw,zeh∣z={1,2,…,|Ωeh|}, where Ωw,zeh=Ωw,z,ueh∣u={1,…,Nc} and Ωw,z,ueh=eh,w,z,uRf∣f={1,2,…,N}. Here w, z, and u represent the index of possible choices, energy harvesting cases, and considered data frames, respectively. The set of corresponding energy-harvesting probability cases is also given as ΩPeh=Ωw,zPeh∣z=1,2,…,ΩPeh, Ωw,zPeh=Ωw,z,uPeh∣u={1,…,Nc}, and Ωw,z,uPeh=Ph,w,z,uRf∣f={1,2,…,N}.If all relays in the route of frameu have enough energy to forward the data frame, the expected throughput of frame u is calculated as follows:(13)τw,z,u=Psrw,z,umaxRcTPh,w,z,u, where Ph,w,z,u=∏f=1NPh,w,z,uRf represents the energy-harvesting probability for the case (w,z,u).In case any of the relays in the allocated route of frameu does not satisfy the energy forwarding requirement (es+et), 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 t, 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 u as Ω~={R~1rw,z,u,…,R~|Ω~|rw,z,u}, where R~rw,z,u represents the insufficient-energy relay in allocated route rw,z,u. Then, the requirement for harvested energy of relay Rf for forwarding is given as(14)εR~frw,z,u=es+et-E0R~frw,z,u.The successful recovery probability of relayR~frw,z,u is computed as follows:(15)δR~frw,z,u=1-∑hs=0εR~frw,z,u-1PhR~frw,z,uhs,IR~frw,z,u, where PhR~frw,z,u(hs,IR~frw,z,u) denotes the successful energy-harvesting probability of relay R~frw,z,u with the number of successful energy-harvesting time slots hs within IR~frw,z,u time slots. Note that IR~frw,z,u is an order of relay R~f in route rw,z,u. It also means that the relay R~f has IR~frw,z,u time slots to harvest enough of the required energy for the data frame forwarding phase. The successful recovery probability of frame u is given by(16)δrw,z,u=∏f=1Ω~δR~frw,z,u.The expected throughput of frameu is calculated as(17)τw,z,u=Psrw,z,umaxδrw,z,uRcTPh,w,z,u.The throughput/delay ratio is expressed as(18)Γw,z,u=τw,z,utw,z,u, where tw,z,u=|rw,z,u| is the delay duration of the allocated route in frame u. After computing the expected throughput/delay ratio of the cases with indexes w, z, and u s.t. u={1,…,Nc}, we define the best harvested energy case, z, as follows:(19)Γw,z∗=argmaxz∑u=1NcΓw,z,u.Then, the best choice with indexw (i.e., allocated routes for each considered data frame) will be selected as(20)Γw∗=argmaxwΓw,z∗.So, now we can obtain the best choice, which is represented as(21)Ωw∗=r1∗,…,rNc∗∣r1∗,…,rNc∗∈Ψmax.Afterwards, the source will select the first allocated route in the set of considered data frames (u=1) for its current data frame. Note that frame index u 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.Algorithm 1:Multihop channel allocation scheme under attack in the physical layer.
(1) Input:  S, D, Rf, Ji, Ck, PJi(Ck), PhRf, Nc. (2) Output:  Obtain the best choice Ωw∗={r1∗,…,rNc∗}∣r1∗,…,rNc∗∈Ψmax. (3) Find Ψmax, Psrmax as Eq. ((7)–(10)). (4) Find a set of possible choices Ω=Ωw∣w={1,2,…,Ω}, Ωw=rw,u∣u={1,…,Nc}. (5) Define a set of energy harvesting cases Ωeh, Ωw,zeh, Ωw,z,ueh. (6) Define a set of energy harvesting probability cases ΩPeh, Ωw,zPeh, Ωw,z,uPeh. (7) for  w=1:Ω  do (8) for  z=1:|Ωeh|  do (9) Initialize remaining energy of relays with the initial energy at the frame time index u=1. (10) for  u=1:Nc  do (11) Update energy of relays. (12) if  ∀E0Rfrw,z,u≥es+et    // Energy of all relays in chosen route is sufficient. (13) Calculate τw,z,u as Eq. (13). (14) else (15) Define a set of insufficient-energy relays in allocated route Ω~={R~1rw,z,u,…,R~|Ω~|rw,z,u}. (16) Calculate required energy of relays in Ω~, as Eq. (14). (17) Calculate successful recovery probability of each relays in allocated route δR~frw,z,u as Eq (15). (18) Calculate successful recovery probability of allocated route δrw,z,u as Eq. (16). (19) Calculate expected throughput for frame u, τw,z,u as Eq. (17) (20) end if (21) Calculate delay time tw,z,u=|rw,z,u|. (22) Calculate throughput/delay ratio Γw,z,u as Eq. (18). (23) Calculate remaining energy of relays as Eq. (4). (24) end for (25) end for (26) Define the best index z, with Γw,z∗=arg⁡maxz⁡∑u=1NcΓw,z,u. (27) end for (28) Define the best index w, with Γw∗=arg⁡maxw⁡(Γw,z∗).


## 4.2. 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 Psrmax. Then, it defines a set of insufficient-energy relays: Ω~={R~1,…,R~Ω~}. After that, it defines a set of sufficient-energy routes, as follows:(22)Ψmax=Ψmax∖Ψ~max, where Ψ~max={r~1,…,r~Ψ~max} represents a set of insufficient-energy 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 u=1) can be selected for the next data frame transmissions; that is, u>=2, because, after the data frame time of the data frame (u=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 w, z, and u can be computed with (13).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 delaytw,z,u and throughput/delay ratio Γw,z,u for each case. Finally, the best choice, Ωw∗, 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.Algorithm 2:Multihop channel allocation scheme under attack in the physical layer.
(1) Input:  S, D, Rf, Ji, Ck, PJi(Ck), PhRf, Nc. (2) Output:  Obtain the best choice Ωw∗={r1∗,…,rNc∗}∣r1∗,…,rNc∗∈Ψmax. (3) Find Ψmax, Psrmax by using Eq. ((7)–(10)). (4) Find a set of insufficient-energy relays Ω~={R~1,…,R~Ω~}. (5) Find a set of insufficient-energy routes Ψ~max={r~1,…,r~Ψ~max}. (6) Define a set of sufficient-energy routes Ψmax as Eq. (22). (7) Find a set of possible choices Ω=Ωw∣w={1,2,…,Ω}, Ωw=rw,u∣u={1,…,Nc}. (8) Define a set of energy harvesting cases Ωeh, Ωw,zeh, Ωw,z,ueh. (9) Define a set of energy harvesting probability cases ΩPeh, Ωw,zPeh, Ωw,z,uPeh. (10) for  w=1:Ω  do (11) for  z=1:|Ωeh|  do (12) Initialize remaining energy of relays with the initial energy at the frame time index u=1. (13) for  u=1:Nc  do (14) Update energy of relays. (15) Calculate expected throughput for frame u, τw,z,u as Eq. (13). (16) Calculate delay time tw,z,u=|rw,z,u|. (17) Calculate throughput/delay ratio Γw,z,u as Eq. (18). (18) Calculate remaining energy of relays as Eq. (4). (19) end for (20) end for (21) Define the best index z, with Γw,z∗=arg⁡maxz⁡∑u=1NcΓw,z,u. (22) end for (23) Define the best index w, with Γw∗=arg⁡maxw⁡(Γw,z∗).


## 5. 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×103 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.Table 1
Simulation parameters.
Parameter Value Number of relays 7 Total number of data frames 1.5 × 1 0 3 Initial energy of relays 6 energy units Energy harvested probability 0.6 Harvested energy 2 energy units Number of considered data frames 2 Sensing energy 2 energy units Transmission energy 4 energy units Battery capacity 10 energy units Number of jammers 4 Number of channels 5 Total frame time 50 ms Cognitive radio rate 10 bits/Hz/sec Transmission range 0.4 Jamming range 0.3 Channel-jamming index meanμ 3 Channel-jamming index varianceσ2 1 Area 1 × 1 normalized unit Source position [0.1, 0.1] Destination position [0.9, 0.9]Figure3 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.Figure 3
Average throughput according to the harvested energy of relays.In Figure4, 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 4
Average delay according to the harvested energy of relays.Figure5 shows the relation between the average throughput/delay ratio and harvested energy of the relays. The curves show that Γ increases as ehRf 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 5
Average throughput/delay ratio according to the harvested energy of relays.Figure6 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 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 6
Average energy efficiency according to the harvested energy of relays.Figure7 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.Figure 7
Average throughput according to the battery capacity of relays.In Figure8, 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.Figure 8
Average delay according to the battery capacity of relays.Similarly, the relation between average throughput/delay ratio versus the battery capacity of the relays is shown in Figure9. 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.Figure 9
Average throughput/delay ratio according to the battery capacity of relays.In Figure10, 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 energy-constrained problem.Figure 10
Average energy efficiency according to the battery capacity of relays.Figure11 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.Figure 11
Average throughput/delay ratio according to the number of jammers.In order to confirm the energy efficiency of the proposed schemes versus the number of jammers, simulation results in Figure12 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.Figure 12
Average energy efficiency according to the number of jammers.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.


## 6. 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 energy-constrained problem in a CR network was taken into account. Hence, we proposed two novel schemes using energy-harvesting 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.



---

*Source: 7543212-2018-03-29.xml*