3.1 Selection criterion
As is mentioned above, a single sourcerelay pair is selected for any frame transmission. According to the principle of the AF protocol and the considered system model, the k th (1 ≤ k ≤ K) source’s received SNR at the destination, with the help of the m th (1 ≤ m ≤ M) relay, can be expressed as
{\gamma}_{k,m}^{(d)}=\frac{{\gamma}_{{s}_{k}{r}_{m}}{\gamma}_{{r}_{m}d}}{1+{\gamma}_{{s}_{k}{r}_{m}}+{\gamma}_{{r}_{m}d}},
(1)
where{\gamma}_{{s}_{k}{r}_{m}}=P{h}_{{s}_{k}{r}_{m}}{}^{2}/{N}_{0} and{\gamma}_{{r}_{m}d}=P{h}_{{r}_{m}d}{}^{2}/{N}_{0} are the instantaneous received SNR at the m th relay from the k th source and at the destination from the m th relay, respectively.
Similarly, the received SNR at the eavesdropper can be calculated as well by simply replacing{\gamma}_{{r}_{m}d} in (1) by{\gamma}_{{r}_{m}e}, where{\gamma}_{{r}_{m}e}=P{h}_{{r}_{m}e}{}^{2}/{N}_{0} is the instantaneous SNR of the link R_{
m
} → D. Therefore, the instantaneous secrecy rate, defined as the difference between the achievable rate of the sourcedestination link and that of the sourceeavesdropper link, can be formulated as
\begin{array}{ll}\phantom{\rule{6pt}{0ex}}{C}_{\mathrm{S}}^{(k,m)}& =\left[\frac{1}{2}{log}_{2}\left(1+\frac{{\gamma}_{{s}_{k}{r}_{m}}{\gamma}_{{r}_{m}d}}{1+{\gamma}_{{s}_{k}{r}_{m}}+{\gamma}_{{r}_{m}d}}\right)\right.\\ \phantom{\rule{1em}{0ex}}{\left(\right)close="]">\frac{1}{2}{log}_{2}\left(1+\frac{{\gamma}_{{s}_{k}{r}_{m}}{\gamma}_{{r}_{m}e}}{1+{\gamma}_{{s}_{k}{r}_{m}}+{\gamma}_{{r}_{m}e}}\right)}^{}+& ,\end{array}\n
(2)
where [x]^{+} = max(0,x). In order to minimize the secrecy outage probability, defined as the probability that the instantaneous secrecy rate falls below a target secrecy rate, our criterion is to select such a sourcerelay pair (k^{∗},m^{∗}) that can maximize the secrecy rate in (2). That is,
\begin{array}{ll}\phantom{\rule{6pt}{0ex}}\left({k}^{\ast},{m}^{\ast}\right)& =\underset{1\le k\le K,1\le m\le M}{\text{arg max}}\left\{\frac{1+\frac{{\gamma}_{{s}_{k}{r}_{m}}{\gamma}_{{r}_{m}d}}{1+{\gamma}_{{s}_{k}{r}_{m}}+{\gamma}_{{r}_{m}d}}}{1+\frac{{\gamma}_{{s}_{k}{r}_{m}}{\gamma}_{{r}_{m}e}}{1+{\gamma}_{{s}_{k}{r}_{m}}+{\gamma}_{{r}_{m}e}}}\right\}\\ \triangleq \underset{1\le k\le K,1\le m\le M}{\text{arg max}}\left\{{\gamma}_{e2e}^{(k,m)}\right\}\end{array}
(3)
With this criterion, the achievable secrecy outage probability can be expressed as
\begin{array}{ll}\phantom{\rule{6pt}{0ex}}{P}_{\text{out}}^{\mathrm{S}}& =\text{Pr}\left[{C}_{\mathrm{S}}^{\left({k}^{\ast},{m}^{\ast}\right)}<{R}_{\mathrm{S}}\right]=\text{Pr}\left[\frac{1}{2}{log}_{2}\left({\gamma}_{e2e}^{\left({k}^{\ast},{m}^{\ast}\right)}\right)<{R}_{\mathrm{S}}\right]\\ =\text{Pr}\left[{\gamma}_{e2e}^{\left({k}^{\ast},{m}^{\ast}\right)}<v\right],\end{array}
(4)
where R_{S} represents the target secrecy rate, andv={2}^{2{R}_{\mathrm{S}}}. Since R_{S} is positive, v should be larger than 1.
If the global CSI is available at some node, e.g., the RSU, the criterion in (3) can be implemented in a centralized manner. However, it is nontrivial to obtain the CSI of all the involved links, especially for the networks with a large number of nodes. This motivates us to develop the distributed algorithm with low complexity, the details of which will be given in the next subsection.
3.2 Lowcomplexity distributed scheme
The proposed lowcomplexity design is based on the observation of (3), which tells us that the achievable secrecy rate is determined by{\gamma}_{e2e}^{\left({k}^{\ast},{m}^{\ast}\right)}, the maximum ofK\times M{\gamma}_{e2e}^{(k,m)}’s. According to the selection criterion in Sect. III. A,{\gamma}_{e2e}^{\left({k}^{\ast},{m}^{\ast}\right)} can also be viewed as{\gamma}_{e2e}^{\left({k}^{\ast},{m}^{\ast}\right)}={max}_{1\le m\le M}\{{\gamma}_{e2e}^{m}\}, where{\gamma}_{e2e}^{m} is defined as
{\gamma}_{e2e}^{m}=\underset{1\le k\le K}{\text{max}}\left\{\frac{1+\frac{{\gamma}_{{s}_{k}{r}_{m}}{\gamma}_{{r}_{m}d}}{1+{\gamma}_{{s}_{k}{r}_{m}}+{\gamma}_{{r}_{m}d}}}{1+\frac{{\gamma}_{{s}_{k}{r}_{m}}{\gamma}_{{r}_{m}e}}{1+{\gamma}_{{s}_{k}{r}_{m}}+{\gamma}_{{r}_{m}e}}}\right\}
(5)
With the above observation in mind, we can divide the overall selection procedure into three steps. First, every relay node independently evaluates its eligibility for cooperation. After that, each eligible relay selects an appropriate source to maximize its contribution to the achievable secrecy rate. In this way, all the candidate sourcerelay pairs are generated. Finally, a single pair with the maximum{\gamma}_{e2e}^{(k,m)} is screened out from the candidate pairs to access the channel. The details of these steps are given in the following:

Step 1: Generating the Set of Eligible Relays. For any relay node R_{
m
}, it can be deduced from (3) that if{\gamma}_{{r}_{m}d}<{\gamma}_{{r}_{m}e}, then{\gamma}_{e2e}^{(k,m)} will be less than 1, irrespective of the source index k. In other words, the system will be in outage if this relay node is selected to access the channel, no matter which source is chosen to form the pair.
Further, when{\gamma}_{{r}_{m}d}\ge {\gamma}_{{r}_{m}e}, the secrecy outage probability, with R_{
m
} being the selected relay, can be expressed as
\begin{array}{ll}\phantom{\rule{6pt}{0ex}}{P}_{\text{out}}^{S}& =\text{Pr}\left[{\gamma}_{e2e}^{\left({k}^{\ast},m\right)}<v\right]\\ \stackrel{(a)}{\ge}\text{Pr}\left[\frac{\frac{{\gamma}_{{s}_{{k}^{\ast}}{r}_{m}}{\gamma}_{{r}_{m}d}}{1+{\gamma}_{{s}_{{k}^{\ast}}{r}_{m}}+{\gamma}_{{r}_{m}d}}}{\frac{{\gamma}_{{s}_{{k}^{\ast}}{r}_{m}}{\gamma}_{{r}_{m}e}}{1+{\gamma}_{{s}_{{k}^{\ast}}{r}_{m}}+{\gamma}_{{r}_{m}e}}}<v\right]\\ =\text{Pr}\left[\frac{{\gamma}_{{r}_{m}d}}{{\gamma}_{{r}_{m}e}}\times \frac{1+{\gamma}_{{s}_{{k}^{\ast}}{r}_{m}}+{\gamma}_{{r}_{m}e}}{1+{\gamma}_{{s}_{{k}^{\ast}}{r}_{m}}+{\gamma}_{{r}_{m}d}}<v\right]\\ =\text{Pr}\left[{\gamma}_{{s}_{{k}^{\ast}}{r}_{m}}\left({\gamma}_{{r}_{m}d}v{\gamma}_{{r}_{m}e}\right)<v{\gamma}_{{r}_{m}e}\left(1+{\gamma}_{{r}_{m}d}\right)\right.\\ \phantom{\rule{1em}{0ex}}\left(\right)close="]">{\gamma}_{{r}_{m}d}\left(1+{\gamma}_{{r}_{m}e}\right)& ,\end{array}\n
(6)
where (a) stems from the fact that\frac{b+1}{a+1}<\frac{b}{a} for a < b. If{\gamma}_{{r}_{m}e}<{\gamma}_{{r}_{m}d}<v{\gamma}_{{r}_{m}e}, we havev{\gamma}_{{r}_{m}e}\left(1+{\gamma}_{{r}_{m}d}\right){\gamma}_{{r}_{m}d}\left(1+{\gamma}_{{r}_{m}e}\right)>0 and{\gamma}_{{s}_{{k}^{\ast}}{r}_{m}}\left({\gamma}_{{r}_{m}d}v{\gamma}_{{r}_{m}e}\right)<0. Therefore, the probability provided by (6) equals to 1, implying that the outage event definitely occurs if we choose such a relay to cooperate.
Summarizing the discussions above, we can conclude that to support the target secrecy rate, the selected relay has to satisfy the following condition:
{\gamma}_{{r}_{m}d}>v{\gamma}_{{r}_{m}e}
(7)
In other words, if the channel gains regarding R_{
m
} does not meet (7), R_{
m
} cannot be selected. In steps 2 and 3, we will only focus on the eligible relays satisfying (7).
It should be emphasized that the eligibility determination process requires the knowledge of{\gamma}_{{r}_{m}d} and{\gamma}_{{r}_{m}e} at R_{
m
}. However, this can be guaranteed because we have assumed that both the RSU and the eavesdropper are active entities which will transmit control information or messages, and the corresponding channel gains can be estimated at the relays using the pilots from the received signals.

Step 2: Source Selection at Eligible Relays. After step 1 has been finished, all the relays satisfying (7) broadcast flag signals to declare its eligibility for cooperation. Upon receiving the flag signals, all the sources will send an ACK to respond. With the received ACKs, any eligible relay R_{
m
} can estimate{\gamma}_{{s}_{k}{r}_{m}} for all k s. After that, R_{
m
} supposes itself to be the selected relay and chooses the ‘best’ source which can contribute most to{\gamma}_{e2e}^{(k,m)}. To elaborate on how to find such a source node, a lemma will be introduced first.
Lemma 1. The function
f(\gamma )=\frac{1+\frac{{\gamma}_{1}\gamma}{1+{\gamma}_{1}+\gamma}}{1+\frac{{\gamma}_{2}\gamma}{1+{\gamma}_{2}+\gamma}},
(8)
where γ_{1}and γ_{2}are two constants with γ_{1}being larger than γ_{2}, is an increasing function of γ.
Proof. By taking the derivative of f(γ) with respect to γ, we can obtain
{f}^{\prime}(\gamma )=\frac{\left(1+{\gamma}_{1}\right)\left({\gamma}_{1}{\gamma}_{2}\right)}{{\left(1+\gamma +{\gamma}_{1}\right)}^{2}\left(1+{\gamma}_{2}\right)}
(9)
which is obviously larger than 0 for γ_{1} > γ_{2}. Therefore, f(γ) is an increasing function of γ. □
Based on this lemma, the ‘best’ source for R_{
m
}, i.e.,{S}_{{k}^{\ast}(m)}, should be the one with the following property:
\begin{array}{ll}\phantom{\rule{6pt}{0ex}}{k}^{\ast}(m)& =\underset{1\le k\le K}{\text{arg max}}\left\{\frac{1+\frac{{\gamma}_{{s}_{k}{r}_{m}}{\gamma}_{{r}_{m}d}}{1+{\gamma}_{{s}_{k}{r}_{m}}+{\gamma}_{{r}_{m}d}}}{1+\frac{{\gamma}_{{s}_{k}{r}_{m}}{\gamma}_{{r}_{m}e}}{1+{\gamma}_{{s}_{k}{r}_{m}}+{\gamma}_{{r}_{m}e}}}\right\}\\ =\underset{1\le k\le K}{\text{arg max}}{\gamma}_{{s}_{k}{r}_{m}}\end{array}
(10)
It is no doubted that step 2 also enjoys a distributed implementation since the source selection is performed at the eligible relays, and there is no information exchange among different relay nodes.
To select the optimal sourcerelay pair, we adopt the method based on the distributed timer[14]. Specifically, after calculating{C}_{\mathrm{S}}^{m}, each eligible relay R_{
m
} will start its timer with the initial value inversely proportional to{C}_{\mathrm{S}}^{m}. Therefore, the relay with the largest{C}_{\mathrm{S}}^{m}, namely{R}_{{m}^{\ast}}, has its timer expired first.{R}_{{m}^{\ast}} then broadcasts the flag signal and the rest of the relays will back off after receiving the flag signal. Noticing the fact that the ‘best’ source for{R}_{{m}^{\ast}} has already been determined to be{S}_{{k}^{\ast}(m\ast )} in step 2, we now have the selected sourcerelay pair.
Remark 1. The proposed sourcerelay selection scheme has two advantages. First, it can be realized in a distributed way, yielding a low implementation complexity. This is of practical significance for vehicular networks. Second, the distributed method, despite of its simplicity, is an optimal solution in the sense that it can select the ‘best’ sourcerelay pair to minimize the system secrecy outage probability.