Cross-Layer Optimization Scheme Using Cooperative Diversity for Reliable Data Transfer in Wireless Sensor Networks

Cooperative diversity has been shown to provide significant performance gains in wireless networks where communication is impeded by channel fading. In resource constraint networks, the advantages of cooperation can be further exploited by optimally allocating the energy and bandwidth resources among users in a cross-layer way. In this paper, we investigate the problem of transmission power minimization and network lifetime maximization using cooperative diversity for wireless sensor networks, under the constraint of a target end-to-end transmission reliability and a given transmission rate. By utilizing a cross-layer optimization scheme, distributive algorithms which jointly consider routing, relay selection, and power allocation strategies are proposed for the reliability constraint wireless sensor networks. We demonstrate through simulations that the proposed cross-layer cooperative strategies achieve significant energy savings and prolong the network lifetime considerably.


Introduction
Wireless sensor networks are composed of nodes typically powered by batteries, for which replacement or recharging is very difficult, if not impossible [1].Therefore, minimizing the energy consumption for reliable data transmission becomes one of the most important design considerations for such networks.As an emerging and powerful solution that can overcome the limitation of resource constraint wireless networks [2], cooperative communication has received significant attention recently as one of the main candidates for meeting the stringent requirement of the resource limited networks [3].
Cooperative communication is developed from the traditional MIMO (multiple-input and multiple-output) techniques [4] and the model of relay channels [5].Though MIMO has been shown to be able to significantly increase the system throughput and reliability [4], it is not easy to be directly implemented in the wireless sensor networks due to the limitation on the size and hardware complexity of sensor nodes.Cooperative communication, however, is able to achieve the same space diversity by forming a virtual distributed antenna array where each antenna belongs to a different node.We refer to this form of space diversity as cooperative diversity because the terminals share their antennas and other resources to create a virtual array through distributed transmission and signal processing.With cooperation, users that experience a deep fade in their link towards the destination can utilize quality of service (QoS) [3].
Various cooperative schemes have been developed so far.Cooperative beamforming scheme was proposed in [6] for CDMA cellular networks.Coded cooperation was proposed in [2], along with analog-and-forward (AF) and decode-andforward (DF) schemes.Diversity-multiplexing tradeoff tools were utilized [4] to analyze the performance of different cooperative schemes such as fixed relaying, selection relaying, and incremental relaying [7].Multirelay cooperative protocol using space-time coding was proposed in [8].Opportunistic relaying (or selective cooperation) was proposed with different relay selection policies in [9].Power allocation 2 International Journal of Distributed Sensor Networks problem and SER performance analysis in resource constraint networks were studied in [3].These works are mainly focused on improving the link performance in the physical layer.
Cooperative communication inherited a cross-layer problem, since communication resources (e.g., energy, bandwidth) have to be carefully allocated among different nodes in the network.Therefore, the integration and interaction with higher layers has become an active research area in recent years.There have been a lot of efforts towards this consideration such as combining node cooperation with ARQ in the link layer [10], or resource allocation in the MAC layer [11], and routing algorithm in the network layer [12,13].For example, in [14], the relay selection in MAC layer and power allocation strategies in the physical layer are combined into a RTS-CTS signaling scheme, not only providing full diversity gains on the order of the number of relays, but also prolonging network lifetime.By taking into account the higher layer issues, the performance of the whole network can be further improved.
However, a comprehensive cross-layer optimization incorporating three layers (routing, relay selection in MAC, and power allocation in PHY) for cooperative networks is still an open issue.Although there are some efforts concerned in optimizing some metrics such as throughput [15], delay [16], or power consumption [17] under certain QoS constraints, these efforts focus on either one-hop scenario or fading-free channels.In [18], the author studied the problem of constructing cooperative route along with power allocation algorithm to minimize end-to-end transmission power under the constraint of throughput.By pointing out that the throughput of each link should be the same as the target throughput of the route, two heuristic routing algorithms are proposed.Different from [18], our work focuses on different optimization goal and constraints.We target on energy minimization as well as network lifetime maximization.The QoS constraints in our work are endto-end transfer reliability while the work in [18] is under the constraint of end-to-end transmission capacity.We believe in wireless sensor network and the network lifetime maximization, and the guarantee for end-to-end reliability is more important than other considerations.Moreover, we extend our analysis into multirelay scenario and develop a corresponding algorithm.Another work of cross-layer optimization for cooperative network is [19].The author decomposes the problem of minimizing network power consumption into a routing subproblem in the network layer and a joint relay selection and power allocation subproblem in the physical layer.However, the decomposition method to solve this cross-layer problem is defective for its complexity.Since the algorithm proposed in [19] is nonheuristic, it needs exhaustive iterations, with long converge time and large overhead for message exanging, thus unsuited for sensor network application.On the other hand, in our work, we try to derive a closed-form solution (though may not be optimal) and design our algorithm in a heuristic way; thus, it can be distributively implemented in wireless sensor networks.In [20], the cooperative communication and dataaggregation techniques are jointly adopted to reduce the energy consumption in wireless sensor networks by reducing the amount of data for transmission and better using network resources through cooperative communication.
In [21], the problem of how to strike a balance between the QoS provisioning and the energy efficiency when a cooperative communication scheme is applied to a clustered wireless sensor network is studied, by adopting a coalition formation game model with the goal of balancing the outage performance and the network lifetime.In [22], by presenting a cross-layer optimization framework for a wireless sensor network, the proposed strategy provides the best set of relays, the optimal broadcasting power, and the optimal power values for the cooperative transmission phase.
There are also other works in prolonging network lifetime using cooperative communication methods.In [23], collaborative beam forming (CB) and cooperative transmission (CT) are both studied as for the lifetime extension, based on the assumption that the relay nodes are densely and uniformly distributed over a disc, and the distance between the sender and relays is too small to be neglected compared to the distance between the sender and the receiver.In our work, we remove these assumptions and try to obtain a more generalized algorithm.In [24], a cooperative scheme is proposed combining the maximum lifetime power allocation and the energy aware routing to maximize the network lifetime.This technique is not a cross-layer method since the energy conserving routing is formed first, and cooperative transmission is applied based on the constructed routes.Therefore, the merits of cooperative transmission are not fully explored since the optimal cooperative route might be completely different from the noncooperative route.In [25], a suboptimal algorithm for lifetime maximization is developed based on the performance analysis for MPSK modulation in the condition of adding some special cooperative relays at the best places to prolong the network lifetime, while, in our work, the nodes are randomly distributed and no additional relay nodes deployed.In a word, we propose a novel scheme to increase the network lifetime by exploiting the cooperative diversity and jointly considering routing, relay selection, and power allocation in arbitrarily distributed wireless sensor networks.
The main contribution of our work is as follows: in the context of wireless sensor networks using cooperative communication, we propose a cross-layer optimization scheme considering three layers for power minimization under the end-to-end reliability constraint for the first time as far as we know; we propose a cross-layer optimization scheme for opportunistic relaying multirelay scenario for the first time as far as we know; we propose a cross-layer optimization scheme for lifetime maximization for arbitrarily distributed networks without node placement assumption (such as uniform node distribution or additional well-placed relays).Although our work may be applied in general wireless networks, it is actually designed for wireless sensor networks, for the optimization objective, constraints, and system model are all based on wireless sensor networks.
The rest of the paper is organized as follows.In the next section, we describe our system model.In Section 3, we formulate and analyze the min-power and max-lifetime problem in the reliability-constrained cooperative networks.
Then, we derive closed-form expressions, which lead to our cross-layer optimization algorithms proposed in Section 4. In Section 5, we show the simulation results for the energy savings and lifetime comparison of the proposed algorithms and other cross-layer algorithms.Finally, Section 6 concludes the paper.

System Model
Several cooperative communication schemes have been proposed in recent years, such as AF (amplify forward), DF (decode forward), and CF (coded forward).Since a generalized optimization is much harder and may be our future work, we only focus on one particular cooperative scheme which is more likely to be adopted in the resource constraint sensor networks.In the following, we will set up our system model and explain why we choose this model.
First we consider the cooperative scheme.AF and fixed relaying DF [7] are not efficient since these schemes may waste energy and bandwidth in unnecessary transmission when the packet has already been correctly received or the relay cannot decode the packet.Selective relaying DF improves fixed relaying DF but is still not good enough.CF can achieve the best performance when the channel condition is bad but is too complex to be implemented in WSN and also introduces considerable overhead when the channel is good.Therefore, we adopt the incremental relaying DF scheme [7], which is proven to be very efficient and achieve the optimal diversity-multiplexing tradeoff by exploiting limited feedback from the destination terminal.Using a single bit to indicate the success or failure of the direct transmission, cooperation only occurs when the destination fails to receive the packet and the relay correctly decodes the packet.We believe this scheme is much easier to be applied in the WSN compared to CF and has better performance compared to AF and other DF scheme.So we use it for analysis.For multirelay scenario, consequent relaying [19] introduces considerable delay and poor bandwidth usage since several relays have to perform relaying one by one and is much harder for analysis.Space-time coding [4] scheme is very efficient in bandwidth utility but needs very strict synchronization and much more overheads to evaluate channels and exchange codes, making it difficult to be implemented in sensor networks.Thus, we adopt the opportunistic relaying scheme [8].As [8] depicted, the opportunistic relaying can achieve the diversity order of the relay number by using only one relay in the expense of some control overhead in the MAC layer (e.g., RTS, CTS).The opportunistic relaying scheme is different from the singlerelay scheme in that the relay is selected based on the timeto-time channel condition, while in the single-relay scheme the relay is selected based on the long-term average channel condition.Since only the best relay is needed to receive the whole packet, the energy and bandwidth are both saved compared to the consequent relaying and space-time coding scheme.
Then, we take a look at the signal processing strategy in the receiver, and we assume that the receiver decodes the signals received either from the sender or from the relay, instead of combining the received signals together.In general, maximum ratio combining (MRC) [21] at the receiver gives the optimum result.However, it requires a major modification for the existing RF (radio frequency) in sensor nodes such as CC2420.Since the RF for sensor nodes is half duplex, for MRC scheme, the receiver has to store an analog version of the received packet from the sender, before it combines it with the analog version from the relay.However, the analog signals practically cannot be stored in the existing RF of sensor nodes.Therefore, we adopt selective combination in our analysis.
The channel model we used is a very common assumption in many cooperative networks' analysis, where the channels are quasistatic Rayleigh fading channels, and the noise is assumed to be additional white Gaussian noise (AWGN).This means that the channel coefficients are constant during a complete frame and may vary from a frame to another.All the channel coefficients are independent complex Gaussian random variables with zero mean and unit variance.And the noise terms are modeled as zero mean, complex Gaussian random variables with variance  0 .The effective distance  , of a link (, ) can be calculated by measuring the average channel gain of (, ) through periodically HELLO messages used in routing algorithm (such as many cost-based routing algorithms), synchronization messages in MAC algorithm (such as S-MAC, RI-MAC), or training sequence.Since these messages have already existed, this method will not cause additional communication overhead.Also, the links are assumed to be symmetrical since asymmetrical links analysis is much harder and beyond this paper's scope.
Considering the MAC layer, since we are not focused on the bandwidth constraints, we do not take care of the bandwidth allocation problem.We assume the conflicts and contention are avoided by a good TDMA (there have been lots of works on the TDMA/FDMA scheduling for eliminating the collisions [19,20]; we can use such algorithms, but the specific algorithm is out of scope of the paper) or FDMA/CDMA MAC.There is an available channel pool, which has been assigned for different links through TDMA or FDMA/CDMA, such that simultaneous transmissions are possible, where transmission on one link causes very weak interference to others.
As for the power allocation between sender and relay, we take the same assumption as in [18] that the sender and the relay use the same power.The power allocation between sender and relay has been investigated in [7]; it is shown that the same power allocation scheme achieves a similar performance as optimal allocation scheme, especially when the relay nodes are not far away from the source (considering WSN is always densely distributed, it is acceptable).Moreover, in incremental relaying, since the relay transmits message only occasionally, the power of relay contributes to a small part in the total transmission power of the whole route [18].Therefore, for simplicity of analysis, we just allocate the same power for the relay as the sender, which makes our solution not optimal but more applicable.
Finally, for the performance evaluation tool, we analyzed outage performance instead of packet error rate (PER) or symbol error rate (SER) to compute the reliability function International Journal of Distributed Sensor Networks when considering reliability.Although PER or SER may be more widely used in practical systems, there is actually an intimate connection between outage and PER/SER [4].Therefore, results derived by outage analysis can be extend to PER/SER, which may be done by other works.
Since we aim to develop an algorithm which can be implemented distributively, it is inevitable to convert a NP hard linear programming problem to a computable problem by introducing some approximations (such as   = 1 −  when  ≈ 0).Therefore, the optimization results may be actually suboptimized.However, these results can lead to applicable distributive algorithm.That is, we trade off some performances for simplicity in our analysis.

Cross-Layer Optimization Problem in Cooperative Sensor Networks
In this section, we formulate and analyze the min-power problem and the max-lifetime problem in the context of reliability constrained cooperative networks and derive applicable solutions, leading to our algorithms which will be described in detail in the next section.

Problem Formulation.
Consider a multihop wireless sensor network consisting of multiple arbitrarily distributed sensor nodes and one sink.Each sensor node has a single omnidirectional antenna and can dynamically adjust its transmitted power.A graph (, ) can be used to depict the network, where  is the vertex set and  is the edge set.The number of nodes is || =  and the number of edges is || = .We consider two associated optimization objectives.The first is called min-power problem: given any source node , the goal is to find the − route that minimizes the total transmission power, while satisfying a required endto-end transmission success probability and transmission rate, which is denoted as   and   .The second is called max-lifetime problem: given a set of source nodes , the goal is to provide a data transferring scheme that maximizes the network lifetime, defined as the lifetime of the node whose battery drains out first [1], while satisfying the same constraints as the min-power problem.For (, ), denote Ω as the set of all possible routes.For a route  ∈ Ω, denote   as the ith hop of this route.Thus, the problem can be formulated into a standard linear programming (LP) problem [22].
where    denotes the transmission power over the ith hop (including the power of the sender and the relay) of the ,

𝑝 𝑠
is the reliability of successful transmission of the   , and    denotes the transmission rate of the   . ( where    denotes the lifetime of the sender node over the ith hop.

Problem Analysis.
From Figure 1, we can see that to forward data from node  to node  on link (, ), either direct transmission is used or a particular node  helps node  to forward data to node  using decode-and-forward (DF) cooperative diversity.Let ℎ , ,  , , and  , represent the channel coefficient, length, and additive noise of the link (, ), respectively.The transmission rate and power for direct transmission (DT) mode and cooperative transmission (CT) mode are represented as   ,   ,   , and   , respectively.
(1) Direct Transmission.For the direct transmission between node  and node , the received symbol can be modeled as where  is the transmitted symbol with unit power, and  is the path loss exponent.The channel gain in (3) captures the effects of path loss and frequency nonselective fading.The mutual information between sender  and receiver  can be given by where     , |ℎ , | 2 / 0 is the signal-to-noise ratio (SNR) at the receiver.The outage probability of the link (, ) is the following: Using ( 4) Since the channel gain |ℎ , | 2 is modeled as exponential random variable, the outage probability is equal to where The end-to-end transmission success probability of the route  is the product of the transmission success probability of each link.For direct transmission, using (7) there is the following: where  denotes the hop number of the path, and   denotes the transmission probability of the ith link.Consider where   = (2   − 1) 0 , and   and    denote the distance and the transmission power of   , respectively.
(2) Single-Relay Cooperation.For the cooperative transmission mode, the sender  sends its symbol in its time slot.Due to the broadcast nature of the wireless medium, both the receiver  and the relay  receive noisy versions of the transmitted symbol.The received symbols at the receiver and the relay can be modeled as respectively.We assume that the relay and the receiver decide that the received symbol is correctly received if the received (SNR) is greater than a certain threshold.According to the incremental relaying scheme, if the receiver decodes the symbol correctly, then it sends an acknowledgment (ACK) to the sender and the relay to confirm a correct reception.Otherwise, it sends a negative acknowledgment (NACK) that allows the relay, if it received the symbol correctly, to transmit this symbol to the receiver in the next time slot.The received symbol at the receiver can be written as The outage event occurs when the direct link and the relay channel both fail.Thus, the total outage probability is given by where since When the SNR is high enough,   ≪ 1. Equation ( 13) can be approximated as follows: where From ( 16), we can see that to maximize reliability, the best relay for a given link is the node which contributes to the least  eq of the cooperative block.
For the cooperative mode, the end-to-end transmission success probability can also be attained using (16): where   = (2   − 1) 0 .
(3) Multirelay Cooperation.For the multirelay cooperation mode, we use the opportunistic relaying scheme proposed in [5].According to the opportunistic relaying scheme, for each frame, a node with the best instantaneous relaying channel condition among several potential relays is selected to forward the packet in each frame.Specifically, the  potential relays (named   ,  2 , . . .,   ) overhear a transmission of a ready-to-send (RTS) packet from the sender  and a clear-to-send (CTS) packet from the receiver .From these packets, the relays assess the instantaneous wireless channel between source  and relay   and the instantaneous wireless channel between relay   and destination  (see Figure 2).As soon as each relay receives the CTS packet, it starts a timer International Journal of Distributed Sensor Networks from a parameter ℎ  based on the instantaneous channel measurements  ,  ,    , .The timer of the relay with the best channel conditions will expire first.That relay transmits a short duration flag packet, signaling its presence.All relays, while waiting for their timer to reduce to zero (i.e., to expire), are in listening mode.As soon as they hear another relay to flag its presence or forward information (the best relay), they back off.In this way, the node with the best instantaneous channel is selected as the relay.Since the outage event occurs only when the direct channel and all relay channels fail, the total outage probability is given by the following: where When the SNR is high enough,   ≪ 1.The equation above can be approximated as follows: Using as the effective distance of the cooperative block, there is For the multirelay cooperative mode, the end-to-end transmission reliability can also be attained using (21): where   = (2   −1) 0 and  eq, denotes the effective distance of the   .

Min-Power
Solution.Now consider the min-power problem depicted in (1).This is a convex problem and we can solve it using Lagrangian multiplier techniques [22].Set Then For direct transmission mode, using (10), there is Now we have and the total transmission power for the direct transmission mode is For cooperative transmission, using ( 16), there is Now we have The upper bound of the total transmission power for cooperative mode is (discussed in Appendix C) For the multirelay cooperation mode, using ( 21) and implementing the same mathematical manipulation as above, there is and the total transmission power is International Journal of Distributed Sensor Networks 7 3.4.Max-Lifetime Solution.Now we consider the maxlifetime problem formulated in (2).We assume some data flows (denoted as  1 ,  2 , . . .,   ) have existed in the network; the node set which participates in transferring the flow   is (  ).If a new flow denoted as ( + 1) is "to be transferred, " and a candidate route  is considered to be the route of the flow, then the problem is analyzed as follows.Denote the th hop as   and the sender node of   as   .Then the power expenditure of   is where     (  ) and     (  ) are the power allocated for transmitting and receiving the flow   , respectively, and  cir   is the power consumed for circuit.Since the power when receiving a data flow is constant as     , there is where  is the number of flows going through the node   .Consider that the power for  +1 is "to be allocated": The first term is variable, and the second term is constant.Thus where   =     ( +1 ), and  0 = ∑   ∈(  )     (  )+    + cir   .Let   be the residual energy of   .Then the expected lifetime of   can be calculated as Set Then The weight   can be deemed as a coefficient which depicts how large the share of the residual energy is allocated for the coming flow  +1 .The calculation for the value of   will be discussed in Appendix B and given by (C.1).
To maximize the lifetime of the entire network, the best solution is that the lifetime of each node in the route of flow is equal to a target lifetime.That is, ∀  ,   =  0 .
Using (16), the optimization problem for direct transmission mode is By solving this problem we get For cooperative mode, the optimization problem is By solving this problem we get

Cooperation-Based Cross-Layer Schemes
In this section, we propose detailed minimum-power and maximize-lifetime cross-layer algorithms, under the constraint of end-to-end success probability and data rate, both in direct mode and cooperative mode.We assume that each node broadcasts periodically HELLO packet to its neighbors to update the local topology information.Our algorithms are composed of two parts: routing (and relay selection) algorithm and power allocation algorithm.Algorithms are based on the conventional Bellman-Ford shortest path algorithm which can be distributively implemented.In Bellman-Ford algorithm, each node  ∈ 1, . . .,  executes the iteration   = min ∈() (  , +  ), where () denotes the set of neighboring nodes of node ,   , denotes the effective distance between node  and , and   represents the latest estimate cost of the shortest path from node  to the destination that is included in the HELLO packet.Based on the results of the previous section, the cross-layer schemes are as follows.

Min-Power Cross-Layer Scheme with Direct Transmission.
From (29), we can see that to minimize   tot is equal to minimizing ∑  =1  /2  .That means the formation of routing actually has nothing to do with the QoS parameter   .Thus we can decompose the cross-layer optimization problem into two subproblems.First we choose the minimum-power route with the least ∑  =1  /2  , based on conventional Bellman-Ford algorithm.Then, the transmission power related to   for each node in the route is adjusted according to (28).Since the forward nodes in the route may not know   (if not a priori for the whole network), the source node may need to transfer a message containing   to the destination through the path to inform all the forward nodes.Thus, the cross-layer scheme is as follows.
(2) Each node estimates the effective distance   , of its outgoing links (according to (29)) through the measurement of the average SNR from periodically broadcasted HELLO message.
(3) Each node calculates the costs of its outgoing links as  /2 , .(4) Each node updates its cost toward the destination as Cost() = min ∈() ( /2 , + Cost()), and select node  as the next hop node.
(5) If the required QoS parameter   is a priori to the whole network, each node in the route will adjust the transmit power according to (28).
(6) If not, the source will deliver a message though the constructed route, informing all nodes along the path about the   .Then each node in the route will adjust the transmit power according to (28).

Min-Power Cross-Layer Scheme with Cooperative Transmission.
The min-power scheme for cooperative communication is composed of two parts: single-relay scheme and multirelay scheme.For single-relay scheme, we can see from (32) that to minimize   tot,ub is equal to minimizing ∑  =1  eq, .Hence, the cross-layer optimization strategy can be realized by three steps.First, the potential relay of each link is selected by minimizing  eq according to (17).Then, the min-power route is constructed as the route with the least ∑  =1  eq, .Finally, the transmission power of the nodes in the route is adjusted according to (31).The algorithm is as follows.
(3) Each node calculates the costs of its outgoing links as  eq, = min ∈(,)   , (  , +   , ), and select node  as the relay of this link, where (, ) denotes the set of neighboring node of both  and .
(4) Each node updates its cost toward the destination as Cost  = min ∈() ( 1/3 eq, + Cost  ) and select node  as the next hop node.
(5) & ( 6) The same as steps 5 & 6 in Algorithm 1 except each path node and relay node in the route adjust the transmit power according to (31).
For multirelay scheme (assume we need  relays for each link), the difference with single-relay scheme is that the  potential relays have to be selected and only the best relay is chosen from time-to-time in every transmission slot.According to (34) and the definition of  eq , to minimize  eq , the calculation of each   ,  +     , has to be minimized.Therefore,  relays are selected one by one by the turn of   ,  +     , .First,  potential relays have to be chosen for each link to minimize  eq according to (22).Then, the route to minimize  tot is selected according to (34).Finally, the power of each node in the route is adjusted according to (33).Every time when a data packet is to be transmitted in a link, the best relay among the  potential relays is selected based on the RTS-CTS exchanges in opportunistic relaying scheme [9].The best relay is in charge of relaying the packet, while other potential relays will turn off the radio and not receive the packet to save energy.The algorithm is as follows.
Algorithm 3 (Min-Power Cross-Layer Scheme Cooperative Transmission (MPCS-CT) (for opportunistic relaying multirelay scenario)).Consider (3) Each node sorts all its neighboring nodes ascending according to the value of   ,  +     , , and selects the first  nodes as potential relays.Then it calculates the costs of its outgoing links as  eq, = min   ∈(,)    ∏  =1 (  ,  +    , ), where (, ) denotes the set of neighboring node of both  and .
(5) & (6) The same as steps 5 & 6 in Algorithm 1 except each path node and relay node in the route adjust the transmit power according to (33).

Max-Lifetime Cross-Layer Scheme with Direct Transmission.
From (43) we can see, to find a route which maximizes  0 , we should find a path with the minimum ∑(   /    ), and the power of node   should be adjusted to   given by (44).Of course, since the residual energy   of each node is decreasing at different rates, the route may change from time to time as the residual energy of the intermediate node in the route varies.The rate of the recalculation of the route is determined by the rate of HELLO message exchange.Thus, the algorithm is as follows.(3) Each node measures its residual energy   and its total power  0 for the ongoing flows.Then it calculates the cost of its outgoing links as   , /    , where   is calculated by (B.4).
(4) Each node updates its cost toward the destination as Cost  = min ∈() (  , /    + Cost  ), and select node  as the next hop node.
( 5) & ( 6) The same as steps 5 & 6 in Algorithm 1 except each node in the route adjust the transmit power according to (44).

Max-Lifetime Cross-Layer Scheme with Cooperative
Transmission.From (46) we can see, to find a route which can maximize  0 , we should find a path with the minimum ∑( eq, / 2   2  ), and the power of node   should be adjusted to   given by (47).(3) Each node calculates the effective distance of its outgoing links as  eq, = min ∈(,)   , (  , +   , ), and select node  as the relay of this link, where (, ) denotes the set of neighboring node of both  and .
(4) Each node measures its residual energy   and its total transmission power  0 for the ongoing flows.Then calculates the cost of its outgoing links as  eq, /    .
(5) Each node updates its cost toward the destination as Cost  = min ∈() ( eq, /    +Cost  ), and select node  as the next hop node.( 6) & ( 7) The same as steps 5 & 6 in Algorithm 1 except each forward node and relay node in the route adjust the transmit power according to (47).
Figure 3 gives us an example and explains how our algorithm works when two flows with the same source are transferred.When node  first transfers flow1, it may choose PATH1.After that, when  is going to transfer another flow flow2, the nodes in the PATH1 have changed their link costs, since   is different from when PATH1 is constructed due to the existing flow flow1 (see (C.1)).Thus, another route PATH2 will be chosen to transfer flow2.In the same way, when multiple flows are considered, there will be several untwisted paths constructed one by one.Since the link cost  eq, / 2   2  is proportional to the ongoing transmission power and inversely proportional to the residual energy, the route will naturally bypass the heavily used nodes.Therefore, the traffic will be balanced and the network lifetime will be prolonged.

Simulation Setup.
We use Matlab as our simulation tools.In the simulation, we have implemented three groups of tests.The first group of tests is used for the comparison between our min-power algorithms and other cross-layer min-power algorithms.The compared algorithms are MPCR [4] and CASNCP which will be described in the next subsection.The second group of tests is used for the comparison between our max-lifetime algorithms and another cross-layer maxlifetime algorithm, called GPA-CR [5].The third group of tests investigates the impact of different parameters on the performance of our algorithms such as the number of relays and the required QoS.The setup of each test group will be described, respectively, in the following subsections.

Comparison for Min-Power Algorithms.
To demonstrate the effect of cross-layer design for cooperative communication, we implement two min-power algorithms: MPCS-DT and MPCS-CT in random networks.For better comparison, we also implement two other cooperation-based algorithms, the minimum-power cooperative routing (MPCR) algorithm and cooperation along the shortest noncooperative path (CASNCP) algorithm, proposed in [4] to demonstrate how our algorithms work effectively in reliability constraint environments.MPCR and CASNCP are designed to construct the optimum route which requires the minimum end-to-end transmission power while guaranteeing certain throughput.MPCR applies the cooperative communication while constructing the minimum-power route using any number of the proposed cooperation-based building blocks.CASNCP algorithm is similar to most of the existing cooperative routing algorithms: first constructs the conventional shortestpath route then applies a cooperative-communication protocol upon the established route.Both MPCR and CASNCP adopt power allocation algorithm.In our simulation, 50 nodes are randomly distributed in a 200 m * 200 m square area.The transmission range of each node is 80 m.The simulation parameters are the same as previous works (e.g., [14]).The position of the source node and the destination node is (10,10) and (190,190), respectively.The target endto-end transmission success probability is   = 85%, and the required transmission rate is   = 2//Hz.The noise variance is  0 = −70 dBm, and the path loss exponent is  = 4.We implement the experiments for 200 times and average the results.For fair comparison, the required link transmission probability in MPCR and CASNCP is assumed to be    =  √  , where  is the number of hops of the route.As for MPCS-CT, if the number of relays is not mentioned, we use the single-relay scheme in simulation.and relays) and corresponding energy saving of each algorithm.From Figure 4, we can see that MPCS-CT outperforms the other schemes by at least 2 dbm, and the gap between MPCS-CT and MPCS-DT is getting larger when the reliability constraint is harder.Figure 5 further demonstrates the energy saving of the MPCS-CT to other schemes.Compared to MPCR, MPCS-CT is able to save 23% energy, mainly due to the cross-layer optimization for end-to-end reliability constraint instead of throughput.Compared to CASNCP, 45% energy saved due to not only the reliability consideration, but also the joint optimization of routing and relay selection, since CASNCP finds a shortest-path route first and then builds the cooperative route based on the shortest-path one.Compared with MPCS-DT, MPCS-CT can save more than 61% energy when the target end-to-end reliability is above 70% due to the cooperative diversity.The gap of transmission power between the MPCS-DT and MPCS-CT rises as the required end-to-end success probability increases.The reason lies in the nature of the cooperative diversity.When the end-to-end reliability requirement becomes stringent, more power is needed for both DT and CT mode to raise the SNR of each link in the transmitted path.However, for CT mode, the SNR of both direct transmission channel and relay channel are improved.Since these two channels are independent, total transmission reliability rises quickly.Thus, less power is needed in cooperative mode to enhance the reliability.As we can see, if the reliability requirement is further relaxed, the transmission power of CT will eventually exceed DT due to the cost of implement of cooperation.From Figures 4 and 5, we can see that a tradeoff exists between the reliability constraint and the transmission power minimization.
Figures 6 and 7 demonstrate the total transmission power with respect to the number of nodes in the network and the required transmission rate.As Figure 6 shows, when network size rises up, the needed transmission power decreased.It can be easily understood because the denser the network is, the smaller the average distance between the nodes is, and thus less transmission power is needed.Figure 7 shows that as the required data rate increases, the needed total transmission power also increases.However, when the data rate increases, the energy saving of MPCS-CT to MPCS-DT decreases slightly.This is because when the required data rate   increases, the increase of   is quicker than the increase of   (see (42)); thus, more transmission power is needed for cooperation mode.

Comparison for Max-Lifetime Algorithms.
For comparison, we consider three different schemes: (1) max-lifetime cross-layer scheme with direct communication (namely MLCS-DT) and ( 2) max-lifetime cross-layer scheme with cooperative communication (namely MLCS-CT) and (3) greedy power allocation and cost-based routing (namely GPA-CR).GPA-CR is a cross-layer strategy designed for lifetime maximization in wireless sensor network, proposed in [5].GPA-CR first construct the route from the source to the destination by selecting the path with the least cost and then adjust the power level incrementally node by node until the end-to-end success probability becomes equal to or larger than the target value.The routing cost in GPA-CR is proportional to the transmission power and inversely proportional to a weighted residual energy.
The simulation scenario is the same as the simulation for min-power algorithms.The difference is that 20% sensor nodes in the network are randomly selected as data sources, each transferring a data flow to the destination which is located in (190,190).The data source always generates data until it dies.A TDMA MAC is applied in our simulation.The frame is divided into 100 time slots.Every node is active in its assigned time slots for transmitting or receiving data and remains asleep in the rest of the frame.The parameters of sensor nodes are  cir = 15 mW and   = 22.2 mW based on CC2410.We supply each sensor node with an initial energy of 250 J and set the target end-to-end success probability for each flow to 85%.For GPA-CR, we set the minimum and maximum transmission power to −20 and 15 dBm and the number of power levels to 12.
Figure 8 shows the network lifetime with respect to the target end-to-end success probability when different strategies are applied.As we can see, MLCS-CT yields much longer network lifetime than the other two schemes.There are several reasons to explain the network lifetime enhancement.First, cooperation can reduce the required transmission power of the nodes due to the spatial diversity.Second, for a particular flow, cooperation can make more nodes involved in transmission of the data packets, which make the traffic load more balanced.Particularly, in our algorithm, cooperation can make the traffic automatically bypass the heavy-loaded and energy-draining nodes.Note that the GPA-CR constructs the route first and adjust power step by step rather than optimize the routing and power jointly.This algorithm incurs additional performance loss.We also observe that the network lifetime decreases as the desired end-to-end success probability increases.It happens because the needed transmission power deceased as the reliability constraint gets relaxed, thus resulting in prolonged network lifetime.However, the curve of GPA-CR becomes flat when the target end-to-end success probability reaches a high level (more than 0.8), because the power of nodes in GPA-CR has a maximum constraint.The figure demonstrates the tradeoff between network lifetime maximization and the reliability constraint.
Figure 9 plots the network lifetime with respect to the number of nodes distributed in the network.The effects of variance of network size are twofold.On the one hand, when the number of nodes increases, the number of data sources also goes up, thus leading to more traffic in some nodes and shortened network lifetime.On the other hand, when the network size increases, nodes are getting closer, leading to decreased transmission power and prolonged network lifetime.As figure shows, the former effect outweighs the latter effect, especially in the cooperative mode.The reason is that the energy expenditure of the node near to the sink is approximately proportional to the number of sources but approximately proportional to the square root of the network size.For cooperative communication, it is even more   insensitive to the variation of the length of links caused by the change of network size.Figure 10 presents the network lifetime with respect to data rate when different algorithms are applied.As expected, network lifetime decreases as the transmission rate goes up, but our algorithms are more sensitive to the data rate since it influences the transmission power of nodes.

Simulation for Different Parameters.
In this simulation, we will investigate the effect of several parameters on the performance of our min-power algorithms: MPCS-DT and MPCS-CT.The simulation scenario is that  sensor nodes are randomly distributed in  *  2 square area, and the source and destination nodes are located in the bottom left corner and the upper right corner, respectively.To better simulate the actual sensor node, we add receive power and process power (denoted as   and   ) as metrics in the total power consumption and investigate the effect of their variance to the performance of our algorithm.The default parameters are set as follows:  = 100,  = 700,  0 = −70 dbm,  = 4,   = 1 mW,   = 1 mW, and   = 0.99.Since the network size can be calculated as / 2 , we define the average internode distance as follows:  = / √ .
First, we study the effect of the QoS requirement   in Figure 11.In this case, we plot the total consumed power for cooperation and direct transmission versus average internode distance for different values of required end-to-end reliability.As shown in Figure 11, the total power increases as the reliability requirement becomes stringent.And the threshold distance decreases as the QoS increases.It is because when   is high, more power is consumed in transmission and hence cooperation becomes more energy efficient.It is observed that below 30 m of average internode distance, direct transmission provides better performance over cooperation when QoS is 0.95.This is because when cooperation is applied, the transmission power of the nodes in the route will be reduced, but the receive power and process power of the route nodes will be increased since more nodes have to receive and process packets.Therefore, when the distance becomes smaller, the receive power and process power take a bigger part of the whole energy budget and outweigh the transmit power, which make cooperation less efficient.It can also be seen from the plotted curves that the required power for direct transmission is more sensitive to variations in   than the power required for cooperation.The reason is that the transmit power constitutes a larger percentage of the total consumed power in direct transmission than in cooperation, and hence the effect of   is more significant.
Next, Figure 12 depicts the multiple relays scenario for different values of end-to-end reliability   .The results are depicted for an average internode distance of 100 m and for  = 0, 1, 2, 3, 4, 5 relays, where  = 0 refers to direct transmission.As shown in Figure 13, for small values of required success probability, one relay is more energy efficient than two or three relays.As we increase the required QoS, reflected by   , the optimal number of relays increases.Hence, our analytical framework can also provide guidelines to determine the optimal number of relays under any given scenario.
Finally, we study the effect of varying the receive power   as depicted in Figure 13.For   = 10 mW, when the average internode distance is below 25 m, the results reveal that direct transmission is more energy efficient than cooperation; that is, the overhead in receive and processing power due to cooperation outweighs its gains in saving the transmit power.For / √  > 25m, the cooperation starts to be more efficient as the transmit power starts constituting a significant portion of the total consumed power.The cooperation gain increases until the transmit power is the dominant part of the total consumed power and hence the cooperation gain starts to saturate.Another observation of the curves is that the threshold distance decreases as   decreases.When   = 5mW, the threshold distance is 15 m, and when   = 1mW, it decreases to less than 10 m.The reason is that when the receiving power decreases, the transmit power plays a more important role and hence cooperation becomes more energy efficient.It can also be seen from the plotted curves that the required power for cooperation is more sensitive to variations in   than the power required for direct transmission.The reason is that the effects of cooperation to the power consumption are twofold.On the one hand, more receiving power is needed in cooperation, because the relay node also needs to receive the transmitted packet.On the other hand, less transmission power is required due to the spatial diversity provided by cooperation.The receiving and processing power constitutes a larger portion in the total consumed power in cooperation than in direct transmission, and hence the effect of   is more significant.

Conclusion
In this paper, we developed several cross-layer algorithms for energy efficient and reliable data transfer in wireless sensor networks using cooperative diversity.We investigate the problem of how to minimize transmission power consumption and maximize the network lifetime while guaranteeing the end-to-end success probability.Noting that the energy efficiency and the reliability in wireless sensor networks depend on the features of each layer: the power control in the physical layer, the relay selection in the MAC layer, and the routing protocol in the network layer, we have designed cross-layer strategies by considering them jointly.We have proposed the MPCS-CT algorithm, which applies the cooperative communication and constructs the minimum-power route while guaranteeing certain end-to-end transmission reliability.We have also presented the MLCS-CT algorithm, which aims to maximize network lifetime under the reliability constraint.Our algorithms can be implemented distributively.We have shown through simulation results that for random networks, the power savings of the MPCR algorithm with respect to the recently proposed minimum-power routing algorithms MPCR and CASNCP are 23% and 45%, respectively.Compared with noncooperation algorithm MPCS-DT, MPCS-CT saves more than 60% power when the required end-to-end success International Journal of Distributed Sensor Networks probability is above 70%.For the max-lifetime algorithm, we compared our proposed algorithm MLCS-CT to other two algorithms: MLCS-DT and GPA-CR.The results also showed that our algorithm outperforms the other two algorithms by 2-4 times.The reason lies in the benefit of cooperation by reducing transmission power and balance traffic load.We further demonstrate the effect of several parameters such as reliability constraint, number of relays, network size, and data rate to the algorithms, which shows our algorithm is more sensitive to the variance of network size and data rate and performs better when high QoS is required.Our future work includes removing some constraints such as the equal power allocation between source and relay and applying our algorithms in other cooperative schemes such as AF and CF.We will also perform further tests to validate the proposed algorithms.To safely guarantee that the actual residual energy is enough to last for the expected lifetime, we set   =  ,min , and the amount of energy set aside for the coming flow is  ,min   .
C. The Calculation of   and   tot,ub Equation (28) shows that the value of   has a significant impact on the transmission power.To minimize total transmission power, a minimum   should be adopted to satisfy the total transmission data rate requirement in (1).Consider a cooperative block (, , ) in Figure 1; the probability that the source  transmits only, denoted by Pr(), is calculated as where the term 1 − Pr( , ≤   ) corresponds to the event when the sender-receiver channel is not in outage, while the other term corresponds to the event when both the senderreceiver and the sender-relay channels are in outage.The probability that the relay cooperates with the source is the following: Pr() = 1 − Pr () .

Figure 1 :
Figure 1: Cooperative transmission (CT) and direct transmission (DT) modes as building blocks for any route.

Figure 2 :
Figure 2: Multirelay cooperation modes as building blocks for any route.

2 Figure 3 :
Figure 3: An example of how two flows with the same source are transferred using our max-lifetime scheme.

Figures 4 and 5 Figure 4 :
Figure 4: Required total transmission power versus the desired endto-end transmission reliability.

Figure 5 :Figure 6 :
Figure 5: The energy saving of transmission power between different algorithms versus the required end-to-end success probability.

Figure 7 :
Figure 7: Required total transmission power versus the transmission rate.

Figure 8 :
Figure 8: The network lifetime for cooperative and direct transmission versus the desired end-to-end success probability.

Figure 9 :
Figure 9: The network lifetime for cooperative and direct transmission versus the network size.

Figure 10 :
Figure 10: The network lifetime for cooperative and direct transmission versus the data rate.

Figure 11 :
Figure 11: Required total power versus the average internode distance for different values of required end-to-end reliability.

Figure 12 :Figure 13 :
Figure 12: Required total power versus the number of relays for values of required end-to-end reliability.

(C. 2 ) 2 ⋅ 2 ( 1 + 5 ) 6 )
Thus, the average transmission rate of the cooperative transmission mode can be calculated as =   ⋅ Pr () +   Pr () =   Pr ()) , (C.3)where   corresponds to the transmission rate if the sender is sending alone in one time slot, and   /2 corresponds to the transmission rate if the relay cooperates with the sender in the consecutive time slot.ConsiderPr () ≥ 1 − √ log  −1   , (C.4)where  is the number of hops of the route.Thus So to make sure the total transmission rate satisfies the requirement,   should be at least Consider the transmission power of the cooperative block (both consumed by the sender and the relay)   =   ⋅ Pr () + 2  ⋅ Pr () =   ⋅ (2 − Pr ()) .(C.7)Using (31), the total transmission power of the route is  tot =