Resource Allocation for Secure Gaussian Parallel Relay Channels with Finite-Length Coding and Discrete Constellations

We investigate the transmission of a secret message from Alice to Bob in the presence of an eavesdropper (Eve) and many of decode-and-forward relay nodes. Each link comprises a set of parallel channels, modeling for example an orthogonal frequency division multiplexing transmission. We consider the impact of discrete constellations and finite-length coding, defining an achievable secrecy rate under a constraint on the equivocation rate at Eve. Then we propose a power and channel allocation algorithm that maximizes the achievable secrecy rate by resorting to two coupled Gale-Shapley algorithms for stable matching problem. We consider the scenarios of both full and partial channel state information at Alice. In the latter case, we only guarantee an outage secrecy rate, i.e., the rate of a message that remains secret with a given probability. Numerical results are provided for Rayleigh fading channels in terms of average outage secrecy rate, showing that practical schemes achieve a performance quite close to that of ideal ones.


Linda Senigagliesi, Marco Baldi and Stefano Tomasin
Abstract-We investigate the transmission of a secret message from Alice to Bob in the presence of an eavesdropper (Eve) and many of decode-and-forward relay nodes. Each link comprises a set of parallel channels, modeling for example an orthogonal frequency division multiplexing transmission. We consider the impact of discrete constellations and finite-length coding, defining an achievable secrecy rate under a constraint on the equivocation rate at Eve. Then we propose a power and channel allocation algorithm that maximizes the achievable secrecy rate by resorting to two coupled Gale-Shapley algorithms for stable matching problem. We consider the scenarios of both full and partial channel state information at Alice. In the latter case, we only guarantee an outage secrecy rate, i.e., the rate of a message that remains secret with a given probability. Numerical results are provided for Rayleigh fading channels in terms of average outage secrecy rate, showing that practical schemes achieve a performance quite close to that of ideal ones.
Index Terms-Channel state information, decode-and-forward, physical layer security, relay channel, resource allocation.

I. INTRODUCTION
Adding secrecy features to the physical layer is an active and promising research area [1], that complements traditional computational security approaches. Indeed, a proper coding scheme can prevent an eavesdropper Eve from getting information on a message exchanged between the two legitimate users Alice and Bob [2].
In this paper we expand the results of [3] on resource allocation for confidential communications over the Gaussian parallel relay channels, by including the more practical constraints of finite-length coding and discrete constellations. We first derive the achievable secrecy rate of this scheme under the assumption of full channel state information (CSI) by Alice and the relay nodes. Then in order to consider the impact of discrete constellations and finite-length coding we define an achievable secrecy rate under a constraint on the equivocation rate at Eve. Using an approximated formula of the achievable secrecy rate we derive the optimal power allocation for pointto-point confidential transmission. By exploiting the power and rate adaptation algorithm for the parallel relay channels of [3], we obtain a resource allocation algorithm coupling two Gale The material in this paper was presented in part at the IEEE Conference on and Shapley algorithms to allocate resources over the parallel relay channels. We also consider the partial CSI scenario, in which Alice does not know the gains of her channels to Eve, while their statistics are known. In this case we only guarantee an outage secrecy rate, i.e., the rate of a message that remains secret with a given probability. We show that the algorithm derived for full CSI can be easily adapted to the partial CSI scenario. Numerical results are provided, showing the merit of the proposed solution.

A. Related Works
The physical layer security of messages transmitted over parallel channels with the assistance of trusted relays has already been addressed in the literature. Most works consider that relays can either forward the message or generate a noise signal to jam Eve. For links comprising a single channel, early works have addressed the relay selection problem [4]- [7], while various combinations of message forwarding and jamming are considered in [8]- [10] with multiple antennas nodes. In [11] multiple relays either jam or forward noise, i.e., they transmit random codewords from a globally known codebook, that hurts more Eve than Bob.
We focus on links comprising parallel channels. For this scenario, in [12] rate-equivocation regions are derived by considering one relay only and assuming full CSI. In [13] orthogonal frequency division multiplexing (OFDM) is considered with a single relay, and Eve is equipped with multiple antennas under partial CSI: subcarriers, powers and rates are optimized to maximize the average secrecy outage capacity. In [14] the downlink of a cellular system is considered -where the multi-antenna base station performs both beamforming and jamming against a single multi-antenna eavesdropper, and an outage problem is formulated under partial CSI. The scenario is extended in [15], where multiple relays operate in decode and forward (DF) mode and still an outage approach is considered. In [16] a single relay with parallel channels is considered, which performs cooperative jamming against Eve, under full CSI. When the single relay performs DF, resource optimization has been considered in [17]. More comprehensive results, considering also the direct transmission from Alice to Bob are obtained in [18]. Resource allocation for transmission over parallel channels assisted by DF relays without secrecy features has also been widely studied. Bit loading [19] and power and rate allocation [20] have been investigated, while the availability of multiple relays transmitting on a single Alice r 1 r N Bob Eve . . . sub-carrier is studied in [21], with efficient greedy algorithms provided in [22]. The resource allocation for parallel channels with secrecy outage constraint has been considered in [23] and [24].
Recently, optimal resource allocation for security purposes under different conditions has gained the attention of several authors. In [25], an optimization framework is proposed for two-hop communications that jointly optimizes source and relay powers, and transmission time in each hop, with the goal of maximizing the secrecy outage capacity in a massive multiple input multiple output (MIMO) scenario. In [26], optimal power allocation and pricing strategies are determined using a Stackelberg game model in order to maximize the players' utilities, under both of perfect and imperfect CSI assumptions and in the presence of multiple eavesdroppers. An optimal power strategy to maximize the achievable secrecy rates in wireless multi-hop DF relay networks with a power constraint is studied in [27], under the assumption of global CSI, and an iterative cooperative beamformer design is also proposed. The work is extended in [28] to the case of fullduplex relays, with cooperative beamforming to null out the signal at multiple eavesdroppers. In [29] a heuristic resource allocation iterative algorithm is presented, based on the proximal theory that maximizes the secure capacity of deviceto-device communications in heterogeneous networks. Joint source-relay power optimization in a dual-hop communication using duality theory is performed in [30], with the aim of maximizing the overall secrecy rate, under individual power constraints and using an high SNR approximation. In [31], a robust resource allocation framework is proposed in the presence of an active eavesdropper, assuming that both the legitimate receiver and the eavesdropper are full-duplex: the receiver sends jamming signals against the eavesdroppers, without the need for external helpers, and uncertain CSI on the links between the eavesdropper and the legitimate receivers is considered. Optimization algorithms for null space beamforming with full CSI have been proposed in [32].

B. Contribution
With respect to the previously described state of the art, the main contributions of this paper can be summarized as follows.
• No existing work considers the role of finite-length codes and discrete constellations on the secrecy rate. Motivated by this, we provide a formulation of the secrecy rate under practical constraints and compare it with the achievable rate in ideal conditions. We consider both perfect and partial CSI under outage constraints. • By proposing an approximated expression for the secrecy rate under practical conditions we optimize the linklevel parallel channel power allocation generalizing the solution of the ideal transmission scenario. • Extending the approach in [3], we maximize the secrecy rate by resorting to an iterative algorithm based on the Gale and Shapley theory for the stable matching problem. • Through numerical examples we show that it is possible to achieve acceptable performance from the secrecy rate standpoint even using short codes and constellations with a small alphabet. The rest of the paper is organized as follows. Section II outlines the system model for secret message transmission over parallel Gaussian relay channels. The achievable secrecy rates under full CSI are computed in Section III, where we also compute the outage secrecy rate. In Section IV an algorithm for resource allocation of a secure point-to-point transmission over parallel channels is obtained, which is used then in Section V for the resource allocation in a relay network. Numerical results of the proposed solution are presented in Section VI, before some conclusions are drawn in Section VII.
Notation: Vectors and matrices are written in bold letters. We denote the base-2 and natural-basis logarithm by log and ln, respectively. We indicate the positive part of a real quantity x as [x] + = max{x; 0}. E[X] denotes the expectation of the random variable X, P[·] is the probability operator, and T denotes the matrix transpose operator. The entropy is denoted as H(·), while the mutual information is denoted as I(·; ·).

II. SYSTEM MODEL
We consider a communication system to transmit a confidential message M from Alice to Bob through N trusted cooperating relays. Any link between a pair of devices is constituted by a set of K parallel additive white Gaussian noise (AWGN) channels. Eve is an eavesdropping device that overhears communications originated from both Alice and the relays. No direct link between Alice and Bob is available, and all devices operate in half-duplex mode. Therefore the message transmission comprises two phases: 1) Alice transmits to the relays, and 2) the relays transmit to Bob.
We also assume that in phase 2 at most one relay transmits on channel k and that the two phases have the same duration. Fig. 1 shows the power flow of the considered scenario. We indicate with P n,k the transmit power of Alice on channel k to relay n in phase 1, whileP n,k is the transmit power of relay n on channel k in phase 2. The N × K matrix P (P ) collects all transmit powers, having P n,k (P n,k ) at entry n, k. In Fig.  1, P 1 K denotes the N -size column vector of transmit powers for each relay, with 1 K being the K-size column vector of all ones. We consider power constraints for both Alice and the relays, i.e., K k=1 P n,k ≤ P tot,1 , n = 1, . . . , N .
The power constraint per relay in phase (1) simplifies the power allocation in this phase and still provides an upper bound on the total transmit power from the source, that can not exceed N P tot,1 .
The link from Alice to relay n is represented by the Ksize column vector H n = [H n,1 , . . . , H n,K ] T containing the gains for each channel. The power of the data signal received by relay n on channel k is therefore H n,k P n,k . Similarly, the vectorH n denotes the power gains of the link between relay n and Bob andH n,kPn,k is the power of the data signal received by Bob from relay n on channel k. For links to Eve, G is the vector of power gains of the signal coming from Alice, whilē G n is the power gain vector of the signal coming from relay n.
The noise is assumed to be independent identically distributed (iid), with zero mean and unitary (σ 2 n = 1 in Fig. 1) variance for all channels. Therefore, the signal to noise ratio (SNR) at relay n for a transmission from Alice on channel k is H n,k P n,k , and similarly for a transmission from relay n on channel k the SNR at Bob in phase 2 isH n,kPn,k .

III. ACHIEVABLE SECRECY RATE
We consider a per-channel encoding, i.e., Alice splits M into K messages M k , k = 1, . . . , K, each of which is separately encoded and transmitted on a channel. In [24] an indepth analysis of this coding strategy is provided, showing that it performs similarly to the scheme with joint coding across channels, while being simpler to design. Therefore, each relay in general receives only a subset of the entire message bits. In the second phase again each relay splits the received secret bits into groups, which are separately encoded and transmitted on a different channel, among those assigned to the relay.
In both phases, secrecy is achieved through classical wiretap coding [1], based on adding random bits to the secret message and encoding the resulting block with capacity achieving codes. The weak secrecy rate of a point-to-point transmission is the rate of a message M that [1]: i) is correctly decoded by Bob and ii) has a rate of mutual information with the signal received by Eve Z that is vanishing for infinite codewords, i.e., lim where l is the message length in bits. Due to the per-channel encoding, the achievable weak secrecy rate is the sum of the achievable secrecy rates on each used channel. Let R n,k be the secrecy rate on channel k, intended for relay n in phase 1, andR n,k the secrecy rate on channel k transmitted by relay n in phase 2. The achievable secrecy rate between Alice and Bob is the minimum between the secrecy rates in both phases, i.e., where the factor 1/2 is due to the two phases of the same duration, and we have highlighted the dependence of the achievable rates on the transmit powers.
Since we assume that Alice is transmitting to a single relay per channel we also have and since we assume that at most one relay is transmitting in any channel in phase 2 we also havē In the following we derive the achievable secrecy rates, when full CSI is available at Alice, taking into consideration infinite and finite-length coding, continuous and discrete modulation formats. Then with discuss the ǫ-outage achievable secrecy rates when Alice has only a partial CSI, i.e., she knows only the statistics of her channels to Eve.

A. Infinite-length coding with Gaussian Constellations
When infinite-length coding and Gaussian constellations are used, perfect secrecy, i.e., no information leakage to Eve, can be achieved [1]. In this case, the achievable secrecy rate can be written as where C(x) = log(1 + x). Similar expressions are obtained forR n,k (P n,k ) where P n,k , H n,k , and G n,k are replaced bȳ P n,k ,H n,k andḠ n,k , respectively.

B. Finite-length Coding with Gaussian Constellations
A first limitation to the achievable secrecy rates introduced by practical systems is related to the use of codes working on finite-length blocks of symbols. For simplicity and adherence to practical systems, we consider deterministic coding, according to which each l-bit block of data is univocally mapped into a codeword C n,k . This is opposed to either random or coset coding, which are often invoked in the literature for this kind of systems, but yield further issues (e.g., concerning the generation of randomness). In our setting, weak secrecy cannot be guaranteed and Eve can get some information on the secret message 1 . Moreover, the decodability condition at Bob cannot be guaranteed, and we will consider a non-zero codeword error rate (CER) κ.
In order to measure the information leakage to Eve we resort to the equivocation rate, i.e., Eve's uncertainty about the message after observing the transmitted codeword (through her channel). For relay n transmitting on channel k and using codewords of m symbols, the equivocation rate per symbol is where the factor 2 comes from the fact that we have two phases of the same duration. We have that 0 ≤ ρ n,k (P n,k , R n,k (P n,k )) ≤ R n,k (P n,k ) , 0 ≤ρ n,k (P n,k ,R n,k (P n,k )) ≤R n,k (P n,k ), where the upper bound is achieved with infinitely-long codewords (m → ∞). We will consider that the transmission system is secure if ρ n,k (P n,k , R n,k (P n,k )) R n,k (P n,k ) ≥ θ ,ρ n,k (P n,k ,R n,k (P n,k )) R n,k (P n,k ) ≥ θ , where θ ∈ (0, 1] is a suitably defined parameter that limits the gap with respect to weak secrecy conditions with infinitelength coding. The achievable secrecy rates for finite-length coding are therefore the maximum rates satisfying condition (11), i.e., R n,k (P n,k ) = max A similar problem can be written for phase 2, for a given allocated powerP n,k , i.e., R n,k (P n,k ) = max r r (13a) s.t.ρ n,k (P n,k , r) r ≥ θ , (13b) In the following we focus on problem (12) as problem (13) is analogous.
For the computation of the equivocation rate we resort to a lower bound. By the definition of entropy and mutual information, we have that Eve's equivocation rate can be rewritten as where Z n,k is the signal received by Eve in phase 1. By the definition of spectral efficiency as upper bound to the mutual information, we also have I(C n,k ; Z n,k ) < mC(P n,k G n,k ) .
On the other hand, the entropy of C n,k depends on the code rate, which in turns determines the (non null) CER κ at relay n, due to the use of finite-length coding. A Gaussian approximation on the code rate as a function of the CER for finite-length coding is provided by [33], that can be written as where [x] + = x for x ≥ 0 and 0 otherwise, and Q(·) is the complementary cumulative distribution function of the standard Gaussian variable. Therefore, we have the following approximation on Eve's equivocation rate ρ n,k (P n,k ,R n,k (P n,k )) ≃ ξn, k(P n,k ) By replacing ρ n,k (P n,k , R n,k (P n,k )) with its approximated lower bound ξ n,k (P n,k ) (and similarly for phase-2 equivocation rates) in problems (12) and (13), we obtain the approximated achievable rates in the two phases; the solution can be obtained by numerical methods.
Note that (18) directly models the achievable secrecy rate rather the equivocation rate, and the parameters α i are chosen at solution of problem (12). By this formulation the secrecy rates with ideal conditions can be seen as a sub-case of (18) with α i = 1 for i = 2, 3, 4, 5 and α i = 0 otherwise. Fig. 2 shows R n,k (P n,k ) as a function of G n,k P n,k for values of H n,k /G n,k between 2 dB and 20 dB with a step of 1 dB, and results obtained by the fitting function (18) with We observe a good agreement of the fitting function with R n,k (P n,k ), especially at low rates, and high values of G n,k P n,k , with a slight overestimation of the rate for intermediate values of G n,k P n,k for high H n,k /G n,k ratios.

C. Infinite-length Coding with Discrete Constellations
A second limitation of practical systems is the use of suboptimal constellations with discrete points taken from a finite alphabet. In this case, perfect secrecy can still be achieved, but we must consider the constellation-constrained spectral efficiencyĈ(·) instead of C(·), i.e., (6) becomes R n,k (P n,k ) =Ĉ(P n,k H n,k ) −Ĉ(P n,k G n,k ) .
In order to obtain simple resource allocation algorithms we consider the fitting ofĈ(x) with a linear combination of logarithmic functions, i.e., In addition, when the SNR x is larger than a prefixed threshold, C(x) is clipped to the number of bits per symbol of the discrete constellation in order to model the saturation of the constellation-constrained spectral efficiency function. Fig. 3 shows the approximation (20) ofĈ(x) as a function of the SNR for QPSK, 16-QAM and 64-QAM constellations, and its comparison with the exact function. We observe a good agreement between the approximated and the exact curves.

D. Finite-length Coding with Discrete Constellations
Let us consider the limitations introduced in Sections III-B and III-C jointly, i.e., both finite-length coding and discrete constellations, which describe a practical scenario. Also in this case we resort to the equivocation rate for the definition of the achievable secrecy rate (see problems (12) and (13)), by replacing the spectral efficiency C(P ) with the constellationconstrained spectral efficiencyĈ(P ) in (17). On the other hand, since the approximation provided by [33] is valid for any input distribution, (16) still holds true. As already done in the previous section, we propose to fit R n,k (P n,k ) by the function (18). Fig. 4 shows R n,k (P n,k ) for values of H n,k /G n,k between 2 dB and 20 dB with a step of 1 dB, and results obtained by the fitting function (18) with κ = 10 −3 , 16-QAM constellation and m = 4, 096.

E. ǫ-Outage Achievable Secrecy Rate
In many practical scenarios Alice and the relays have only a partial CSI of their channels to Eve. This is mainly due to the fact that Eve may not have an advantage in revealing its channels, e.g., by transmitting, unless this could be useful to increase the rate of other messages exchanged between her and the legitimate nodes. Indeed, in the absence of full CSI there is a non-zero probability (outage probability) that for any power allocation and choice of the secret message rate Eve may get some information on M.
In particular, we focus on the secrecy outage probability in each transmission phase and for each channel. Let π n,k and π n,k be the secrecy outage probabilities on channel k with respect to relay n in the first and the second phase, when messages are transmitted at rates R n,k (P n,k ) andR n,k (P n,k ), respectively. We consider as design criterion the limitation of the secrecy outage probability on each channel, i.e., π n,k ≤ ǫ ,π n,k ≤ ǫ , where ǫ is the target secrecy outage probability.
In the following we assume that the legitimate nodes know the statistics of both G n,k andḠ n,k , thus having a partial CSI. If R n,k (P n,k ) is the achievable secrecy rate for Alice-Eve channel realization G * n,k , then the secrecy outage probability can be written as Similar expressions are obtained for the second phase. From (21) we define F ǫ as the outage gain, i.e., the channel gain for which π n,k = P[G n,k > F ǫ ] = ǫ .
Then the ǫ-outage achievable secrecy rate can be obtained from the previous sections by considering G n,k =Ḡ n,k = F ǫ .

IV. SINGLE LINK POWER OPTIMIZATION
We first consider the single-link power optimization, where we allocate powers that maximize the secrecy sum rate between two nodes, using parallel channels. This problem must be solved in both transmission phases and here we focus on the first phase, i.e., the optimization of the communication from Alice to a specific relay n, assuming that all power P tot,1 can be used on that link. In this situation we have P n ′ ,k = 0 for n ′ = n, n = 1, . . . , N , k = 1, . . . , K and we must solve The four cases of previous section are considered, i.e., a) infinite-length coding with Gaussian constellations, b) finitelength coding with Gaussian constellations, c) infinite-length coding with discrete constellations, and d) finite-length coding with discrete constellations. Moreover, we consider here the case of ǫ-outage rates discussed in Section III-E, thus considering gain F ǫ for all channels to Eve.

A. Infinite-length Coding with Gaussian Constellations
For infinite-length coding with Gaussian constellations, the optimization problem (24) has been solved in [34]. In particular, we immediately see that all channels for which H n,k < F ǫ must be switched off (P n,k = 0) since they do not provide any secrecy rate. Let the set of used channels be Then we have where λ is the Lagrange multiplier to be optimized in order to satisfy the power constraint, which can be computed by a dichotomic search.

B. Finite-length Coding with Gaussian Constellations
For finite-length coding with Gaussian constellations we exploit the fitting (18) and the optimization problem (24) becomes subject to (1).
For all real positive roots of the polynomial, we compute (19) and select the root yielding the highest secrecy rate. When no real roots are found, it means that the secrecy rate is strictly decreasing for P n,k > 0, thus P n,k = 0 and a null secrecy rate is achieved. Note that the algorithm must include a dichotomic search over λ in order to satisfy the power constraints. Again, note that the solution to problem (27) is a generalization of the solution (26) for ideal transmission conditions.

C. Infinite-length Coding with Discrete Constellations
For infinite-length coding with discrete constellations, the optimization problem (24) using the fitting (20) becomes subject to (1).
By comparing (27) with (31), we note that the two problems are very similar, hence by applying also in this case the Lagrange multiplier method we obtain again (30), with the following coefficient values

D. Finite-length coding with discrete constellation
For finite-length coding with discrete constellations, the optimization problem (24) using the fitting (18) becomes (27) and the Lagrange multiplier methods leads to (29).

V. MAXIMUM RATE POWER ALLOCATION
We now consider the power allocation problem at Alice and Bob with the aim of maximizing the secrecy rate, i.e.,  and rate constraints (4) and (5). (33c) As observed in [3], this is a mixed-integer programming problem, and for its solution we resort to the iterative approach of [3] based on the game-theoretic Gale and Shapley algorithm for the stable matching problem [35]. Next we summarize the algorithm, while referring the reader to [3] for its detailed description.
The stable matching problem aims at matching dames to cavaliers, without having a dame and a cavalier belonging to two different couples both preferring to be matched. In our scenario, dames and cavaliers are channels and relay, respectively, and the preference of matching is the achievable secrecy rate when using the channel for that relay. We have actually two coupled stable matching problems for the two phases. We use an iterative algorithm, where at each iteration one step of the Gale and Shapley algorithm is performed for both problems.
We start computing the overall rates obtained by assigning all channels to each relay in phase 2 (finding the best power allocation for both phases and the best channel assignment in phase 1), and then we exclude the relay-channel couple in phase 2 that provides the lowest rate. At the second iteration we compute the overall rates obtained by assigning all channels (except the couple excluded in the first iteration) to each relay in phase 2 (again optimizing powers and phase-1 channel allocation), before excluding another relay-channel couple in phase 2 that provides the lowest rate. The process is iterated excluding a couple at each iteration until for each channel we have at most one associated relay in phase 2. Within each iteration the channel allocation for phase 1 is obtained again by the Gale and Shapley algorithm applied to the matching of channels and relays in phase 1 (for a given allocation in phase 2).

A. Simulation Scenario
Let us consider the scenario reported in Fig. 5, where the relay nodes are positioned along a line that is orthogonal to the segment between Alice to Bob, intersecting it at a distance d I and d II from Alice and Bob, respectively. Moreover, relays are equispaced with a distance ∆ between any two adjacent relays. We further assume that the eavesdropper is at least at a distance d E from any transmitting node, i.e., it is outside of the dashed circles surrounding Alice and the relays. The K = 16 channels between any couple of nodes are assumed independent Rayleigh fading. We also consider P tot,1 = P tot,2 = 1. The average SNR at unitary distance is of 0 dB, and the path loss coefficient is 3.5, thus the average SNR at distance d is d −3.5 . About the eavesdropper, since it is assumed to be at a minimum distance d E from any transmitting node, the outage gain is obtained from (23) and from the Rayleigh fading assumption P[G n,k ≤ For finite-length coding we assume a CER at Bob κ = 10 −3 and m = 128 and 4, 096.

B. Impact of Eve's distance
We first consider a scenario in which each relay has the same distance from Alice and Bob, i.e., d I = d II = 0.8, the separation between relays is ∆ = 0.05, the number of relays is N = 2, 4 or 8.
Figs. 6-9 show the average maximum outage secrecy rate E[R max ], averaged over channel realizations, as a function of d E , for a target secrecy outage probability ǫ = 10 −4 , and comparing different coding and constellations settings. In particular, Fig. 6 reports results for a transmission using infinitelength coding and both Gaussian and discrete constellations, Fig. 7 shows results for finite-length coding and both Gaussian and discrete constellations. In both cases we note that, as expected, Gaussian signaling outperforms discrete modulation (16-QAM) in terms of secrecy rate, regardless of the use of infinite-or finite-length codes. Moreover, by increasing the number of relays, the average maximum outage secrecy rate increases, as a diversity gain is available on the links among legitimate nodes. Moreover, as d E → ∞ we note that the rate curves flattens in correspondence of the unsecure rate of the relay parallel channels, as in this case security conditions are always met and the performance is limited only by the legitimate channel conditions.

C. Impact of Codeword Length
In Figs. 8 and 9 the impact of finite-length coding for both Gaussian and discrete constellations is investigated. Note that the performance of codes with long codewords (m = 4, 096) is comparable to that of infinite-length coding. Considering a 16-QAM, differences between infinite-length coding and 4,096length coding are negligible as the average maximum outage secrecy rates coincide for all numbers of relay nodes. In Fig.  9 we note that short codes (m = 128) instead visibly degrade the average maximum secrecy rate.

D. Impact of Relative Node Distances
We then study the impact of the relative distances among legitimate nodes. In particular, we fix the Alice-Bob distance to d I + d II = 2, and we let the ratio between the two distances d I /d II and the distance among the relays vary, i.e., ∆ = {0.05, 0.1, 0.5}, for d E = 10, ǫ = 10 −4 and N = 4 relays. Fig. 10 shows the average maximum outage secrecy rate as a function of d I /d II , and finite-length coding (m = 4, 096) with Gaussian constellations. We observe that for decreasing values of ∆ the curves tend asymptotically to a maximum average secrecy rate of 2 b/s/Hz. On the other hand, as d I /d II tends to infinity, the average maximum outage secrecy rate tends to zero, as the Alice-relay links will provide vanishing data rates. When the distance ∆ tends to zero all the relay nodes are squeezed in the same point between Alice and Bob, which represents the optimal relaying configuration.

E. Comparison With Other Solutions
Figs. 11 and 12 provide a comparison between our resource allocation (denoted as Gale-Shapley, or GS) strategy and two suboptimal solutions, respectively uniform power allocation over the K channels and water-filling allocation. Various scenarios are considered, i.e. infinite-length codes with Gaussian signaling and finite-length coding with discrete constellations. We also consider that each relay has the same distance from Alice and Bob, i.e., d I = d II = 0.8, the separation between relays is ∆ = 0.05, the number of relays is N = 2, 4 or 8. Water-filling provides the best possible power allocation in Eve's absence, since it assigns more power to the channels presenting better gains. However, this solution is not convenient from a security standpoint, since channels that are good for the legitimate receiver could also be good for the attacker, thus degrading the secrecy performance. As predictable, uniform allocation leads to the worst average secrecy rate for all the considered cases.

VII. CONCLUSIONS
In this paper we have derived the secrecy rate of the Gaussian relay parallel channel under finite-length coding and discrete constellation constraints, defined as the maximum rate for which a minimum equivocation rate is achieved at Eve. Moreover, we have applied a coupled version of the Gale and Shapley algorithm to allocate power within each channel in order to maximize the secrecy rate. Numerical results show the effectiveness of the resource allocation approach we consider, and show that moderate sizes of both the constellation alphabet and the codewords are sufficient to achieve close-to-optimal secrecy rates for typical wireless transmission scenarios.