A NEW SPECTRUM AND ENERGY AWARE ROUTING PROTOCOL IN COGNITIVE RADIO SENSOR NETWORK

ABSTRACT: Cognitive radio sensor network (CRSN) is a new generation of communication systems that wants to solve the overcrowded spectrum utilization of the unlicensed bands. It has combined sensor networks and cognitive radio technology, so it has the challenges of energy restriction of sensors and also dynamic spectrum access of the cognitive radio network. On the other hand, considering both of these challenges in the routing protocol plays a basic role in network performance and we canâ€™t apply the routing protocols that have been proposed for wireless sensor networks and cognitive radio networks, separately, in the CRSN. Therefore, this article has tried to provide a new spectrum and energy-aware routing protocol in which the source is able to choose the most stable route in the aspect of node residual energy or spectrum access probability. Not only can considering the nodal residual energy and spectrum access in the route discovery process avoid repetitive link failure, but it also can increase the network lifetime. This protocol has been compared with ESAC, SCR, ERP, and SER. The result of this comparison has shown that our protocol reduces end-to-end delay, control overhead, throughput, and lifetime in comparison to other protocols, especially in small-scale networks. 
ABSTRAK: Rangkaian sensor radio kognitif (CRSN) adalah generasi baru sistem telekomunikasi bagi menyelesaikan masalah kesesakan pada pemakaian band spektrum tidak berlesen. Ianya adalah kombinasi rangkaian sensor dan teknologi radio kognitif. Oleh itu, ia mempunyai cabaran sekatan tenaga pada sensor dan kemasukan spektrum secara dinamik pada rangkaian radio kognitif. Pada masa sama, dengan mengambil kira kedua-dua cabaran pada protokol rangkaian ini telah memainkan peranan asas pada prestasi rangkaian dan kami tidak boleh mengguna pakai protokol rangkaian yang telah diguna pakai pada rangkaian sensor tanpa wayar dan rangkaian radio kognitif secara asing dalam CRSN. Oleh itu, artikel ini cuba menyediakan spektrum baru dan pengawasan tenaga pada protokol rangkaian, di mana sumber boleh memilih laluan rangkaian yang stabil dengan mengambil kira pada aspek baki tenaga  nod atau kebarangkalian akses spektrum. Selain itu, ianya dapat mengelakkan kegagalan laluan berulang juga menambahkan jangka hayat rangkaian. Protokol ini telah dibandingkan dengan ESAC, SCR, ERP dan SER. Perbandingan keputusan menunjukkan protokol ini mengurangkan kelewatan hujung-ke-hujung, mengawal kesesakan, mambaiki jumlah penghantaran dan menambah tempoh hayat berbanding protokol lain, khususnya pada rangkaian skala kecil.


A NEW SPECTRUM AND ENERGY AWARE ROUTING PROTOCOL IN COGNITIVE RADIO SENSOR NETWORKS
SARA MOSHTAGHI AND SAYYED MAJID MAZINANI * ABSTRACT: Cognitive radio sensor network (CRSN) is a new generation of communication systems that wants to solve the overcrowded spectrum utilization of the unlicensed bands.It has combined sensor networks and cognitive radio technology, so it has the challenges of energy restriction of sensors and also dynamic spectrum access of the cognitive radio network.On the other hand, considering both of these challenges in the routing protocol plays a basic role in network performance and we can't apply the routing protocols that have been proposed for wireless sensor networks and cognitive radio networks, separately, in the CRSN.Therefore, this article has tried to provide a new spectrum and energy-aware routing protocol in which the source is able to choose the most stable route in the aspect of node residual energy or spectrum access probability.Not only can considering the nodal residual energy and spectrum access in the route discovery process avoid repetitive link failure, but it also can increase the network lifetime.This protocol has been compared with ESAC, SCR, ERP, and SER.The result of this comparison has shown that our protocol reduces end-to-end delay, control overhead, throughput, and lifetime in comparison to other protocols, especially in small-scale networks.

INTRODUCTION
The huge growth of the wireless services during the past few years has resulted in many spectrum scarcity challenges.In order to improve usage in the face of these challenges, cognitive radio (CR) has emerged as the next generation of wireless communication systems.The idea for Cognitive radio technology was developed by Mitola [1] for the first time and defined as a form of wireless communication in which a user can intelligently sense and analyze its environment and choose the best transmission strategy.In other words, the unlicensed or secondary user (SU) can detect the available empty wireless spectrum which is owned by a licensed or primary user (PU) and then opportunistically exploits it without interference to the PUs.To avoid any interruption to PUs, the unlicensed user must be able to sense the channel correctly and make sure that it is vacant.Furthermore, the SU has to leave the channel as soon as the PU begins its activity in it.Though dynamic spectrum allocation in CR networks can improve the efficiency spectrum, it can create many challenges in routing and quality of service.Spectrum awareness is one of the main challenges in these networks [2,3] and it should be considered in the routing protocol of CR networks.Ignoring the spectrum access probability of SUs may cause many route failures and consequently, impose a lot of overhead and delay on the network.Today, wireless sensor networks (WSNs) are put to use in many applications such as area monitoring or healthcare monitoring.Sensor nodes are mainly supplied with energyconstrained batteries.So, resource limitations are the main challenge for the lifetime of this network.The energy depletion happens when the nodes communicate with each other.Reaching to the lowest allowed nodal energy level, that node cannot participate in subsequent data delivery and so is named a dead node.A dead node can badly affect the efficiency of the network.It can cause many problems such as link failure, delay in data delivery, further energy consumption, and more [4].Therefore, it is necessary to pay attention to nodal energy in the routing protocol.A lot of studies have been carried out in the WSN field focusing on the energy of sensor nodes.In most of these works, different routing protocols have been suggested for a variety of wireless networks, including wireless sensor networks (WSNs), wireless mesh networks (WMNs), and mobile ad-hoc networks (MANETs) [5], but only a few works have considered CR features in routing wireless networks [6][7][8].
In this paper, we have proposed a new routing protocol considering spectrum and energy awareness in cognitive radio sensor networks (CRSN).The source node in our protocol can choose the route that is the most stable in the aspect of nodal residual energy or spectrum access.This means that route selection is done so that its nodes have more residual energy for sending data and this causes the nodes' energy to last much longer, In other words, there are fewer dead nodes.Link failure will thus be reduced and consequently, throughput and lifetime will be increased.Also, choosing the route with the most spectrum access improves the quality of the route and decreases link failure.So, our routing protocol improves the quality of service (QoS) such as throughput, end-to-end delay, overhead… especially in some small-scale networks.
In general, small scale WSNs (SS-WSNs) are used for surveillance in small areas.They are deployed in industry to control machines, in smart homes to control electrical appliances, and in healthcare [9].In the small-scale area, flat-based routing is more suitable than hierarchical-based in some aspects.For example, forming clusters and then starting routing takes more time than route discovery in the flat routing protocol.
The rest of the article is organized as follows: in section 2, we introduce some related works.Subsequently, in section 3 we present our system model and its assumption.In section 4, we explain our routing protocol in detail.The simulation performance results and comparison are presented in section 5. Finally, we conclude the paper in section 6.

RELATED WORK
Routing for CR ad hoc networks is mainly divided into three types: on-demand routing (Reactive), table-driven routing (Proactive), and hybrid.In proactive routing, all routes are discovered and kept even if they are not needed.For this purpose, a periodic message is required to be sent for updating the route table.This causes lots of overhead.An example of this type is dynamic source routing (DSR) [10] protocols.In reactive routing protocols, routes discover and compute only if they are demanded.Eliminating the periodic message in this type has resulted in a reduction of overhead and bandwidth usage.Perhaps the most common and important of these protocols is ad hoc on-demand distance vector (AODV) [11].This protocol consists of two phases of route discovery and route maintenance.Hybrid routing is a combination of the two mentioned protocols.
Routing also can be divided into three categories depending on the network structure: flat-based, hierarchical-based and location-based [12].In flat-based routing, nodes are distributed uniformly through the network and they have the same role.In the hierarchical structure, the network forms clusters so that nodes play different roles.For example, the nodes with more residual energy are selected as the cluster head.This energy consumption will be reduced in the large-scale network.However, this routing method also has some drawbacks such as complexity, delay (as mentioned before), and too much overhead of clustering, that cause some flat routing protocols to act better than hierarchical ones, especially in the small-scale network.
Routing in CRSNs has many challenges.On one hand, energy constraint in wireless sensors supplied by batteries should be considered and on the other hand, it is a problem of dynamic spectrum access of cognitive radio.Also, improvement of quality of service parameters is attempted.Many studies in recent years have proposed to solve the challenges of routing in cognitive radio and wireless sensor networks separately.But only a few works have been done for the challenges of CRSNs.
ESCA [13] is an event-driven spectrum-aware clustering routing protocol.Clusters just form when an event happens and they are kept until all data about the event is sent to the sink.The routing process has tried to maximize the available channel between each node and its one-hop and two-hop neighbours.Though spectrum access is considered in this routing protocol, ignoring nodal energy increases route failure and it imposes a delay on the network.
In SCR [14] a cluster-based spectrum aware routing protocol is proposed.It is not event-driven and clusters are created and kept when the network begins to work until it is dead.Even though energy and spectrum access are considered in this protocol, keeping clusters during the simulation period imposes much energy consumption to the network and so this protocol is not suitable for WSN networks in which sensors are supplied with batteries.
Energy-aware event-driven routing protocol (ERP) [15] forms clusters in a reactive manner.This protocol makes energy consumption less than SCR and ESCA because of its on-demand feature.Also, it is spectrum-aware, which leads to less end-to-end delay and also increases throughput due to decreased route failure.This approach is based on clustering and as mentioned above, clustering especially for small-scale networks is too complex and imposes more delay for route discovering.Furthermore, energy consumption may be a need in some clustering routing protocols.
The spectrum and energy aware routing protocol SER [16] is a routing protocol which is proposed for cognitive radio networks.It is based on DSR protocol and selects a route in which the nodal minimum residual energy is higher and has the minimum hop count.Considering just the node with the minimum energy in selecting the route and neglecting other nodal energy frequently increased link failure probability.For example, we suppose the route is selected with this metric and link failure happens during data sending duration.If local reparation, which is discussed in this article, is used, the same nodes participate in the route again and because we don't consider their energy, each time a new route failure may happen.

Assumptions of Our Routing Protocol
We have assumed a wireless sensor network in which SUs are sensors with cognitive radio capability that are uniformly distributed.SUs and PUs simultaneously exist in this network but functional details of PUs are not considered.Each SU can access different channels depending on its position and time.The state of a channel can be obtained from one of the sensing approaches, for example [17][18][19].The details of this are beyond the scope of our work.
We have considered that each SU knows its (x, y) location with localization protocols such as GPS or any other ones [20,21].Also, the fixed location of the sink is known for all of the SU sensors.Therefore, each node can figure out the distance between itself and the destination.
We have supposed that SU knows its own current residual energy as well as residual energy, location and free available channels of its one-hop and two-hop neighbours [22].Also, it can calculate the minimum PU appearance probability (Pmin) for all the common channels between itself and its neighbour using [15,23,24].We also have considered that each time that PU begins to use the channel, it sends a public announcement message that every SU that is in the transmission range of the PU will hear and will be aware of how long the channel is busy.This protocol is a new version of AODV routing protocol and as mentioned above, because of the elimination of the periodic beacon messages that are sent for updating table routes, overhead is reduced in this kind of routing protocol.
The proposed protocol can be employed both in multi-route and single-route routing.In multi-route routing, data packet fragments are transmitted through different routes and therefore, the end-to-end delay is decreased.In single-route routing, it is possible to choose only one route from among the discovered routes to send the data and the other ones are reserved as backup routes.In this approach, single-route routing is simulated.
We consider N number of CR sensors and that each CR user has access to L+1 data channel(s).From among these channels, L belongs to the PU while SUs opportunistically use it and 1 channel is used as the common control channel which is available only to the SUs, that is, the PU is not permitted to use it.[16] It has been assumed that each SU has access to the available license channels via CSMA/ CA protocol.From the viewpoint of SU, the channel has three states:

ON: is used by PUs or other SUs
Temporarily ON: The channel is temporarily used by an SU.This channel might be used for data transmission on a specific link.[16] Two kinds of control data packets are sent for route discovery including route request (RREQ) control data packet and route reply (RREP) packet.Another control packet that is called a route error (RERR) is used when link failure happens.
We will explain the proposed routing process in two phases: route discovery and route maintenance.Route discovery also includes two processes: route request and route reply.

Route Request:
When a source node has a data for the sink, it needs to discover a route to the sink.So the source starts the routing process by filling a control packet, which is called route request (RREQ), and its field is shown in Table 1.When the fields of the packet are filled, the source sends the packet to all of its competent one-hop neighbours and this process is repeated until the packet is received by the sink.For example in Fig. 1 node A is the source node and node S is the sink.

123
B is one of the competent neighbours of A if it satisfies the Eq. ( 1) and Eq. ( 2): Eq. ( 1) means the residual energy of node B should be more than a determined minimum threshold energy (Eth) for receiving the request packet from node A. In other words, by Eq. ( 1) we can eliminate the nodes with too little residual energy from participating in the route.Consequently, the probability of link failure and overhead are decreased and the network lifetime is improved.Also, by knowing the location of the sink and its neighbour, each node can figure out the Euclidean distance of itself and its neighbour to the sink (DSA, DSB) .So, node B should be nearer to the sink than node A to be considered as the competent neighbour.In Fig. 1 we can see that node B is a competent neighbour but node N and R are not.Because node N is farther from the sink than node A and also the residual energy of node R is lower than the threshold level.
Eq. ( 2) avoids making a loop and also reduces end-to-end delay.Each relay node that receives the packet changes some parts of the fields by its information and sends it, as mentioned above, to its competent neighbours.These changes in fields of request packet are explained in detail as follows: • The source node S initiates to make an RREQ packet and at the same time sets a timer.This timer is going to measure the time of route discovery.
• Node S puts its residual energy in the field of SEres.Each node that receives the RREQ packet sums its residual energy (EC) with the current number of the field SEres and puts it in this field again.Thus, when the RREQ packet gets to the sink, it can calculate the sum of the residual energy of all nodes in every route.
• As mentioned above, each node is aware of its neighbours' free channel.So if there are more than one common free channel between RREQ sending and receiving nodes, the sending node should choose a common channel that has the minimum PU appearance probability (P).In this way, the probability of link failure will be decreased during the sending data period and consequently, due to avoiding reroute, end-to-end delay and energy consumption will be reduced.Moreover, throughput and network lifetime will be increased.After choosing a channel for sending the RREQ packet, the sending node compares the (P) of that channel with the amount of field (min) in the RREQ packet and if it is smaller ( ≤ min), supersede with the amount of field min ( = min) and if it isn't, it will remain with no changes.Thus when the sink receives the RREQ packet, it can calculate the (min) in every route separately.
• Each time the RREQ packets are sent, one unit is added to the hop count and it is brought in the (HC) field of RREQ packet.
This process has been shown in Flowchart 1 for node C in route1.

Route Reply
After receiving the first request packet, the destination starts a timer and receives RREQ packets until the timer expires.It is assumed that the sink gets the most Q packets and discards the rest even if the timer expires.The sink is responsible for averaging the residual energy of all nodes in the route by Eq. ( 3).
In other words, AE is the approximate average of nodal energy in the route.So for every route, there is a unique AE and  ̅ min.The sink should create a packet which is called route reply (RREP) for each route and AE and  ̅ min of each route are considered separately in the RREP packet of that route.The fields of this packet are shown in Table 2. RREP packet of each route sends back through that route to the source node (S).The intermediate nodes in the route get the RREP packet and change it with their information.Some of these important changes have been stated in the following: • Each relay node that receives the RREP packet compares its residual energy (EC) with the amount of field AE.If it is lower than AE, then the node adds one unit to the amount of field Ne (with zero initial value).It can be seen in Flowchart 2. When the RREP reaches to the source node (S), the amount of the Ne field shows the number of nodes in which their residual energy are lower than average energy of all nodes through the route.In other words, this shows the number of nodes of which residual energy is in crisis situation.In this way, we pay attention to the energy of each node in the route separately.
• When the RREP packets reach the source node, (S), the required time for the route discovery is written in the packet of that route by the source.After the time of receiving the first RREP packet, the source waits until the next T time and gets all the RREP packets which reach in this time span and after that, each RREP packet reached is discarded.
• After receiving all the RREP packets, the source should calculate Ne ̅̅̅̅ for every packet using Eq. ( 4).This parameter (Ne ̅̅̅̅ ) shows the stability of the route in the aspect of residual energy of all nodes in that route.Lower Ne ̅̅̅̅ causes less route failure probability and more stability of the route; so it improves the throughput and the lifetime of the network.Note that N=Hop count (HC).
As said before, the min for each route is available in the RREP packet of that route.More min causes more stability and less link failure probability in that route and so it increases the throughput of the network.Also, it reduces end-to-end delay because of eliminating extra rerouting processes.

Selecting Route
Finally, a route should be chosen from all of the discovered routes [25].Selection of a route depends on the priority of the source node(S) and it is done using Eq. ( 5).
The selecting route process is done as follows: • If the source (S) node wants to choose a more stable route from the aspect of channel access, it should choose 0.5 <  ≤ 1 first and then calculate Ui for all of the discovered routes.The route which has the maximum amount of Ui is selected.(if  = 1, only  ̅ min is important).
• If the source prefers to choose the more stable route from the aspect of residual energy of all its nodes, it should consider 0 ≤  < 0.5 and then the route with the maximum amount of Ui is selected for sending data.(if  = 0 ,so just  ̅̅̅̅ is important for the source) • If two factors of channel access and residual energy of nodes are equally important for the source, α should be considered 0.5 and then selected the maximum amount of Ui.
• So the route with the maximum amount of Ui is selected and the other discovered routes are kept as backup routes.
• After selecting route (i), the data packet should be sent through that route (i).The Troute should be inserted in the data packets.
For example, in Fig. 1, we suppose that for the source node (S) two routes to the destination have been discovered.
If we consider that both nodal residual energy and channel access are equally important for the source node, it should choose  = 0.5 .As one can see, the amount of metric U for the route 1 and 2 are 0.73 and 1.35, respectively.So the source should choose route 1 for sending data.This process is shown in Flowchart 2 for source node S in route 1 and with  = 0.5.
Flowchart 2: Selecting the route for the source node.
One can see that the most stable route in the aspect of energy and spectrum access has been selected.In this approach, by considering the residual energy of all nodes participating in a route, the probability of complete depletion of nodal energy during sending data is reduced.Consequently, link failure and the necessity for rerouting is lower, and then delay and energy consumption are decreased and throughput and lifetime are increased.The selected route has the minimum precedence probability of PUs, so it can improve throughput and delay too.

Route Maintenance
Link failure can have several reasons such as starting activity of PUs in the channel, channel inaccessibility, energy exhaustion of nodes, node mobility, etc.The sender node becomes aware of the failure when it does not receive the ACK message.For instance, if the link fails while node A is transmitting a packet to node H, node A does not receive the ACK message of packet delivery to node H.In this situation our protocol has proposed: Node A should understand why link failure has happened.
• If the link failure is for the sake of the appearance of PU in the channel, the SU will sense it by sensing method and as it was supposed, it can predict how long it takes for PU to regain the channel.Therefore, it searches between its one-hop neighbours to find a shortcut route that with one additional node gets to node B. In Fig. 2 one sees both nodes P and Q can join nodes A and B. For choosing between route A-Q-H and A-P-H node A should do the Eq. 5 and choose the shortcut route which has the maximum Ui.For this point, A should get the amount of Pmin and (Ne ̅̅̅̅ ) for each route by knowing about its one-hop neighbours and their channel, as mentioned before.After selecting the shortcut route, sending data continues through that route.
As our approach has considered the residual energy of each node in the route, merging the shortcut route with the original selected route makes the most stable route again.
Fig. 2: The example of route maintenance for SUs in our protocol.
• If the link failure is because of energy depletion of node H, node H is dead, so node A cannot utilize the first approach.In this situation, node A searches between its two-hop neighbours to find a shortcut route to get to node I.As one can see by using the shortcut route A-Q-T-I node A can send its packet through route 2 again.Like approach1 if there is more than one shortcut route to node I, node A should select the route with the maximum Ui.
• We consider that link failure has been created by the PU's activity and there is not any shortcut route to retain route.As mentioned before, in the route discovery process, needed time for discovery has been calculated and has been included in the data packet.When PU starts its activity in the channel node, node A will know how long PU will stay in the channel.So it compares the time (which should be waiting to regain the channel) with a required time of route discovery Troute (as included in the data packet).If the waiting time is less than that of Troute, it keeps the packet until the PU leaves the channel so that node A can restart its activity and transmit the packet.However, if waiting time is more than Troute, node A will discard the packet and will send the route error (RERR) packet back to the source to notify it of link failure and to restart route discovery.
• If the link failure is not caused by PU's activity, node A will send the packet to node H for K times, and if it still does not receive the ACK message, it will send the RERR packet for the source in order to use the backup route or even restart route discovery.As mentioned before, in the selecting route process, when one route is selected among all the discovered routes for sending data, another route among all discovered routes, which has the most Ui is used as the backup route.

PERFORMANCE EVALUATION
Our protocol was compared with ESAC and SCR and ERP and SER.Firstly, our protocol is designed for small-scale areas (smart home, healthcare,) and in these areas, it improves the performance of the network.Secondly, as mentioned before, clustering, especially for the small-scale networks, is too complex and imposes more delay for route discovery.Also, energy consumption may be needed in some clustering routing protocols.So, in the aspect of quality of service parameters such as delay and overhead our protocol is better than ESAC and SCR and ERP especially in small-scale areas.

Simulation Setting
We intend to simulate a square area in which M stationary PUs are uniformly active.Table 3 illustrates the simulation configuration parameters.Each PU operates on L channels.The details of the PU operation are not within the scope of this paper.However, the PU operation is modelled on the ON/OFF process.If the PU occupies a channel it is in ON state while the SU cannot access the channel.The SUs can utilize the channel only when PUs is in OFF state and the channel is free.As it was mentioned, we assumed each time PU appears in the channel, that the node SU that is in the PU's sensing range can be aware how long it stays in the channel (the PU is ON).The CR users have the same rate of message generation with exponentially distributed random intergeneration time.The transmission and receiving energies for the data packet are 6.6 and 4.6 respectively, and for the control packet they are about 0.75 mg and 0.52 mg, respectively.We compared our protocol with ESAC and SCR and ERP using the following metrics [15]: • Packet delivery ratio: the total number of packets received at the sink to the total number of packets sent from all the source nodes during the simulation.• Network throughput: the total number of bytes received at the sink per unit time.
The higher amount of these two metrics shows more reliability of the routing protocol and better performance of the network.
• End-to-end delay: the time a message takes from its generation to the final arrival at the sink.At the end of the simulation, we should take the average end-to-end delay for all packets which are received by the sink.The lower this metric, the less link failure and better quality of routing protocol.• Network lifetime: the time between the start of the simulation to the moment the first node energy exhausts and dies.More amount of this metric declares less energy consumption of network.Also, it shows better performance of the routing protocol.• Normalized routing overhead: the number of transmitted packets except for data packets (control packets, beacon packets, etc...) to the total number of the delivered packets to the destination.

Simulation Results
Figure 3(a) shows the Packet delivery ratio variation.It is obvious that with increasing level of PU, occupancy delivery ratio has decreased for each of the five protocols.As one can see SER and ESAC have the minimum delivery rate because they have not considered the PU appearance in the channel during the route selection.Our approach and ERP and SCR have considered PU activity and so, they nearly have the same high delivery rate.Figure 4(a) has shown an increasing number of SU causing a drop in delivery ratio.Also in our protocol, variation in rate until 180 secondary users are nearly fixed and a bit higher than others.But with increasing the number of SU from 180, delivery rate suddenly decreases and gradually its rate falls below other protocols.
Figure 3(b) displays the comparison of throughput among the five protocols.SER shows less throughput than others.Since the route selection process in this protocol may cause frequent route failure, the throughput of ESAC is better than SER.But still, it is much lower than the other three protocols.ERP, SCR and our protocol have better performance.In a lower number of PUs, our protocol has better performance.As one can see in Fig. 4(b), with increasing the number of SUs, throughput will be decreased.With a lower number of SUs, the throughput of our protocol is better than others.
Figure 3(c) has compared end-to-end delay with increasing PU in five protocols.As it is obvious, our protocol and ERP and SCR act nearly the same.While due to considering PU activity of route selection, they are much better than SER and ESAC.As it can be seen in Fig. 4(c), in a lower number of SU, the delay of our protocol is much less than other protocols.In SER and ESAC, the appearance probability of PU in the route discovery process has been neglected.Also in SER protocol, energy consideration is done in a way that causes frequent route failure and imposes too much delay on the network.It is also a driven-table protocol so it naturally has a high delay.In SCR, however, it has noted PU activity in route discovery, but clusters are created in the whole time of simulation even if no event has happened and it is the main reason that SCR has more delay than ERP.It can be seen in the lower number of SU that our protocol has less delay than ERP.Because clustering in ERP is too complex and causes more delay than flat routing.
The comparison of network lifetime in five protocols is displayed in Fig. 3(d).We can see that with increasing the occupancy percentage of the PU, the network lifetime has decreased but meanwhile, our protocol and ERP have outperformed the others.In Fig. 4(d) we show that our protocol in the lower number of SUs has a higher lifetime than other protocols.Being aware of energy as well as considering PU activity in our protocol causes less route failure and consequently, less retransmission or rerouting.Therefore, it has less nodal energy consumption.Also, maintaining the route in our protocol is such that it has the minimum energy consumption.In other words, energy balancing, which was considered in selecting the route in our protocol, leads to increased network lifetime.Another reason that ERP and our protocol have better network lifetime is that nodes with lower energy than the threshold of energy cannot participate in the routing process.

CONCLUSION
In this paper, we have proposed a new routing protocol considering spectrum and energy awareness in cognitive radio sensor networks (CRSN).The protocol tries to choose the most stable route in the aspect of nodal residual energy or spectrum access probability for sending data.As can be seen in section 5 of this paper, our proposed protocol has improved the quality of service parameters such as delay and throughput.This is mainly because our protocol considers the energy of all nodes participating in the route.Also, it pays attention to spectrum access probability of each node in the route.Finally, we believe our protocol, especially in a small area, can be useful and it can improve the performance of the network.

Fig. 1 :
Fig. 1: The example of routing for SUs in our protocol.

Table 2 :
The fields of RREP packet.