Energy-Efficient Cooperative Cognitive Relaying Protocols for Full-Duplex Cognitive Radio Users and Delay-Aware Primary Users
Ahmed~El~Shafie
~\IEEEmembership{Member
~IEEE
This paper considers a network in which a primary user (PU) may cooperate with a cognitive radio (CR) user for transmission of its data packets. The PU is assumed to be a buffered terminal operating in a time-slotted fashion. We develop two protocols which involve cooperation between primary and secondary users. To satisfy certain quality of service requirements, users share time slot duration and frequency bandwidth. Moreover, the secondary user (SU) may leverage the primary feedback signal. The proposed protocols are designed such that the secondary rate is maximized and the primary queueing delay is maintained less than the queueing delay in case of non-cooperative PU. In addition, the proposed protocols guarantee the stability of the primary queue and maintain the average energy emitted by the CR user below a certain value. The proposed protocols also provide more robust and potentially continuous service for SUs compared to the conventional practice in cognitive networks where SUs transmit in the spectrum holes and silence sessions of the PUs. We include primary source burstiness, sensing errors, and feedback reception errors to the analysis of the proposed cooperative cognitive protocols. Numerical results show the beneficial gains of the cooperative protocols in terms of secondary rate and primary throughput, queueing delay, and average energy savings.
TFS.tex


\documentclass[twocolumn,letter]{IEEEtran}
%\documentclass[12pt,journal,onecolumn,draftcls]{IEEEtran}
\usepackage[usenames,dvipsnames]{color}
\usepackage{subfigure}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{color}
\usepackage{multicol}
\usepackage{amssymb}
\usepackage{cite}
\usepackage{balance}
 \newtheorem{proposition}{Proposition}
  \newtheorem{proof}{Proof}
\begin{document}
\title{Energy-Efficient Cooperative Cognitive Relaying Protocols for Full-Duplex Cognitive Radio Users and Delay-Aware Primary Users}
\author{Ahmed~El~Shafie,~\IEEEmembership{Member,~IEEE,}
        Tamer~Khattab,~\IEEEmembership{Member,~IEEE,}\\
        Amr El-Keyi,~\IEEEmembership{Member,~IEEE,}% <-this % stops a space
        ~and H. Vincent Poor,~\IEEEmembership{Fellow,~IEEE}
\thanks{A. El Shafie is with Wireless Intelligent Networks Center (WINC), Nile University, Giza, Egypt. He is also with Electrical Engineering, Qatar University, Doha, Qatar (e-mail: ahmed.salahelshafie@gmail.com).}% <-this % stops a space
\thanks{T. Khattab is with Electrical Engineering, Qatar University, Doha, Qatar (email: tkhatta@ieee.org).}% <-this % stops a space
\thanks{A. El-Keyi is with Wireless Intelligent Networks Center (WINC), Nile University, Giza, Egypt (aelkeyi@nileuniversity.edu.eg).}
\thanks{H. V. Poor
is with the Department of Electrical Engineering, Princeton University, Princeton, NJ 08544 USA (email:
poor@princeton.edu).}% <-this % stops a space
\thanks{This research work is supported by Qatar National Research Fund (QNRF) under grant number NPRP 09-1168-2-455.}}
\date{}
\maketitle
\begin{abstract}
This paper considers a network in which a primary user (PU) may cooperate with a cognitive radio
(CR) user for transmission of its data packets. The PU is assumed to be a buffered terminal operating in a time-slotted fashion. We develop two protocols which involve cooperation between primary and secondary users. To satisfy certain quality of service requirements, users share time slot duration and frequency bandwidth. Moreover, the secondary user (SU) may leverage the primary feedback signal. The proposed protocols are designed such that the secondary rate is maximized and the primary queueing delay is maintained less than the queueing delay in case of non-cooperative PU. In addition, the proposed protocols guarantee the stability of the primary queue and maintain the average energy emitted by the CR user below a certain value. The proposed protocols also provide more robust and potentially continuous service
for SUs compared to the conventional practice in cognitive
networks where SUs transmit in the spectrum holes and silence sessions
of the PUs. We include primary source burstiness, sensing errors, and feedback reception errors to the analysis of the proposed cooperative cognitive protocols. Numerical results show the beneficial gains of the cooperative protocols in terms of secondary rate and primary throughput, queueing delay, and average energy savings.
\end{abstract}
\begin{IEEEkeywords}
Cognitive radio, rate, queue stability, optimization problems.
\end{IEEEkeywords}
\section{Introduction}
  \IEEEPARstart{S}\small{econdary} utilization of the licensed frequency bands can efficiently improve the spectral density of the underutilized licensed spectrum. Cognitive radio (CR) users are smart terminals that use cognitive technologies to adapt with variations, and exploit methodologies of learning and reasoning to
dynamically reconfigure their communication parameters.


Cooperative diversity is a recently emerging technique
for wireless communications that has gained wide interest. Recently, cooperative cognitive relaying, where the secondary user (SU) operates as a relay for the primary user (PU), has got extensive attention \cite{devroye2006achievable,simeone,simeone2008spectrum,krikidis2009cognitive,khattab,su2011active,erph,Sult1212:Cooperative,krikidis2012stability}.
% Two secondary terminals and one primary terminal are considered in \cite{veryclose} under a random access scheme.
%All nodes transmit to a single access point. The authors investigated the case of conventional spectrum sensing and opportunistic sensing where the SUs sense the channel at different times depending on the quality of the channel to the access point.
In \cite{devroye2006achievable}, the authors show that, under the assumption
that CR users know perfectly the PU's data, maximum rate can be achieved by simultaneous
transmission of primary and secondary data over the same
frequency band. The secondary data are jointly encoded with PU data via dirty-paper coding techniques.
In \cite{simeone}, the SU relays the undelivered primary packets during the silence sessions of the PU. The SU aims at maximizing its throughput via adjusting its transmit power.

In \cite{krikidis2009cognitive}, Krikidis {\it et al.} proposed to deploy a {\it dumb} relay node in cognitive radio
networks to improve
network spectrum efficiency. The relay aids the primary and the secondary users. The proposed protocol is analyzed
and optimized for a network model consisting of a pair of PUs and a pair of SUs.
In \cite{khattab}, the authors considered a network with a single primary node and a single secondary node. The SU is allowed to access the channel when the PU's queue is empty. The secondary has a relaying queue to store a fraction of the undelivered primary packets controlled via an adjustable admittance factor. A priority of transmission is given to the relayed packets over the secondary packets. The SU aims at minimizing its queueing delay subject to a power
budget for the relayed primary packets. In \cite{erph}, the authors characterized fundamental issues for a shared channel composed of a PU and an SU. The authors considered a general multi-packet reception model, where concurrent packet transmission could be correctly decoded at receivers with certain probability. The PU has unconditional channel access, whereas the SU accesses the channel based on the state of the PU, i.e., active or inactive. The sensing algorithm is assumed to be perfect. The secondary terminal is assumed to be capable of relaying the undelivered primary packets. If the PU is sensed to be inactive, the SU accesses the channel with probability one, and if the PU is active, the SU randomly accesses the channel simultaneously with the PU or attempts to decode the primary packet with the complement probability. The maximum stable throughput of the network is obtained via optimizing over the access probability assigned by the SU during the active sessions of the PU.


Leasing portions of primary systems time slot duration and bandwidth for the SUs have been considered in several works, e.g., \cite{simeone2008spectrum,su2011active,elshafie}. In \cite{simeone2008spectrum}, the authors proposed a spectrum
leasing scheme in which PUs may
lease its owned bandwidth for a fraction of time to SUs based on decode-and-forward relaying
scheme and distributed space-time coding. In \cite{su2011active}, the authors proposed a new cooperative cognitive protocol, where the PU releases portion of its bandwidth to the SU. The SU utilizes an amplify-and-forward relaying scheme. It receives the primary data during the first half of the time slot, then forwards the amplified data during the second half of the time slot. El Shafie \emph{et al.} \cite{elshafie} considered an SU equipped with multi-antenna sharing the spectrum with a single antenna energy-aware PU, where the PU aims at maximizing its mean transmitted packets per joule. The users split the time slot duration and the total bandwidth to satisfy certain QoS for the PU that cannot be attained without cooperation. Both users maintain data buffers and are assumed to send one data packet per time slot.




In this paper, we develop two cooperative cognitive protocols which allow the SU to transmit its data bits simultaneously with the PU. Under the proposed protocols, the PU may cooperate with the SU to enhance its quality of service, i.e., to enhance its average queueing delay and maintain its queue stability. If cooperation is beneficial for the PU, it releases portion of its bandwidth and time slot duration for the SU. In turn, the SU incurs portion of its transmit energy to relay the primary packets. The SU employs decode-and-forward (DF) relaying technique. The time slot is divided into several intervals (or phases) that change according to the adopted protocol, as will be explained later. In the first proposed cooperative protocol, the SU {\it blindly} forwards what it receives from the PU even if the primary destination can decode the data packet correctly at the end of the primary transmission phase. On the other hand, in the second proposed protocol, the SU forwards what it receives from the PU if and only if the primary destination could not decode the primary transmission of the primary packet; or if the SU considers the feedback signal as a negative-acknowledgement from the primary destination.\footnote{In this paper, the primary feedback channel is assumed to be modeled as an erasure channel model and can be undecodable at the secondary terminal. This will be justified in Section \ref{protocol2x}.}
%Therefore, in the first protocol, even if the packet is received correctly at the primary destination, it may be retransmitted again by the SU; hence, the energy of the SU and the channel bandwidth are both wasted without any further contribution to users' rates. In contrast to the first protocol, the second protocol saves the secondary energy to be used for its own transmission.
However, as will be explained later, there is a cost for using the second protocol which is a reduction in the time available for data transmission of users due to the presence of an additional feedback duration.


The contributions of this paper can be stated as follows: We design two cooperative cognitive protocols which involve cooperation between the PUs and the SUs. The two protocols differ in terms of time slot structure and primary feedback mechanism. We consider practical assumptions for the cognitive network. Precisely, we consider spectrum sensing errors and primary feedback reception errors at the secondary terminal. Unlike \cite{su2011active}, the primary source burstiness is taken into consideration. In addition, in contrast to \cite{su2011active} and \cite{elshafie}, sensing errors are taken into considerations.  Unlike the existing works, we consider a cost on the feedback process and study its impact on the transmitters' rates.
We consider two quality of service constraints for the PU. Specifically, we assume a constraint on the primary queueing delay and a constraint on the stability of the primary queue. Moreover, we consider a practical energy constraint on the SU average transmit energy. The optimization problems are stated under such constraints.


This paper is organized as follows: In the next Section, we introduce the system model adopted in this paper. In Section \ref{primaryqueue}, we analyze the primary queue and discuss primary queueing delay and stability. The first proposed Protocol is explained in Section \ref{protocol1x}. In Section \ref{protocol2x}, we describe the modified protocol. The Numerical Results are shown in Section \ref{numerical}. We finally conclude the paper in Section \ref{conc}.
\section{System Model}\label{sysmod}
We consider a simple configuration composed of orthogonal primary channels, where each channel is used by a PU. Each primary transmitter-receiver pair coexists with a secondary transmitter-receiver pair. For simplicity in presentation, we focus on one of those orthogonal channels.\footnote{As argued in \cite{su2011active}, the proposed cooperative cognitive protocol and theoretical development
presented in this paper can be generalized to cognitive radio networks with more
PUs and more SUs.} Each orthogonal channel is composed of one secondary transmitter `${\rm s}$', one primary transmitter `${\rm p}$', one secondary receiver `${\rm sd}$' and one primary receiver `${\rm pd}$'. The SU is equipped with two antennas; one antenna for data transmission and the other for data reception and channel sensing, whereas the PU is equipped with a single antenna. The PU maintains an infinite buffer for storing a fixed-length packets. It is assumed that the primary queue is modeled as Geo/Geo/1 queueing system. The
arrivals at the primary queue are independent and identically
distributed (i.i.d.) Bernoulli random variables from slot to slot with mean $\lambda_{\rm p}\in[0,1]$ packets per time slot. Thus, the probability of having an arrival at the primary queue in an arbitrary time slot is $\lambda_{\rm p}$.


 We assume an interference wireless channel model, where concurrent transmissions are assumed to be lost data if the received signal-to-noise-and-interference-ratio (SINR) is less than a predefined threshold, or equivalently the instantaneous channel gain is lower than a predefined value.\footnote{This will be discussed later in Appendix B.} In this paper, we propose a DF relaying technique, where the SU decodes and forwards the primary packet. The secondary terminal is assumed to be full duplex which means that it can receive and transmit at the same time.


 All nodes transmit with fixed power $P_\circ$ Watts/Hz. Note that the total transmit power changes based on the used bandwidth per transmission. Time is slotted and a slot has a duration of $T$ seconds. Channel gain between node ${\rm j}$ and node ${\rm k}$, denoted by $\zeta_{\rm j,k}$, is distributed according to a circularly symmetric Gaussian random variable, which is constant over one slot, but changes independently from slot to slot. The expected value of $|\zeta_{\rm j,k}|^2$ is $\sigma_{\rm j,k}$, where $|\cdot|$ denotes the magnitude of a complex argument. Each receiving signal is perturbed by a zero mean additive white Gaussian noise (AWGN) with power spectral density $\mathcal{N}_\circ$ Watts/Hz. The outage of a channel (link) occurs when the transmission rate exceeds the capacity of the channel. The outage probability between two nodes ${\rm j}$ and ${\rm k}$ without and with the presence of interference from the other nodes are denoted by $\mathbb{P}_{\rm j,k}$ and $\mathbb{P}^{(\mathcal{I})}_{\rm j,k}$, respectively. These probabilities are functions of the number of bits in
a data packet, the slot duration, the transmission bandwidth, the
transmit powers, and the average channel gains as detailed in
Appendices~A and B.


The PU accesses the channel at the beginning of the time slot whenever it has a packet to send. Without cooperation, the PU uses the time slot and bandwidth for its own data transmission, while the SU does not gain any channel access even if the PU's queue is empty. This is because in practice the SU may erroneously misdetect the primary activity and therefore it may cause harmful interruption on the primary operation, e.g., collisions and packets loss. In case of cooperation and based on the proposed cooperative cognitive protocols, the PU will release a fraction of its time slot duration and its bandwidth for the SU to be used for secondary operation. In practice, the secondary node may get permission to access the spectrum if it either provides economic incentives for the PU or performance enhancement incentives. In this work, we consider performance enhancement incentives.


   \section{Queue Stability, Primary Queue Model, and Primary Queueing Delay}
   \label{primaryqueue}
   \subsection{Stability}
Stability of a queue can be defined as follows. Let $Q^{\mathbb{T}}$ denote the length of queue $Q$ at the beginning of time slot ${\mathbb{T}}~\in~\{~1,2,3,~\dots~\}$. Queue $Q$ is said to be stable, if
\begin{equation}\label{stabilityeqn}
    \lim_{x \rightarrow \infty  } \lim_{\rm \mathbb{T} \rightarrow \infty  } {\rm Pr}\{Q^{\mathbb{T}}<x\}=1
    \end{equation}
 For the primary queue, we adopt a late-arrival model where a newly arrived packet to the queue is not served in the arriving time slot even if the queue is empty.\footnote{This queueing model is considered in many papers, see for example, \cite{sadek,simeone,erph} and the references therein.} Let $A^\mathbb{T}_{\rm p}$ denote the number of arrivals to queue $Q_{\rm p}$ in time slot $\mathbb{T}$, and $\mathcal{H}^\mathbb{T}_{\rm p}$ denote the number of departures from queue $Q_{\rm p}$ in time slot $\mathbb{T}$. The queue length evolves according to the following form:
\begin{equation}
    Q_{\rm p}^{\mathbb{T}+1}=(Q_{\rm p}^\mathbb{T}-\mathcal{H}^\mathbb{T}_{\rm p})^+ +A^\mathbb{T}_{\rm p}
\end{equation}
where $(z)^+$ denotes $\max(z,0)$. We assume that departures occur before arrivals, and the queue size is measured at the early beginning of the time slot \cite{sadek}.

   \subsection{Primary Queueing Delay}

Let $\mu_{\rm p}\!=\! \mathcal{\tilde H}_{\rm p}$, where $\mathcal{\tilde V}$ denotes the expected value of $\mathcal{V}$, be a general notation for the mean service rate of the primary queue. Solving the state balance equations of the Markov chain modeling the primary queue (Fig. \ref{MC}), it is straightforward to show that the probability that the primary queue has $k\ge 1$ packets, $\nu_k$, is given by
\begin{equation}
\nu_k=\frac{\nu_{\circ}}{\overline{\mu_{\rm p}}}\Bigg(\frac{\lambda_{\rm p} \overline{\mu_{\rm p}}}{\overline{\lambda_{\rm p} }\mu_{\rm p}}\Bigg)^{k}=\frac{\nu_{\circ}}{\overline{\mu_{\rm p}}}\eta^{k}, \ k=1,2,\dots,\infty
\label{btee7}
\end{equation}
where $\eta=\frac{\lambda_{\rm p} \overline{\mu_{\rm p}}}{\overline{\lambda_{\rm p} }\mu_{\rm p}}$.
Since the sum over all states' probabilities is equal to one, i.e., $\sum_{k=0}^{\infty}\nu_k=1$, the probability of the PU's queue being empty is obtained via solving the following equation:
\begin{equation}
\nu_{\circ}+\sum_{k=1}^{\infty}\nu_k=\nu_{\circ}+\nu_{\circ}\sum_{k=1}^{\infty}\frac{1}{\overline{\mu_p}}\eta^{k}=1
\end{equation}
After some mathematical manipulations, $\nu_{\circ}$ is given by
\begin{equation}
\nu_{\circ}\!=\!\!1-\frac{\lambda_{\rm p}}{\mu_{\rm p}}
\end{equation}
The primary queue is stable if $\mu_{\rm p}>\lambda_{\rm p}$. Applying Little's law, the primary queueing delay, $D_{\rm p}$, is then given by
\begin{equation}
\begin{split}
D_{\rm p}&=\frac{1}{\lambda_{\rm p}}\sum_{k=0}^{\infty} k \nu_k
\end{split}
\label{xxzzyy1}
\end{equation}
Using (\ref{btee7}), $D_{\rm p}$ is rewritten as
\begin{equation}
\begin{split}
D_{\rm p}&=\frac{\nu_{\circ}}{\lambda_{\rm p}\overline{\mu_p}}\sum_{k=1}^{\infty} k \eta^{k}
\end{split}
\label{xxzzyy}
\end{equation}
Substituting with $\nu_\circ$ into $D_{\rm p}$, the primary queueing delay is then given by
\begin{equation}
\begin{split}
D_{\rm p}&=\frac{1-\lambda_{\rm p}}{\mu_{\rm p}-\lambda_{\rm p}}
\end{split}
\label{delay2}
\end{equation}
Following are some important remarks. Firstly, the primary queueing delay cannot be less than one time slot, which is attained when the denominator of (\ref{delay2}) equals to the numerator. This condition implies that $\mu_{\rm p}=1$ packets/time slot, i.e., the minimum of $D_{\rm p}$ is attained if the primary service rate is equal to unity.
\begin{figure}
  % Requires \usepackage{graphicx}
  \includegraphics[scale=0.5]{MCsimple}\\
  \caption{Markov chain of the PU's queue. State self-transitions are omitted for visual clarity.}\label{MC}
\end{figure}


Secondly, the primary packets average queueing delay, $D_{\rm p}$, decreases with increasing of the mean service rate of the primary queue, $\mu_{\rm p}$. On the other hand, $\mu_{\rm p}$ depends on the channels outage probabilities, which in turn are functions of the links' parameters, packet size, transmission time durations, occupied bandwidth, and many other parameters as shown in Appendices A and B.


Hereinafter, we append a second index to distinguish between cooperation (`c') and non-cooperation (`nc'). We also append a superscript to distinguish between the proposed protocols.

\section{Non-Cooperative and Cooperative Users}
\subsection{Non-Cooperative Users}
 Without cooperation, the time slot is divided into two non-overlapped phases: data transmission phase, which takes place over the time interval $[0,T-\tau_f]$; and feedback phase whose length is $\tau_f$ seconds, which takes place over the time interval $[T-\tau_f,T]$. The feedback phase is used by the primary destination to notify the primary transmitter about the decodability status of its packet. If the primary queue is nonempty, the PU transmits
exactly one packet with size $b$ bits to its respective receiver. The primary
terminal implements an Automatic Repeat-reQuest (ARQ) error control protocol. The primary receiver uses the cyclic redundancy code
(CRC) bits attached to each packet to ascertain the decodability status of the received packet. The retransmission process is
based on an acknowledgment/negative-acknowledgement (ACK/NACK) mechanism, in which short length packets are broadcasted by the primary destination to inform the primary transmitter
about its packet reception status. If the PU receives an ACK over the time interval $[T-\tau_f,T]$, the packet at its queue head leaves the system; otherwise, a retransmission of the packet is generated at the following time slot. The ARQ protocol is untruncated, which means that there is no maximum on the number of retransmissions and an erroneously received packet is retransmitted until it
is received correctly at the primary receiver \cite{simeone,erph,khattab,wcm}.


A packet at the head of the primary queue is served if the link ${\rm p \rightarrow pd}$ is not in outage. Using the results in Appendix A for the channel outages probability, the mean service rate of the primary queue, $\mu_{\rm p,nc}$, is given by
\begin{equation}
\mu_{\rm p,nc}=\!\exp\bigg(-\mathcal{N}_\circ\frac{2^{\frac{b}{W (T-\tau_f)}}-1}{P_\circ\sigma_{\rm p,pd}}\bigg)
\label{correctreceptionxxx2}
\end{equation}
It should be noted from (\ref{correctreceptionxxx2}) that increasing the feedback duration, $\tau_f$, decreases the service rate of the primary queue. This is because the time available for data transmission decreases with $\tau_f$; hence, the outage probability increases.


According to (\ref{delay2}), and using (\ref{correctreceptionxxx2}), the primary queueing delay in case of non-cooperative PU is given by
\begin{equation}
\begin{split}
D_{\rm p,nc}=\frac{1-\lambda_{\rm p}}{\mu_{\rm p,nc}-\lambda_{\rm p}}=\frac{1-\lambda_{\rm p}}{\exp\bigg(-\mathcal{N}_\circ\frac{2^{\frac{b}{W (T-\tau_f)}}-1}{P_\circ\sigma_{\rm p,pd}}\bigg)-\lambda_{\rm p}}
\end{split}
\label{190990}
\end{equation}
with $\lambda_{\rm p}\!<\!\mu_{\rm p,nc}$.
%%%%%%%%%%%%%%%%
%%%%%%%%%%%% Cooperation Protocols
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%



\subsection{Cooperative Users}
If the SU is available to assist with relaying primary packets, the PU
may release some spectrum to the SU for its own data transmission if cooperation is beneficial. In addition to releasing some bandwidth for the SU, the PU releases portion of its time slot duration for the SU to retransmit the primary packet. In particular, let $T$ denote the time slot duration that
a PU is allowed to transmit data over a total bandwidth of
$W$ Hz. If the cooperation is beneficial for the PU, it cooperates with the SU. If the primary queue is nonempty, it releases $W_{\rm s}\le W$ Hz to the SU for its own data transmission, and releases $T_{\rm s}$ seconds of the time slot to the SU for the possibility of relaying the primary packet. The used bandwidth for both transmission and retransmission of the primary packet is $W_{\rm p}=W\!-\!W_{\rm s}$ Hz with transmission times $T_{\rm p}$ and $T_{\rm s}$, respectively. It is assumed that the SU transmits orthogonal data over the two subbands. That is, the data sent over $W_{\rm s}$ are independent (orthogonal) of the data sent over $W_{\rm p}$. Throughout the paper, we use the analogy of subbands to distinguish between the primary operational subband, $W_{\rm p}$, and the secondary operational subband, $W_{\rm s}$.

 \subsubsection{Radio Sensing}

The SU senses the primary subband, $W_{\rm p}$, for $\tau_{\rm s}$ seconds relative to the beginning of the time slot. If this subband is sensed to be idle, the SU exploits its availability. We assume that the SU employs an energy detection spectrum sensing algorithm. Specifically, the SU gathers
a number of samples over a time duration $\tau_{\rm s}\ll T$, measures their
energy, and then compares the measured energy to a predefined threshold
to make a decision on primary activity \cite{liang2008sensing}. Detection reliability and quality depend on the sensing duration, $\tau_{\rm s}$. Specifically, as $\tau_{\rm s}$ increases, the primary detection becomes more
reliable at the expense of reducing the time available for secondary transmission over the primary subband if the PU is actually inactive. This is the essence of the sensing-throughput
tradeoff in cognitive radio systems \cite{liang2008sensing}.

Since the sensing outcome is imperfect; contains errors, the SU may interfere with the PU in case of misdetection. Let us define $P_{\rm \rm MD}$ as the probability of misdetecting the primary activity by the secondary terminal, which represents the probability of considering the PU inactive while it is actually active; and $P_{\rm \rm FA}$ as the probability that the sensor of the secondary terminal generates a false alarm, which represents the probability of considering the PU active while it is actually inactive. The values of sensing errors probabilities are derived in Appendix~C.


\subsubsection{Important Notes}
Following are some important notes about the proposed protocols.
\begin{itemize}
\item As explained in Appendix A, a link is said to be `ON' in a given time slot if its instantaneous capacity is higher than the used transmission rate, i.e., the link is not in outage. Otherwise, the link is said to be `OFF'.
\item The CSI of the links ${\rm s \rightarrow pd}$ and ${\rm s \rightarrow sd}$ are assumed to be known accurately at the SU (a similar assumption of knowing the CSI at the transmitters is found in many papers, for example, \cite{su2011active} and the references therein).\footnote{Note that the channel between the SU and the primary destination can be sent cooperatively from the primary destination. The primary destination only needs to send the state of the channel, i.e., ON or OFF, which can be done using one-bit feedback.} The SU always has data to send, and it transmits its data with the instantaneous channel capacity of its link ${\rm s \rightarrow sd}$.
\item  Since the SU has the CSI of the links, each time slot the SU ascertains the state of link ${\rm s \rightarrow pd}$, i.e., ON or OFF link, via comparing $\alpha_{\rm s,pd}$ to the decoding threshold $\alpha_{\rm th,s,pd}$.
    \item Since the secondary operation is based on the channel sensing outcomes, the time assigned for channel sensing, $\tau_{\rm s}$, is less than the primary transmission $T_{\rm p}\!>\!\tau_{\rm s}$.
\item If the link ${\rm p \rightarrow s}$ is OFF, this means that the SU will not be able to decode the primary packet as the link is in outage.
\item The SU detects the primary packet with probability $1$ due to the fact that the total number of samples per packet is huge. This means that after receiving and decoding the whole primary transmission, the SU will be able to know the actual state of the primary activity. However, this does not necessarily imply the ability of the SU to correctly decode the primary packet.
\item Each primary packet comes with a CRC. The receivers check the checksum to indicate the status of the received packet. Hence, if the SU cannot decode the primary packet in a slot, if the link ${\rm s \rightarrow pd}$ is in outage, it will not waste energy in forwarding what it receives from the wireless channel because it knows with certainty that the received packet is a noisy packet. Consequently, the SU maintains its energy from being wasted in a useless primary data retransmission, and it instead exploits that amount of energy for the transmission of its own data.
    \item The data sent over $W_{\rm s}$ are independent of the data sent over $W_{\rm p}$.
\item If the PU is active in a slot and the SU misdetects the primary activity, a concurrent transmission takes place over the primary subband $W_{\rm p}$. Hence, the secondary bits transmitted over $W_{\rm p}$ are lost, and the primary packet could survive if the received SINR is higher than the decoding threshold; this occurs with probability $\overline{\mathbb{P}^{\left(\mathcal{I}\right)}_{\rm p,pd}}$.\footnote{Throughout this paper, $\overline{\mathcal{X}}\!=\!1\!-\!\mathcal{X}$.} See Appendices A and B for further details.
    \item  We assume that the primary ARQ feedback is un-encrypted and is available to the SU. A similar assumption is found in many references, e.g., \cite{simeone,erph,khattab,wcm} and the references therein.
\item If the SU transmits concurrently with the primary receiver during the feedback phase, the feedback signal (packet) may be undecodable at the primary transmitter. For this reason, the SU remains silent during the feedback durations when the PU's queue is nonempty to avoid disturbing the primary system operation.
    \end{itemize}
 \section{First Proposed Protocol}
 \label{protocol1x}
    In this section, we explain the first proposed cooperative protocol, denoted by $\mathcal{P}_1$. The time slot structure under $\mathcal{P}_1$ is shown in Fig. \ref{timeslot1}.
    In the first proposed cooperative protocol, the operation of the SU during any arbitrary time slot changes over four phases: $[0,\tau_{\rm s}]$, $[\tau_s,T_{\rm p}]$, $[T_{\rm p}, T_{\rm p}+T_{\rm s}]$, and $[T_{\rm p}+T_{\rm s},T_{\rm p}+T_{\rm s}+\tau_f]$ (or simply $[T-\tau_f,T]$).



\begin{figure}
\center
  % Requires \usepackage{graphicx}
  \includegraphics[width=1\columnwidth]{time_slot_p1}\\
  \caption{Time slot structure.}\label{timeslot1}
\end{figure}
\subsection{Protocol Description}
Before proceeding with the explanation of secondary operation during each phase, we note that, if the PU is active, the primary transmission takes place over $[0,T_{\rm p}]$ and the secondary retransmission of a primary packet takes place over $[T_{\rm p}, T_{\rm p}+T_{\rm s}]$.

\subsubsection{Time interval $[0,\tau_{\rm s}]$}
       The SU simultaneously senses the primary subband, $W_{\rm p}$, and transmits its own data over $W_{\rm s}$. The sensing outcome is then used for the secondary operation over $[\tau_{\rm s},T_{\rm p}]$.
    \subsubsection{Time interval $[\tau_{\rm s},T_{\rm p}]$}
 If the SU detects the PU to be active, it simultaneously transmits its own data over $W_{\rm s}$, and attempts to decode the primary transmission over $W_{\rm p}$. If the SU detects the PU to be inactive, it transmits its own data over both subbands $W_{\rm p}$ and $W_{\rm s}$. Note that if the PU is active and the SU finds the primary subband to be free of primary transmission, there will be interference between the PU and the SU over $W_{\rm p}$.
 \subsubsection{Time interval $[T_{\rm p},T_{\rm p}+T_{\rm s}]$}
 At the end of the primary transmission, the SU uses the received primary packet for packet detection. If the PU was inactive during the previous phase, the SU transmits over both subbands. If the links ${\rm p \rightarrow s}$ and ${\rm s \rightarrow pd}$ are simultaneously ON and the primary queue is nonempty; the SU simultaneously transmits its own data over $W_{\rm s}$ and retransmits the primary packet over $W_{\rm p}$. If either the link ${\rm p \rightarrow s}$ or ${\rm s \rightarrow pd}$ is OFF, the SU transmits its own data over both subbands.
  \subsubsection{Time interval $[T-\tau_f,T]$}
If the PU was active during $[0,T_{\rm p}]$, then its respective receiver broadcasts a feedback message to indicate the status of decodability of the packet. Hence, the SU transmits its own data over $W_{\rm s}$ and remains silent over $W_{\rm p}$ to avoid causing any interference or disturbance for the feedback signal transmission. If the PU was inactive during $[0,T_{\rm p}]$, there is no feedback signal in the current time slot; hence, the SU can exploit the availability of both subbands to transmit its own data.
\bigskip
\subsection{Primary and Secondary Rates and SU Emitted Energy}
 A packet at the head of the primary queue $Q^{\left(1\right)}_{\rm p,c}$ is served if the SU detects the primary activity correctly and either the direct path or the relaying path\footnote{The relaying path is defined as the path connecting the PU to primary destination through the SU; namely, links ${\rm p \rightarrow s}$ and ${\rm s \rightarrow pd}$. Since the channels are independent, the probability of the relaying path being not in outage is $\overline{\mathbb{P} _{\rm s,p}} \ \overline{\mathbb{P} _{\rm s,pd}} $.} is not in outage; or if the SU misdetects the primary activity and the channel ${\rm p \rightarrow pd}$ is not in outage. Let $\mu^{\left(\rm \ell\right)}_{\rm p,c}$ denote the mean service rate of the PU under protocol $\mathcal{P}_\ell$, $\ell\in\{1,2\}$. The mean service rate of the primary queue under protocol $\mathcal{P}_1$ is then given by
         \begin{equation}
\begin{split}
\label{primaryservice2}
\mu^{\left( 1\right)}_{\rm p,c}&=\overline{P}_{\rm MD}\Bigg(1-\mathbb{P}_{\rm p,pd}\Big(1-\overline{\mathbb{P} _{\rm s,p}} \,\, \overline{\mathbb{P} _{\rm s,pd}} \Big)\Bigg)\!+\!P_{\rm MD}\Bigg(1-\mathbb{P}^{\left(\mathcal{I}\right)}_{\rm p,pd}\Bigg)
%\\ \!&\le\! \overline{P}_{\rm MD}
    \end{split}
    \end{equation}%
   where $P_{\rm MD}(1-\mathbb{P}^{\left(\mathcal{I}\right)}_{\rm p,pd})$ denotes the probability of correct primary packet reception at the primary destination when the SU misdetects the primary activity over $W_{\rm p}$.

Let $ \mathcal{   R}^{\left(\ell\right)}_{\rm e}$ and $ \mathcal{R}^{\left(\ell\right)}_{\rm b}$ denote the secondary data transmission rate under protocol $\mathcal{P}_\ell$ when the primary queue is empty and nonempty, respectively, and $R\!=\!\log_{\rm 2}\left(1\!+\!\frac{\alpha_{\rm s,sd}{P}_\circ}{\mathcal{N}_\circ}\right)\!$ denote the instantaneous capacity of link ${\rm s \rightarrow sd}$ in bits/sec/Hz.

Based on the description of protocol $\mathcal{P}_1$, the secondary data transmission rate when the primary queue is empty is given by
\begin{equation}
\begin{split}
\label{3030}
 \mathcal{   R}^{\left(1\right)}_{\rm e}&\!=\!\bigg(\!\tau_s \delta_{\rm s} \! +\! (T_{\rm p}\!-\!\tau_s) (\!P_{ \rm FA}\delta_{\rm s}\!+\!\overline{P}_{\rm \rm FA} \!)  \!+\!(\!T_{\rm s}\!+\!\tau_f\!) \!\bigg)WR
    \end{split}
    \end{equation}
where $\delta_{\rm s}\!=\!W_{\rm s}/W$. When the primary queue is nonempty, the secondary data transmission rate is given by
\begin{equation}
\begin{split}
 \mathcal{  R}^{\left(1\right)}_{\rm b}&\!=\!\bigg(\!\big(\!\tau_f\!+\! T_{\rm p}\!\big)\delta_{\rm s}\!+\!\big(P_{\rm \rm MD}\!+\!\overline{P}_{\rm MD} \mathbb{P}_{\rm p,s}\big)T_{\rm s} \!\\& \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\ +\!\overline{P}_{\rm \rm MD}\overline{\mathbb{P}}_{\rm p,s}T_{\rm s} (\overline{\mathbb{P} _{\rm s,pd}}\delta_{\rm s}\!+\!\mathbb{P} _{\rm s,pd})\!\biggr)WR
    \end{split}
    \end{equation}
Note that the term $\mathbb{P}_{\rm p,s}$ appears in $\mathcal{  R}^{\left(1\right)}_{\rm b}$ because the SU, when the link ${\rm p \rightarrow s}$ is in outage, uses the whole bandwidth for its own data transmission. Also, note that the term $\mathbb{P} _{\rm s,pd}$ appears in the expression of $\mathcal{  R}^{\left(1\right)}_{\rm b}$ because the SU, in each time slot, knows the channel state between itself and the primary destination and uses the allocated bandwidth to the PU for its own data transmission when that channel is in outage.

Let $\mathbb{I}[L]$ denote the indicator function, where $\mathbb{I}[L]=1$ if the argument is true. The secondary data transmission rate when it operates under protocol $\mathcal{P}_\ell$ is then given by
    \begin{equation}
\begin{split}
\mathcal{R}^{\left(\ell\right)}_{\rm s}=\mathbb{I}[Q^{\left(\ell\right)}_{\rm p,c}=0] \mathcal{R}^{\left(\ell\right)}_{\rm e}+\mathbb{I}[Q^{\left(\ell\right)}_{\rm p,c}\ne0]\mathcal{R}^{\left(\ell\right)}_{\rm b}
    \end{split}
    \end{equation}
The expected value of $\mathbb{I}[L]$ is equal to the probability of the argument event ${\rm Pr}\{L\}$. That is,
    \begin{equation}
\begin{split}
 \mathbb{\tilde I}[L]={\rm Pr}\{L\}
    \end{split}
    \end{equation}
 The mean secondary rate is then given by
    \begin{equation}
\begin{split}
\mathcal{\tilde R}^{\left(\ell\right)}_{\rm s}={\rm Pr}\{Q^{\left(\ell\right)}_{\rm p,c}=0\}\mathcal{ \tilde R}^{\left(\ell\right)}_{\rm e}+{\rm Pr}\{Q^{\left(\ell\right)}_{\rm p,c}\ne0\}  \mathcal{ \tilde  R}^{\left(\ell\right)}_{\rm b}
    \end{split}
    \end{equation}
Recalling that ${\rm Pr}\{Q^{\left(\ell\right)}_{\rm p,c}=0\}=\nu^{\left(\ell\right)}_{\rm \circ,c}$ and ${\rm Pr}\{Q^{\left(\ell\right)}_{\rm p,c}\ne0\}=1\!-\!\nu^{\left(\ell\right)}_{\rm \circ,c}$, the mean secondary transmission rate under protocol $\mathcal{P}_1$ is then given by
   \begin{equation}
\begin{split}
\mathcal{\tilde R}^{\left(1\right)}_{\rm s}&=\nu^{\left(1\right)}_{\rm \circ,c}\bigg(\!\tau_s \delta_{\rm s} \! +\! (T_{\rm p}\!-\!\tau_s) (\!P_{ \rm FA}\delta_{\rm s}\!+\!\overline{P}_{\rm \rm FA} \!)  \!+\!(\!T_{\rm s}\!+\!\tau_f\!) \!\bigg)W\mathcal{G}_{P_\circ}\!\\& +\!\overline{\nu^{\left(1\right)}_{\rm \circ,c}}\bigg(\!\big(\!\tau_f\!+\! T_{\rm p}\!\big)\delta_{\rm s}\!+\!\big(P_{\rm \rm MD}\!+\!\overline{P}_{\rm MD} \mathbb{P}_{\rm p,s}\big)T_{\rm s} \!\\ & \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\ +\!\overline{P}_{\rm \rm MD}\overline{\mathbb{P}}_{\rm p,s}T_{\rm s} (\overline{\mathbb{P} _{\rm s,pd}}\delta_{\rm s}\!+\!\mathbb{P} _{\rm s,pd})\!\biggr)W\mathcal{G}_{P_\circ}
    \end{split}
    \end{equation}
where $\mathcal{G}_{P_\circ}$ is the expected value of $\log_2(1+\alpha_{\rm s,sd}\frac{{P_\circ}}{\mathcal{N}_\circ})$, which is given by (see Appendix D for details)
                 \begin{equation}
\begin{split}
\mathcal{G}_{P_\circ}& = \frac{1}{\ln(2)} \exp(\frac{1}{\frac{{P_\circ}}{\mathcal{N}_\circ}\sigma_{\rm s,sd}}) \Gamma(0,\frac{1}{\frac{{P_\circ}}{\mathcal{N}_\circ}\sigma_{\rm s,sd}})
    \end{split}
    \end{equation}
where $\Gamma(m,s)=\int_{1/s}^{\infty}\exp(-{z}) {z}^{m-1} dz$ is the upper incomplete Gamma function.

According to the described protocol, the secondary mean transmit energy is given by
    \begin{equation}
\begin{split}
\label{eeeccn}
\mathcal{E}_{ 1}&=\nu^{\left(1\right)}_{\rm \circ,c}\bigg(\!\tau_s \delta_{\rm s} \! +\! (T_{\rm p}\!-\!\tau_s) ( P_{\rm \rm FA}\delta_{\rm s}\!+\!\overline{P}_{\rm \rm FA}) \!+\!T_{\rm s}\!+\!\tau_f \bigg)WP_\circ \\&+\! \overline{\nu^{\left(1\right)}_{\rm \circ,c}}\biggr(\!(\tau_f\!+\!\tau_{\rm s}) \delta_{\rm s}\!+\!(T_{\rm p}\!-\!\tau_{\rm s})(\overline{P}_{\rm MD}\delta_{\rm s}\!+\!P_{\rm MD})\!+\! T_{\rm s}\!\biggr)WP_\circ
    \end{split}
    \end{equation}
    Note that we assume that the maximum average emitted secondary energy is $E$; hence, $\mathcal{E}_1$ must be at most $E$.

   %%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%
%%%%%%%%%%%%%%%%
%%%%%%%%%%%% SECOND Protocol
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%
\section{Second Proposed protocol}
 \label{protocol2x}
 In the second protocol, denoted by $\mathcal{P}_2$, we assume significant variation in the primary feedback mechanism. More specifically, we assume the existence of two primary feedback phases within each time slot. Each transmission of the primary packet by either the PU or the SU is followed by a feedback phase to inform the transmitter about the decodability of the packet. In other words, a feedback signal is sent by the primary destination when it receives a copy of the expected primary packet.\footnote{Note that each packet comes with an identifier (ID) and a certain labeled number that is generated by the transmitter. In addition, the destination sends the expected number of the next packet as part of the feedback message.} The first feedback phase is preceded by the primary transmission of the primary packet, whereas the second feedback phase is preceded by the secondary transmission of the primary packet. The primary queue drops the packet if it gets at least one ACK in any time slot. Otherwise, the packet will be retransmitted by the PU in the following time slots until its correct reception at the primary destination.


 On one hand, the gain of this protocol over the first protocol is its ability to prevent unnecessary retransmission of a successfully received primary packet at the primary destination. That is, if the primary destination can decode the primary transmission correctly, then there is no need to retransmit the primary packet over the primary subband and the time assigned for relaying; hence, the SU can use the time assigned for relaying and the primary subband for its own data transmission.\footnote{This is because the retransmission of the primary packet by the secondary transmitter does not provide further contribution to the primary throughput. In addition, the retransmission of the primary packet causes both energy and bandwidth losses that can be used otherwise for the secondary data transmission.} Consequently, using protocol $\mathcal{P}_2$ enables the SU to increase its average transmission rate via using the primary bandwidth, relaying assigned time duration and its energy to send its own data. On the other hand, there is a considerable cost due to appending an extra feedback duration to the time slot. This cost is converted to the increase of the outage probabilities of the links and the reduction of the users' rates. This is because the total time for data and packets transmission is reduced by $\tau_f$ seconds relative to the total transmission time in case of protocol $\mathcal{P}_1$.

 Under protocol $\mathcal{P}_2$, the secondary operation in any arbitrary time slot is composed of five phases as shown in Fig. \ref{timeslot2}: $[0,\tau_{\rm s}]$, $[\tau_s,T_{\rm p}]$, $[T_{\rm p},T_{\rm p}+\tau_f]$, $[T_{\rm p}\!+\!\tau_f, T_{\rm p}\!+\!\tau_f\!+\!T_{\rm s}]$ and $[T\!-\!\tau_f,T]$.

\subsection{Reception of Primary Feedback Message at The SU}
     The correctness of the feedback reception at the secondary terminal is ascertained using the checksum appended to the feedback packet. The reception of a primary feedback message at the secondary transmitter can be modeled as an erasure channel model. In particular, the primary feedback message is assumed to be received correctly at the secondary terminal with probability $f$. If the secondary terminal cannot decode the primary feedback signal in a time slot,\footnote{This event is referred to as ``nothing" event. The `nothing' event is considered when the SU fails in decoding the feedback message, or when the PU is idle at this slot, i.e., $Q_{\rm p}=0$. It is worth noting here that if the primary is inactive/active in an arbitrary slot, the SU knows this event with probability $1$ as explained earlier that a pure noise packet is detected with probability $1$.} it considers this feedback message as a NACK feedback. Another possibility is to assume that the SU considers the ``nothing" as a NACK message with probability $\omega$ and considers it as an ACK message with probability $\overline{\omega}$. Using such parameter allows the SU to use a fraction of the ``nothing" event that would be an ACK, which means that the SU does not need to retransmit the primary packet, for its own data transmission. The SU optimizes over $\omega$ to alleviate wasting the channel resources without further contribution to the primary service rate when the primary packet is already received successfully at the primary destination. The primary mean service rate in this case is given by


         \begin{equation}
\begin{split}
\label{primaryservice2x}
\mu^{\left(\rm 2\right)}_{\rm p,c}\!=\!\overline{P}_{\rm MD}\Bigg(1\!-\!\mathbb{P}_{\rm p,pd}\Big(1\!-\!\beta\overline{\mathbb{P}_{\rm s,p}} \,\, \overline{\mathbb{P}_{\rm s,pd}} \Big)\Bigg)\!+\!P_{\rm MD}\Bigg(1\!-\!\mathbb{P}^{\left(\mathcal{I}\right)}_{\rm p,pd}\Bigg)
    \end{split}
    \end{equation}
    where $\beta\!=f\!+\!\overline{f}{\omega}$ is the probability of considering the overheard feedback message as a NACK when the primary destination sends a NACK feedback (which occurs if link ${\rm p\rightarrow pd}$ is in outage). From (\ref{primaryservice2x}), the primary mean service rate is parameterized by $\omega$. The maximum primary service rate is attained when $\omega=1$. For the sake of simplicity, we consider the case of $\omega\!=\!1$, which guarantees the highest QoS for the PU.
\subsection{Protocol Description}
Note that the primary transmission occurs over $[0,T_{\rm p}]$ and the secondary retransmission of a primary packet occurs over $[T_{\rm p}\!+\!\tau_f, T_{\rm p}\!+\!\tau_f\!+\!T_{\rm s}]$. Note also that the feedback signal is considered by the SU as a NACK feedback 1) if the link ${\rm p \rightarrow pd}$ is in outage and the feedback message is decoded correctly at the SU terminal; or 2) if the feedback signal is undecodable at the secondary transmitter. The probability that the SU considers the overheard primary feedback message as a NACK is then given by
   \begin{equation}
\begin{split}
\Gamma_f\!=\!\mathbb{P}_{\rm p,pd} f \!+\!\overline{f}
  \end{split}
    \end{equation}
    The behavior of the SU during each phase is described as follows.
\subsubsection{Time interval $[0,\tau_{\rm s}]$ and $[\tau_{\rm s},T_{\rm p}]$}
The operation of the system over the time intervals $[0,\tau_{\rm s}]$ and $[\tau_{\rm s},T_{\rm p}]$ are similar to the first protocol.
   \subsubsection{Time interval $[T_{\rm p},T_{\rm p}+\tau_f]$}
  If the primary queue is nonempty during the time slot, at the end of the primary transmission, the SU transmits its own data over $W_{\rm s}$, and remains silent over $W_{\rm p}$ to avoid causing a concurrent transmission with the feedback signal at the primary transmitter. If the primary queue is empty during the time slot, the SU transmits its data over both subbands.
 \subsubsection{Time interval $[T_{\rm p}+\tau_f,T-\tau_f]$}
 Upon decoding the primary full packet, the SU discerns the actual state of the PU, i.e., active or inactive. If the PU is active, the primary receiver correctly decodes the primary transmission and the SU successfully decodes the primary feedback signal, i.e., considers it as an ACK feedback. On the other hand, if the link ${\rm s \rightarrow pd}$ is in outage; or if the PU was inactive during $[0,T_{\rm p}]$, the SU transmits its own data over both subbands. If the PU was active during $[0,T_{\rm p}]$, the secondary terminal considers the feedback signal as a NACK feedback, and the link ${\rm s \rightarrow pd}$ is not in outage; the SU simultaneously transmits its own data over $W_{\rm s}$ and retransmits the primary packet over $W_{\rm p}$.

\subsubsection{Time Interval $[T-\tau_f,T]$}
If the SU retransmitted the packet over $[T_{\rm p}+\tau_f,T-\tau_f]$, another feedback signal will be sent over this phase by the primary destination. Hence, the SU simultaneously transmits its own data over $W_{\rm s}$ and remains silent over $W_{\rm p}$. If the SU decided not to retransmit the primary packet, there will be no primary feedback signal. Therefore, the SU transmits its own data over both subbands. If the primary queue is empty during the time slot, the SU transmits its own data over both subbands.
\subsection{Primary and secondary rates, and the SU emitted energy}
A packet at the head of the primary queue $Q^{\left(2\right)}_{\rm p,c}$ is served 1) if the SU detects the primary activity correctly, and the direct link is not in outage; 2) if the SU detects the primary activity correctly, and the direct link is in outage, the SU considers the primary feedback message as a NACK signal, and the relaying link is not in outage; or 3) if the SU misdetects the primary activity, and the direct link is not in outage. The mean service rate of the primary queue is similar to the first protocol and is given by
   \begin{equation}
\begin{split}
\label{primaryservice222}
\mu^{\left( 2\right)}_{\rm p}=\overline{P}_{\rm MD}\Bigg(1-\mathbb{P}_{\rm p,pd}\Big(1-\overline{\mathbb{P} _{\rm s,p}} \,\, \overline{\mathbb{P} _{\rm s,pd}} \Big)\Bigg)\!+\!P_{\rm MD}\Bigg(1-\mathbb{P}^{\left(\mathcal{I}\right)}_{\rm p,pd}\Bigg)
    \end{split}
    \end{equation}
We note that the expression (\ref{primaryservice222}) is similar to (\ref{primaryservice2}), however, the maximum assigned data transmission times for users under $\mathcal{P}_2$ are lower than $\mathcal{P}_1$ as $\mathcal{P}_2$ is composed of two feedback durations.


When the primary is inactive, the secondary transmission rate is given by
    \begin{equation}
\begin{split}
\label{3030}
 \mathcal{   R}^{\left(2\right)}_{\rm e}&\!=\!\Big(\!\tau_s \delta_{\rm s} \!+\! (T_{\rm p}\!-\!\tau_s)\big(\overline{P}_{\rm \rm FA}   \!+\!  P_{\rm \rm FA} \delta_{\rm s}\!\big) \!+\!\!T_{\rm s}\!+\!2\tau_f\Big)WR
    \end{split}
    \end{equation}

    \begin{figure}
\centering
  % Requires \usepackage{graphicx}
  \includegraphics[width=1\columnwidth]{time_slot_p2}\\
  \caption{System operation.}\label{timeslot2}
\end{figure}
When the PU is active, the secondary transmission rate is given by
    \begin{equation}
\begin{split}
\label{2000}
 \mathcal{  R}^{\left(2\right)}_{\rm b}&\!=\!\Bigg(\!(2\tau_f \!+\!T_{\rm p})\delta_{\rm s}\!+\! \overline{P}_{\rm \rm MD}T_{\rm s}\\& \,\,\,\,\ \times \bigg(\!\overline{\mathbb{P} _{\rm p,s}}(\!\Gamma_f (\overline{\mathbb{P} _{\rm s,pd}}\delta_{\rm s}\!+\!\mathbb{P} _{\rm s,pd}) \! \!+\! \overline{\Gamma}_f)\!+\!\mathbb{P} _{\rm p,s} \!\bigg) \! +\! P_{\rm \rm MD}\!T_{\rm s}\!\Bigg) WR\!
    \end{split}
    \end{equation}
 The mean secondary transmission rate is then given by
   \begin{equation}
\begin{split}
 \mathcal{ \tilde  R}^{\left(2\right)}_{\rm s}&=\nu^{\left(2\right)}_{\rm \circ,c}\Bigg(\!\tau_s \delta_{\rm s} \!+\! (T_{\rm p}\!-\!\tau_s)\big(\overline{P}_{\rm \rm FA}   \!+\!  P_{\rm \rm FA} \delta_{\rm s}\!\big) \!+\!\!T_{\rm s}\!+\!2\tau_f\Bigg)W\mathcal{G}_{P_\circ} \\& \,\,\,\,\,\,\,\ + \overline{\nu^{\left(2\right)}_{\rm \circ,c}} \Bigg(\!(\!2\tau_f \!+\!T_{\rm p})\delta_{\rm s}\!+\! \overline{P}_{\rm \rm MD}T_{\rm s}\\& \,\ \times\! \bigg(\!\overline{\mathbb{P} _{\rm p,s}}(\!\Gamma_f (\!\overline{\mathbb{P} _{\rm s,pd}}\delta_{\rm s}\!+\!\mathbb{P} _{\rm s,pd}) \! \!+\! \overline{\Gamma}_f)\! +\!\mathbb{P} _{\rm p,s} \!\bigg) \!  +\! P_{\rm \rm MD}\!T_{\rm s}\!\Bigg) W\mathcal{G}_{P_\circ}
    \end{split}
    \end{equation}

According to the description of protocol $\mathcal{P}_2$, the mean transmit secondary energy is given by
    \begin{equation}
\begin{split}
\mathcal{E}_{2}&=\nu^{\left(2\right)}_{\rm \circ,c}\Big(\!\tau_s \delta_{\rm s} \!+\! (T_{\rm p}\!-\!\tau_s)\big(\overline{P}_{\rm \rm FA}   \!+\!  P_{\rm \rm FA} \delta_{\rm s}\!\big) \!+\!\!T_{\rm s}\!+\!2\tau_f \Big)WP_\circ\\&+ \overline{\nu^{\left(2\right)}_{\rm \circ,c}}\Big(\!(2\tau_f \!+\!\tau_{\rm s}) \delta_{\rm s}\!+\!(T_{\rm p}\!-\!\tau_{\rm s})(\overline{P}_{\rm MD}\delta_{\rm s}\!+\!P_{\rm MD}) \! +\!T_{\rm s}\!\Big) WP_\circ
    \end{split}
    \end{equation}

\section{Problem Formulation and Primary Mean Energy Savings}
\subsection{Problem Formulation}
        We assume that users optimize over $T_{\rm p}=T-T_{\rm s}$ and $W_{\rm p}=W-W_{\rm s}$. Note that there is a possibility to optimize over the sensing time $\tau_{\rm s}$, however, for simplicity, we assume that the sensing time is fixed and predetermined. Sensing time optimization is out of scope of this paper. The optimization problem is stated such that the secondary average rate is maximized under specific primary queueing delay, primary queue stability, and an energy constraint on the secondary average transmit energy, $\mathcal{E}_{\rm \ell}\le E$ (where $E$ is the maximum average transmit energy). The optimization problem under protocol $\mathcal{P}_\ell$ can be stated as follows:
\begin{equation}
\begin{split}
\label{opt1}
      \underset{\substack{{T_{\rm p},W_{\rm p}}}}{\max.}&\,\,\,\,\,\,\,\,\,\,\  \mathcal{ \tilde  R}^{\left(\ell\right)}_{\rm s} \\ {\rm s.t.}&  \,\,\,\,\,\,\,\,\,\ D^{\left({\rm \ell}\right)}_{\rm p,c} < D_{\rm p,nc}, \ \mu^{\left(\ell\right)}_{\rm p,c}>\lambda_{\rm p},\  0\!\le\! \mathcal{E}_{ \rm \ell}\!\le\! E, \\& \,\,\ \ \tau_{\rm s}\!\le\! T_{\rm p}\!\le\! \mathcal{T}^{\left(\!\ell\right)},  \ 0\!\le\! W_{\rm p}\!\le\! W, \ T_{\rm p}\!+\!T_{\rm s}\!=\!\mathcal{T}^{\left(\!\ell\right)}
    \end{split}
    \end{equation}
where $\mathcal{T}^{\left(\ell\right)}$ is the operational constraint on $T_{\rm p}\!+\!T_{\rm s}$ when users operate under protocol $\mathcal{P}_\ell$, and $D^{\left({\rm \ell}\right)}_{\rm p,c}=(1-\lambda_p)/(\mu^{\left(\rm \ell\right)}_{\rm p,c}-\lambda_{\rm p})$. Under the first protocol, the total allowable transmission time is $T\!-\!\tau_f$; hence, $\mathcal{T}^{\left(1\right)}=T\!-\tau_f$. Whereas under the second protocol, the total allowable transmission time is $T\!-\!2\tau_f$; hence, $\mathcal{T}^{\left(2\right)}=T\!-2\tau_f$. It should be pointed out here that if the primary feedback message is always undecodable at the secondary transmitter, i.e., $f\!=\!1$, or if the link ${\rm p\rightarrow pd}$ is always in outage; protocol $\mathcal{P}_1$ always outperforms protocol $\mathcal{P}_2$. This is because the SU always retransmits the primary packet with a lower transmission time for each user due to the existence of two feedback durations in $\mathcal{P}_2$. In addition, when $\tau_f$ increases, $\mathcal{P}_1$ may outperform $\mathcal{P}_2$ because it may be the case that the reduction of the allowable total transmission time due to the presence of an additional feedback duration is higher than the gain of knowing the status of the primary packet decodability before the secondary retransmission of the primary packet.

The optimization problem (\ref{opt1}) is solved numerically using a 2D grid search over $T_{\rm p}$ and $W_{\rm p}$. The optimal parameters obtained via solving the optimization problem (\ref{opt1}) are announced to both users so that $W_{\rm p}$ and $T_{\rm p}$ are known at the PU and the SU before actual operation. If the optimization problem is infeasible due to the dissatisfaction of one or more of the constraints, the SU will not be allowed to use the spectrum.


 It is worth noting that the primary queueing delay constraint can be replaced by a constraint on the mean service rate of the primary queue. Since the delay constraint is $D^{\left({\rm \ell}\right)}_{\rm {\rm p},c}=(1-\lambda_{\rm p})/(\mu^{\left(\rm \ell\right)}_{\rm p,c}-\lambda_{\rm p})\!<\! D_{\rm p,nc}\!=\!(1-\lambda_{\rm p})/(\mu_{\rm p,nc}-\lambda_{\rm p})$, the mean service rate of the primary queue with cooperation must be greater than the mean service rate of the primary queue without cooperation. That is,

\begin{equation}
\begin{split}
\label{optccc}
\mu^{\left(\rm \ell\right)}_{\rm p,c}> \mu_{\rm p,nc}
    \end{split}
    \end{equation}
    Combining the delay constraint and the stability constraint, hence the primary mean service rate should be at least
    \begin{equation}
\begin{split}
\label{optccc}
\mu^{\left(\rm \ell\right)}_{\rm p,c}> \max\Big\{\mu_{\rm p,nc},\lambda_{\rm p}\Big\}
    \end{split}
    \end{equation}

\subsection{Mean Primary Energy Savings}
In the absence of relaying, the PU data transmission
takes place over $T\!-\!\tau_f$ seconds and occupies $W$ Hz, and the PU energy consumption per time slot amounts to $P_\circ W (T\!-\!\tau_f)$ joules/slot. However,
when CR relaying takes place, the PU transmits
only in $T_{\rm p}/T$ of the time slot with transmission bandwidth $W_{\rm p}$ Hz, so its energy consumption per time slot
is only $P_\circ W_{\rm p} T_{\rm p}$ joules/slot. In this case, the average rate of the PU energy savings, defined as the ratio of the energy savings
over the original energy consumption, is given by
\begin{equation}
\begin{split}
\phi\!=\! \frac{P_\circ W (T\!-\!\tau_f) {\rm Pr}\{Q_{\rm p,nc}\ne0\}-\!P_\circ W_{\rm p} T_{\rm p} {\rm Pr}\{Q^{\left(\ell\right)}_{\rm p,c}\ne0\}}{P_\circ W (T\!-\!\tau_f) {\rm Pr}\{Q_{\rm p,nc}\ne0\}}
    \end{split}
    \end{equation}
    Using the fact that ${\rm Pr}\{Q_{\rm p,nc}\ne0\}\!=\!\lambda_{\rm p}/\mu_{\rm p,nc}$ if $\lambda_{\rm p}<\mu_{\rm p,nc}$, and $1$ otherwise, ${\rm Pr}\{Q^{\left(\ell\right)}_{\rm p,c}\ne0\}\!=\!\lambda_{\rm p}/\mu^{\left(\ell\right)}_{\rm p,c}$, and noting that there is no cooperation if the primary queue is unstable, we get
    \begin{equation}
\begin{split}
\phi\!=\! 1-\frac{W_{\rm p} T_{\rm p}} {W (T\!-\!\tau_f)}\frac{\max\{\mu_{\rm p,nc},\lambda_{\rm p}\}}{\mu^{\left(\ell\right)}_{\rm p,c}}
    \end{split}
    \end{equation}
From the above ratio, we can see that the less the bandwidth and the transmission time
that the PU occupies, the more energy
savings for the PU. We note that the primary queue under cooperation should be stable, otherwise, the optimization problem is infeasible and there will be no cooperation. We also note that using less bandwidth
and shorter transmission time improves the low probability of intercept/low probability of detection (LPD/LPI) characteristics of the communication link that appears
to be especially critical in military applications \cite{su2011active}.


\section{Numerical results}
 \label{numerical}
In this section, we present some simulations of the proposed cooperative protocols. We define a set of common parameters: the targeted false alarm probability is $P_{\rm FA}=0.1$, $W\!=\!10$ MHz, $T=5$ msec, $b\!=\!5000$ bits, $E\!=\!5\times 10^{-6}$ joule, $\tau_{\rm s}\!=\!0.05T$, $\sigma_{\rm s,pd}\!=\!\sigma_{\rm s,sd}\!=\!0.1$, $\sigma_{\rm p,s}\!=\!1$, $\mathcal{P}_\circ\!=\!10^{-10}$ Watts/Hz, and $\mathcal{N}_\circ=10^{-11}$ Watts/Hz. Fig. \ref{fig1} shows the maximum average secondary rate of the proposed cooperative protocols. The second protocol is plotted with three different values of $f$. The figure reveals the advantage of the second protocol over the first protocol for $f=0.5$ and $f=1$. However, for $f=0$, the first protocol outperforms the second one. This is because when $f=0$ there is no beneficial gain of having a feedback signal after the primary transmission; hence, using the second protocol wastes $\tau_f$ seconds of the time slot that can be used otherwise in increasing users' rates. The figure also reveals the impact of parameter $f$ on the performance of protocol $\mathcal{P}_2$. As shown in the figure, increasing $f$ enhances the performance of protocol $\mathcal{P}_2$. In addition to the common parameters, the figure is generated using $\sigma_{\rm p,pd}\!=\!0.05$, $\tau_f=0.05T$ and the values of $f$ in the figure's legend.

Fig. \ref{fig2} demonstrates the impact of the feedback duration, $\tau_f$, on the performance of the proposed cooperative protocols. The mean secondary transmission rate and the primary arrival rate feasible range shrink with increasing $\tau_f$. When the value of $\tau_f$ is considerable, i.e., $\tau_f=0.2T$, the first protocol outperforms the second protocol. This is because the total allowable transmission time of nodes in $\mathcal{P}_2$ in this case is $T\!-\!2\tau_f\!=\!0.6T$, whereas the total allowable transmission time for $\mathcal{P}_1$ is $T\!-\!\tau_f\!=\!0.8T$. For small values of $\tau_f$, the second proposed protocol outperforms the first protocol. This is because the SU can use the time duration assigned for relaying and the primary subband to transmit its data in case of correct packet reception after the primary transmission. The parameters used to generate the figure are the common parameters, $\sigma_{\rm p,pd}\!=\!0.05$, $f=1$ and the values of $\tau_f$ in the plot.

Figs. \ref{fig3}, \ref{fig4} and \ref{fig5} present the primary mean service rate, the primary queueing delay, and the average PU power savings, respectively, under the proposed cooperative protocols. The case of non-cooperative users is also plotted in Figs. \ref{fig3} and \ref{fig4} for comparison purposes. The figures demonstrate the gains of the proposed protocols for the PU over the non-cooperation case. Note that without cooperation, the primary queue is unstable when $\lambda_{\rm p}>0.2$ packets/slot. On the other hand, with cooperation, the primary queue remains stable over the range from $\lambda_{\rm p}=0$ to $\lambda_{\rm p}=0.95$ packets/slot. The second protocol provides better performance than the first protocol in terms of primary quality of service. Fig. \ref{fig5} reveals that more that 95\% of the average primary energy will be saved for $\lambda_{\rm p}=0.2$ packets/slot. When $\lambda_{\rm p}\!=\!0.8$ packets/slot, the primary energy savings is almost 78\%. For $\lambda_{\rm p}\ge 0.95$, the primary queue becomes unstable even with cooperation; hence, the cooperation becomes non-beneficial for the PU. Consequently, the PU ceases cooperation, the SU doest gain any access to the spectrum, and the primary energy savings becomes zero. The parameters used to generate the figures are the common parameters, $\sigma_{\rm p,pd}\!=\!0.005$, $\sigma_{\rm s,pd}\!=\!1$, $\tau_f=0.05T$ and $f\!=\!1$. Note that the performance of both protocols are close to each other because the outage of the primary channel is high and the direct link ${\rm p \rightarrow pd}$ is in outage most of the time. Hence, under $\mathcal{P}_2$, the SU retransmits the primary packet almost every slot instead of transmitting its own data. Accordingly, both protocols almost provide the same performance.

\begin{figure}[h]
	\centering
		\includegraphics[scale=0.5]{fig1}
	\caption{The maximum secondary rate in bits per slot for the proposed protocols. Protocol $\mathcal{P}_2$ is plotted with three different values of primary feedback correct reception, $f$.}
	\label{fig1}
\end{figure}
\begin{figure}[h]
	\centering
		\includegraphics[scale=0.5]{fig2}
	\caption{The maximum mean secondary rate in bits per slot. The protocols are plotted for two values of the feedback duration $\tau_f$.}
	\label{fig2}
\end{figure}

\begin{figure}[h]
	\centering
		\includegraphics[scale=0.5]{fig3}
	\caption{The maximum mean primary stable throughput for the proposed protocols. The case of non-cooperative users is also plotted for comparison.}
	\label{fig3}
\end{figure}
\begin{figure}[h]
	\centering
		\includegraphics[scale=0.5]{fig4}
	\caption{The primary queueing delay for the proposed protocols. The case of non-cooperative SU is also plotted for comparison purposes.}
	\label{fig4}
\end{figure}
\begin{figure}[h]
	\centering
		\includegraphics[scale=0.5]{phi}
	\caption{PU power savings.}
	\label{fig5}
\end{figure}
\section{Conclusion}
\label{conc}
In this paper, we have developed two cooperative cognitive protocols which allow the SU to access the spectrum simultaneously with the PU. We have shown the gains of the proposed protocols for the SUs. We also addressed the impact of the feedback process on users rates. Each of the proposed protocols can outperform the other for certain parameters.
\section*{Appendix A}
In this Appendix, we present the outage probability expression of a link when the transmitter communicates to its respective receiver alone, i.e., without interference. Let $r_{\rm j,k}$ be the transmission rate of node ${\rm j}$ while communicating to node ${\rm k}$, $\gamma_{\rm j,k}$ be the received SNR at node ${\rm k}$ when node ${\rm j}$ communicates with node ${\rm k}$, and $\alpha_{\rm j,k}$ be the associated channel gain with mean $\sigma_{\rm j,k}$, which is exponentially distributed in the case of Rayleigh fading. The probability of channel outage between ${\rm j}$ and ${\rm k}$ is given by \cite{krikidis2010stability}
\begin{equation}\label{correctreceptionx}
\begin{split}
\mathbb{P}_{\rm j,k}&= {\rm Pr}\biggr\{r_{\rm j,k}>\log_2\bigg(1+\gamma_{\rm j,k}\bigg)\biggr\}
\end{split}
\end{equation}
where ${\rm Pr}\{\cdot\}$ denotes the probability of the event in the argument and $\gamma_{\rm j,k}~=~\frac{P_\circ\alpha_{\rm j,k}}{\mathcal{N}_\circ}$. The formula (\ref{correctreceptionx}) can be rewritten as
\begin{equation}\label{correctreception}
\begin{split}
\mathbb{P}_{\rm j,k}&= {\rm Pr}\biggr\{\alpha_{\rm j,k}<\frac{\mathcal{N}_\circ}{P_\circ}\Big(2^{\frac{r_{\rm j,k}}{W}}-1\Big)\biggr\}
\end{split}
\end{equation}
%the instantaneous channel gain is lower than
 Let $\alpha_{\rm th,j,k}\!=\!\frac{\mathcal{N}_\circ}{P_\circ}(2^{\frac{r_{\rm j,k}}{W}}\!-\!1)$. We note that if $\alpha_{\rm j,k}< \alpha_{\rm th,j,k}$, the channel is in outage (OFF), whereas if $\alpha_{\rm j,k}\!\ge\!\alpha_{\rm th,j,k}$, the channel is not in outage (ON). It is worth pointing out here that increasing the data transmission time and the bandwidth assigned to any of the terminals decrease the outage probability, or equivalently increase the capacity, of the link between that terminal and its respective receiver. That is, the outage probability of any of the links decreases exponentially with the increase of the transmission time and the bandwidth assigned to the terminals.

  If the SU is available to assist, when the PU's queue is nonempty, the PU sends a packet of size $b$ bits over $T_{\rm p}$. Hence, the primary transmission rate is given by
\begin{equation}
r_{\rm p,pd}=\frac{b}{T_{\rm p}}
\label{r_i}
\end{equation}
When the PU communicates to its receiver lonely, i.e., without interference, the link between the PU and the primary destination (link ${\rm p \rightarrow pd}$) is in outage with probability
\begin{equation}\label{correctreceptionww}
\mathbb{P}_{\rm p,pd}=1-\exp\bigg(-\mathcal{N}_\circ\frac{2^{\frac{b}{W_{\rm p} T_{\rm p}}}-1}{P_\circ\sigma_{\rm p,pd}}\bigg)
\end{equation}



The SU relays (retransmits) the primary packet over $T_{\rm s}$ seconds. Hence, the transmission rate of the relayed primary packet is given by
\begin{equation}
r_{\rm s,pd}=\frac{b}{T_{\rm s}}
\label{r_i}
\end{equation}
The probability of primary packet correct reception at the SU is equal to the probability of the link ${\rm p \rightarrow s}$ being not in outage. This is given by a formula similar to the one in (\ref{correctreceptionww}) with the relevant parameters of the link ${\rm p \rightarrow s}$. That is,
\begin{equation}\label{correctreception}
\overline{\mathbb{P} _{\rm p,s}}=\exp\bigg(-\mathcal{N}_\circ\frac{2^{\frac{b}{W_{\rm p} T_{\rm p}}}-1}{P_\circ\sigma_{\rm p,s}}\bigg)
\end{equation}


The relayed primary packet transmitted by the SU is correctly received at the primary destination with probability
\begin{equation}
\label{correctreceptionxxx22}
\overline{\mathbb{P} _{\rm s,pd}}=\exp\bigg(-\mathcal{N}_\circ\frac{2^{\frac{b}{W_{\rm p} T_{\rm p}}}-1}{P_\circ\sigma_{\rm s,pd}}\bigg)
\end{equation}
where (\ref{correctreceptionxxx22}) is the probability that link ${\rm s \rightarrow pd}$ is not in outage.
\section*{Appendix B}
When the SU and the PU transmit at the same time over the primary subband, the outage event of the link ${\rm p \rightarrow pd}$ is given by
\begin{equation}
\begin{split}
\mathbb{P}^{\left(\mathcal{I}\right)}_{\rm j,k}&= {\rm Pr}\biggr\{\frac{b}{T_{\rm p}W_{\rm p}}>\log_2\bigg(1+\frac{\alpha_{\rm p,pd}P_\circ}{\mathcal{N}_\circ+\alpha_{\rm s,pd}P_\circ}\bigg)\biggr\}
\end{split}
\end{equation}
This can be written as
\begin{equation}
\begin{split}
\mathbb{P}^{\left(\mathcal{I}\right)}_{\rm j,k}&= {\rm Pr}\biggr\{2^{\frac{b}{T_{\rm p}W_{\rm p}}}-1>\frac{\alpha_{\rm p,pd}P_\circ}{\mathcal{N}_\circ+\alpha_{\rm s,pd}P_\circ}\biggr\}
\end{split}
\end{equation}
Since the channels are independent, the region, where the inequality $2^{\frac{b}{T_{\rm p}W_{\rm p}}}-1>\frac{\alpha_{\rm p,pd}P_\circ}{\mathcal{N}_\circ+\alpha_{\rm s,pd}P_\circ}$ is satisfied, can be easily solved. After some algebra, the probability of primary packet correct reception when the SU interrupts the primary transmission over $W_{\rm p}$ is given by
\begin{equation}
\overline{\mathbb{P}^{\left(\mathcal{I}\right)}_{\rm p,pd}}=\frac{\overline{\mathbb{P}_{\rm p,pd}}}{1+\frac{\sigma_{\rm s,pd}}{\sigma_{\rm p,pd}}(2^{\frac{b}{W_{\rm p} T_{\rm p}}}-1)}
\label{correctreceptionww2}
\end{equation}
From expression (\ref{correctreceptionww2}), the successful transmission in case of interference is outer bounded by $\overline{\mathbb{P}_{\rm p,pd}}$. This shows the reduction of primary throughput due to concurrent transmission which may occur because of sensing error events.

\section*{Appendix C}

 We derive here the sensing errors probabilities at the SU. The detection
problem at slot $\mathbb{T}$ (assuming that $\tau_{\rm s} F_{\rm s}$ is an integer, where $F_{\rm s}\!=\!2W_{\rm p}$ is the sampling frequency of spectrum sensing \cite{liang2008sensing} and $W_{\rm p}$ is the primary bandwidth in case of cooperation) is described as follows:
\begin{equation}
\begin{split}
\mathcal{H}_1&: \ s(\hat k)=\zeta_{\rm p,s} x(\hat k)+\varepsilon(\hat k)\\
\mathcal{H}_0&: \ s(\hat k)=\varepsilon(\hat k)
     \end{split}
    \end{equation}

\begin{equation}
\begin{split}
\mathbb{H}(s)=\frac{1}{F_{\rm s}\tau_{\rm s}} \sum_{\hat k=1}^{F_{\rm s}\tau_{\rm s}} |s(\hat k)|^2
     \end{split}
    \end{equation}
where $|\zeta_{\rm p,s}|^2=\alpha_{\rm p,s}$ is channel gain of link ${\rm p \rightarrow s}$, hypotheses $\mathcal{H}_1$ and $\mathcal{H}_0$ denote the cases where the PT is active and inactive, respectively, $\tau_{\rm s} F_{\rm s}$ is the total number of used samples for primary activity detection, $\varepsilon$ is the noise instantaneous value at time slot $\mathbb{T}$ with variance $\mathcal{N}_{\rm p}=\mathcal{N}_\circ W_{\rm p}$, $x$ is the primary transmitted signal at slot $\mathbb{T}$ with variance $P_{\rm p}=P_\circ W_{\rm p}$, $x(\hat k)$ is the $\hat k${\it th} sample of the primary transmit signal, $s(\hat k)$ is the $\hat k${\it th} received sample of the primary signal at the SU and $\mathbb{H}(\cdot)$ is the test statistic of the energy detector.


The quality of the
sensing process outcome is determined by the probability of detection,
$P_{\rm D}$, and the probability of false alarm, $P_{\rm FA}$, which are defined as
the probabilities that the sensing algorithm (technique) detects a PU under hypotheses $\mathcal{H}_1$ and $\mathcal{H}_0$, respectively.


Using the central limit theorem (CLT), the test statistic $\mathbb{H}$ for
hypothesis $\mathcal{H}_\theta$, $\theta\in\{0,1\}$, can be approximated by Gaussian distributions \cite{liang2008sensing} with
parameters
\begin{equation}
\begin{split}
%\Lambda_0&=\mathcal{N}_{\rm p}, \ \sigma_0=\frac{\mathcal{N}_{\rm p}^2}{F_{\rm s}\tau_{\rm s}}, \\
\Lambda_\theta&=\theta\alpha_{\rm p,s}P_{\rm p}+\mathcal{N}_{\rm p},\ \sigma_\theta=\frac{(\theta\alpha_{\rm p,s}P_{\rm p}+\mathcal{N}_{\rm p})^2}{F_{\rm s}\tau_{\rm s}}
\label{eq0}
     \end{split}
    \end{equation}
where $\Lambda_\theta$ and $\sigma_\theta$ denote the mean and the variance of the
Gaussian distribution for the hypothesis $\mathcal{H}_\theta$, where $\theta\in\{0,1\}$. Since $\alpha_{\rm p,s}$ is Exponentially distributed random variable with parameter $1/\sigma_{\rm p,s}$, the
probabilities $P_{\rm FA}$ and $P_{\rm D}$ can be written as %(for proof see \cite{mytvtpaper})

\begin{equation}
\begin{split}
P_{\rm D}&={\rm Pr}\{\mathbb{H}(s)>\epsilon|\mathcal{H}_1\}\\& \!=\!\frac{\exp(\frac{\mathcal{N}_{\rm p}}{\sigma_{\rm p,s}P_{\rm p}} )}{\sigma_{\rm p,s}P_{\rm p}}\int_{\mathcal{N}_{\rm p}}^\infty \mathcal{Q}(\!\sqrt{F_{\rm s}\tau_{\rm s}}[\!\frac{\epsilon}{\mathcal{Z}}\!-\!1]\!)\exp(\!-\frac{\mathcal{Z}}{\sigma_{\rm p,s}P_{\rm p}} \!) d\mathcal{Z}
\label{eq1}
   \end{split}
    \end{equation}
    \begin{equation}
\begin{split}
P_{\rm FA}&={\rm Pr}\{\mathbb{H}(s)>\epsilon|\mathcal{H}_0\}= \mathcal{Q}(\sqrt{F_{\rm s}\tau_{\rm s}}[\frac{\epsilon}{\mathcal{N}_{\rm p}}-1])
\label{eq2}
   \end{split}
    \end{equation}
    where $\exp(\cdot)$ denotes the exponential function, $\epsilon$ is the energy threshold and $\mathcal{Q}(\mathcal{Y})~=~\frac{1}{\sqrt{2\pi}}\int_\mathcal{Y}^\infty \exp(\!-z^2/2)dz$ is the $\mathcal{Q}$-function.

    For a targeted false alarm probability, $P_{\rm FA}$, the value of the threshold $\epsilon$ is given by
        \begin{equation}
\begin{split}
\epsilon={\mathcal{N}_{\rm p}}\Big(\frac{\mathcal{Q}^{-1}(P_{\rm FA})}{\sqrt{F_{\rm s}\tau_{\rm s}}}+1\Big)
\label{eq3}
   \end{split}
    \end{equation}
   Thus, for a targeted false alarm probability, $P_{\rm FA}$, the probability of misdetection is given by substituting Eqn. (\ref{eq3}) into Eqn. (\ref{eq1}). That is,

    \begin{equation}
\begin{split}
P_{\rm MD}&=1\!-\!\frac{1}{\sigma_{\rm p,s}P_{\rm p}}\exp(\frac{1}{\sigma_{\rm p,s}P_{\rm p}} \mathcal{N}_{\rm p})\\ \,\,\,\,\,\ &\times \int_{\mathcal{N}_{\rm p}}^\infty \mathcal{Q}\Biggr(\!\sqrt{F_{\rm s}\tau_{\rm s}}\Big(\!\frac{{\mathcal{N}_{\rm p}}\Big(\!\frac{\mathcal{Q}^{-\!1}(\!P_{\rm FA}\!)}{\sqrt{F_{\rm s}\tau_{\rm s}}}\!+\!1\!\Big)}{\mathcal{Z}}\!-\!1\Big)\!\Biggr)\exp(\!-\frac{\mathcal{Z}}{\sigma_{\rm p,s}P_{\rm p}} \!) d\mathcal{Z}
\label{eq5}
   \end{split}
    \end{equation}
    where $\mathcal{Q}^{-1}(\cdot)$ is the inverse of $\mathcal{Q}$-function.

    \section*{Appendix D}
In this Appendix, we compute the expected value of $R\!=\!\log_2(1+\alpha_{\rm s,sd}\gamma_{\rm s,sd})$. It can be shown that,
    \begin{equation}
\begin{split}
\mathcal{G}_{P_\circ}=&\frac{1}{\sigma_{\rm s,sd}}\int_{0}^{\infty} \log_2(1+\alpha_{\rm s,sd}\frac{P_\circ}{\mathcal{N}_\circ}) \exp(-\frac{\alpha_{\rm s,sd}}{\sigma_{\rm s,sd}})\ \ \ {d}\alpha_{\rm s,sd}\\&\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\ =\frac{1}{\ln(2)} \exp(\frac{1}{\gamma_{\rm s,sd}\sigma_{\rm s,sd}}) \Gamma(0,\frac{1}{\gamma_{\rm s,sd}\sigma_{\rm s,sd}})
    \end{split}
    \end{equation}
   where $\Gamma(.,.)$ is the upper incomplete Gamma function.
    \begin{proof}
    Let $\gamma_{\rm s,sd}=\frac{P_\circ}{\mathcal{N}_\circ}$. Integration by parts and rearranging the resultant, the expression is given by
        \begin{equation}
\begin{split}
\mathcal{G}_{P_\circ}&=-\int_{0}^{\infty} \log_2(1+\alpha_{\rm s,sd}\gamma_{\rm s,sd})\ \ d\exp(-\frac{\alpha_{\rm s,sd}}{\sigma_{\rm s,sd}})\\&\,\,\,\,\,\,\,\,\,\,\,\,\,\,\ =\underbrace{-\log_2(1+\alpha_{\rm s,sd}\gamma_{\rm s,sd}) \exp(-\frac{\alpha_{\rm s,sd}}{\sigma_{\rm s,sd}})\Biggr|_0^\infty}_{\rm zero}\\& \,\,\,\,\,\,\,\,\,\,\,\,\ +\frac{1}{\ln(2)}\int_{0}^{\infty}\exp(-\frac{\alpha_{\rm s,sd}}{\sigma_{\rm s,sd}}) \frac{\gamma_{\rm s,sd}}{1+\alpha_{\rm s,sd}\gamma_{\rm s,sd}} \ d\alpha_{\rm s,sd}
    \end{split}
    \end{equation}
    After removing the zero term, $\mathcal{G}_{P_\circ}$ becomes
            \begin{equation}
\begin{split}
\mathcal{G}_{P_\circ}=\frac{1}{\ln(2)}\int_{0}^{\infty}\exp(-\frac{\alpha_{\rm s,sd}}{\sigma_{\rm s,sd}}) \frac{\gamma_{\rm s,sd}}{1+\alpha_{\rm s,sd}\gamma_{\rm s,sd}} \ d\alpha_{\rm s,sd}
    \end{split}
    \end{equation}
     Letting $z=1+y$, $\mathcal{G}_{P_\circ}$ becomes
                 \begin{equation}
\begin{split}
\mathcal{G}_{P_\circ}&=\frac{1}{\ln(2)}\int_{0}^{\infty}\exp(-\frac{y}{\gamma_{\rm s,sd}\sigma_{\rm s,sd}}) \frac{1}{1+y} dy\\& =\frac{1}{\ln(2)}\int_{1}^{\infty}\exp(-\frac{z-1}{\gamma_{\rm s,sd}\sigma_{\rm s,sd}}) \frac{1}{z} dy\\& =\frac{1}{\ln(2)} \exp(\frac{1}{\gamma_{\rm s,sd}\sigma_{\rm s,sd}})\int_{1}^{\infty}\exp(-\frac{z}{\gamma_{\rm s,sd}\sigma_{\rm s,sd}}) \frac{1}{z} dz
    \end{split}
    \end{equation}
Letting $\frac{z}{\gamma_{\rm s,sd}\sigma_{\rm s,sd}}=q$, we get
                 \begin{equation}
\begin{split}
\mathcal{G}_{P_\circ}&=\frac{1}{\ln(2)} \exp(\frac{1}{\gamma_{\rm s,sd}\sigma_{\rm s,sd}})\int_{\frac{1}{\gamma_{\rm s,sd}\sigma_{\rm s,sd}}}^{\infty}\exp(-q) \frac{1}{q} dq \\&= \frac{1}{\ln(2)} \exp(\frac{1}{\gamma_{\rm s,sd}\sigma_{\rm s,sd}}) \Gamma(0,\frac{1}{\gamma_{\rm s,sd}\sigma_{\rm s,sd}})
    \end{split}
    \end{equation}
where $\Gamma(.,.)$ is the upper incomplete Gamma function.
\end{proof}
   \section*{Acknowledgement}
   This paper was made possible by a NPRP grant 09-1168-2-455 from the
Qatar National Research Fund (a member of The Qatar Foundation). The
statements made herein are solely the responsibility of the authors.
\balance
\bibliographystyle{IEEEtran}
\bibliography{IEEEabrv,energy_bib}
\end{document}

TFS.bbl
% Generated by IEEEtran.bst, version: 1.13 (2008/09/30)
\begin{thebibliography}{10}
\providecommand{\url}[1]{#1}
\csname url@samestyle\endcsname
\providecommand{\newblock}{\relax}
\providecommand{\bibinfo}[2]{#2}
\providecommand{\BIBentrySTDinterwordspacing}{\spaceskip=0pt\relax}
\providecommand{\BIBentryALTinterwordstretchfactor}{4}
\providecommand{\BIBentryALTinterwordspacing}{\spaceskip=\fontdimen2\font plus
\BIBentryALTinterwordstretchfactor\fontdimen3\font minus
  \fontdimen4\font\relax}
\providecommand{\BIBforeignlanguage}[2]{{%
\expandafter\ifx\csname l@#1\endcsname\relax
\typeout{** WARNING: IEEEtran.bst: No hyphenation pattern has been}%
\typeout{** loaded for the language `#1'. Using the pattern for}%
\typeout{** the default language instead.}%
\else
\language=\csname l@#1\endcsname
\fi
#2}}
\providecommand{\BIBdecl}{\relax}
\BIBdecl

\bibitem{devroye2006achievable}
N.~Devroye, P.~Mitran, and V.~Tarokh, ``Achievable rates in cognitive radio
  channels,'' \emph{IEEE Trans. Inf. Theory}, vol.~52, no.~5, pp. 1813--1827,
  2006.

\bibitem{simeone}
O.~Simeone, Y.~Bar-Ness, and U.~Spagnolini, ``Stable throughput of cognitive
  radios with and without relaying capability,'' \emph{IEEE Trans. Commun.},
  vol.~55, no.~12, pp. 2351--2360, Dec. 2007.

\bibitem{simeone2008spectrum}
O.~Simeone, I.~Stanojev, S.~Savazzi, Y.~Bar-Ness, U.~Spagnolini, and
  R.~Pickholtz, ``Spectrum leasing to cooperating secondary ad hoc networks,''
  \emph{IEEE J. Sel. Areas Commun.}, vol.~26, no.~1, pp. 203--213, 2008.

\bibitem{krikidis2009cognitive}
I.~Krikidis, Z.~Sun, J.~N. Laneman, and J.~Thompson, ``Cognitive legacy
  networks via cooperative diversity,'' \emph{IEEE Commun. Lett.}, vol.~13,
  no.~2, pp. 106--108, 2009.

\bibitem{khattab}
M.~Elsaadany, M.~Abdallah, T.~Khattab, M.~Khairy, and M.~Hasna, ``Cognitive
  relaying in wireless sensor networks: Performance analysis and
  optimization,'' in \emph{Proc. IEEE GLOBECOM}, Dec. 2010, pp. 1--6.

\bibitem{su2011active}
W.~Su, J.~D. Matyjas, and S.~Batalama, ``Active cooperation between primary
  users and cognitive radio users in heterogeneous ad-hoc networks,''
  \emph{IEEE Trans. Signal Process.}, vol.~60, no.~4, pp. 1796--1805, 2012.

\bibitem{erph}
S.~Kompella, G.~Nguyen, J.~Wieselthier, and A.~Ephremides, ``Stable throughput
  tradeoffs in cognitive shared channels with cooperative relaying,'' in
  \emph{Proc. IEEE INFOCOM}, Apr. 2011, pp. 1961--1969.

\bibitem{Sult1212:Cooperative}
A.~{El Shafie} and A.~Sultan, ``Cooperative cognitive relaying with ordered
  cognitive multiple access,'' in \emph{Proc. IEEE GLOBECOM}, Dec 2012, pp.
  1434--1439.

\bibitem{krikidis2012stability}
I.~Krikidis, T.~Charalambous, and J.~Thompson, ``Stability analysis and power
  optimization for energy harvesting cooperative networks,'' \emph{IEEE Signal
  Process. Lett.}, vol.~19, no.~1, pp. 20--23, January 2012.

\bibitem{elshafie}
A.~{El Shafie}, A.~Sultan, and T.~Khattab, ``Maximum throughput of a secondary
  user cooperating with an {Energy-Aware} primary user,'' in \emph{Proc. IEEE
  WiOpt}, May 2014, pp. 287--294.

\bibitem{sadek}
A.~Sadek, K.~Liu, and A.~Ephremides, ``Cognitive multiple access via
  cooperation: protocol design and performance analysis,'' \emph{IEEE Trans.
  Inf. Theory}, vol.~53, no.~10, pp. 3677--3696, Oct. 2007.

\bibitem{wcm}
A.~{El Shafie}, T.~Khattab, A.~El-Keyi, and M.~Nafie, ``On the coexistence of a
  primary user with an energy harvesting secondary user: A case of cognitive
  cooperation,'' 2013, {\it To Appear} in Wireless Communications and Mobile
  Computing.

\bibitem{liang2008sensing}
Y.~Liang, Y.~Zeng, E.~Peh, and A.~Hoang, ``Sensing-throughput tradeoff for
  cognitive radio networks,'' \emph{IEEE Trans. Wireless Commun.}, vol.~7,
  no.~4, pp. 1326--1337, April 2008.

\bibitem{krikidis2010stability}
I.~Krikidis, N.~Devroye, and J.~Thompson, ``Stability analysis for cognitive
  radio with multi-access primary transmission,'' \emph{IEEE Trans. Wireless
  Commun.}, vol.~9, no.~1, pp. 72--77, 2010.

\bibitem{myprotocol}
A.~{El Shafie} and T.~Khattab, ``Cooperative cognitive relaying protocol for an
  energy harvesting cognitive radio user.''\hskip 1em plus 0.5em minus
  0.4em\relax Available [Online]:http://arxiv.org/pdf/1401.3387v1.pdf, 2014.

\end{thebibliography}
