Network-Coding-Based Cooperative ARQ Medium Access Control Protocol for Wireless Sensor Networks

We introduce a novel Medium Access Control (MAC) protocol for Automatic Repeat reQuest-based (ARQ-based) cooperative wireless sensor networks. Using network coding techniques, we achieve a better network performance in terms of energy efficiency without compromising the offered Quality of Service (QoS). The proposed solution is compared to other cooperative schemes, while analytical and simulation results are provided to evaluate our protocol.


Introduction
Wireless Sensor Networks (WSN) have experienced an impressive growth during the last years. Their inherent restrictions (battery, processing power, etc.) along with their special characteristics (e.g., large network size) constitute great challenges for further research. Moreover, new techniques such as cooperation among nodes [1] and network coding [2] have been introduced to improve the network performance and provide the communication with diversity, robustness, and higher data rates. These new technologies create the need of designing new MAC protocols that exploit the benefits of the aforementioned techniques in order to efficiently use the system resources.
Regarding the cooperative communication, several MAC protocols have been proposed in the literature, classified in two main categories: (i) the cooperative ARQ-based protocols [3,4] and (ii) the protocols that transform one-hop transmissions to multihop transmissions [5,6]. However, most of the work is focused on IEEE 802.11 Standard [7], thus not considering the particular traits of WSN.
In the context of IEEE 802.15.4 Standard [8], two MAC schemes have been recently proposed, falling in the first and the second category of cooperative protocols, respectively. In the former, COSMIC [9], the retransmissions are triggered by the destination after an erroneous packet reception. The relays in the network are enabled to forward the original packets to the destination node, as ARQ defines, using better channel conditions in terms of Packet Error Rate (PER). On the other hand, the latter (WSC-MAC [10]) transforms single one-hop transmissions to multihop transmissions according to the channel conditions. Specifically, when the channel between the relay and the destination is better than the channel between the source and the destination, a twohop transmission is selected instead of the direct one.
Network coding can be defined as allowing the intermediate nodes in a network not only to forward but also to process the incoming data packets. In the last years, there is a trend towards applying network coding in cooperative communications. In the domain of WSN, Munari et al. [11] have introduced NC-PAN in order to enhance the throughput gain in Time Division Multiple Access (TDMA) high data rate scenarios. However, NC-PAN is not compatible with the non-beacon-enabled mode of IEEE 802.15.4 which adopts Carrier Sense Multiple Access (CSMA).
In this point, let us clarify that IEEE 802.15.4 has two modes of operation: (i) the beacon-enabled mode and (ii) the non-beacon-enabled mode. The former mode (combination of TDMA and CSMA) inherently implies energy saving, since the transceiver of a node is turned off in the sleep mode. The latter mode uses pure CSMA and supports all types of topologies. Hence, it is of crucial importance to provide the non-beacon-enabled mode with techniques that ensure the efficient use of the energy resources.
In this context, we propose a Network-Coding-based Cooperative ARQ MAC protocol for WSN (NCCARQ-WSN) that coordinates the retransmissions among a set of relay nodes which act as helpers in a bidirectional communication. The novelty of our scheme and the differentiation from the other cooperative protocols of the same category (ARQbased) lie in the following.
(1) Network coding techniques are used in order to enhance the system performance.
(2) Less control packets-and consequently less overhead-are inserted in the network.
(3) Our protocol operates in CSMA scenarios, hence being compatible with the IEEE 802.15.4 Standard.
(4) We present an analytical model for the energy consumption in the network from the MAC layer point of view.
Since we have already presented a brief literature review on the related topics, the rest of this paper is organized as follows. In Section 2 we introduce our proposed NCCARQ-WSN MAC protocol along with an operational example. Section 3 presents a detailed mathematical analysis for both QoS metrics and the energy efficiency of our protocol. The validation of the analytical model and the simulation results are provided in Section 4. Finally, Section 5 concludes the paper.

Protocol Description
The Network-Coding-based Cooperative Automatic Repeat reQuest MAC protocol for Wireless Sensor Networks (NCCARQ-WSN) has been designed to coordinate the channel access among a set of relays that support bidirectional communications between pairs of sensor nodes. The first goal of NCCARQ-WSN is to enable the IEEE 802.15.4 stations to request cooperation by the neighboring nodes upon an erroneous reception of a data packet. The second design goal of our proposed protocol is to allow the helper nodes to perform network coding techniques to the packets to be transmitted before relaying them.
Two fundamental requirements are needed for the efficient operation of the NCCARQ-WSN protocol: (i) all nodes in the network should operate in a promiscuous mode, that is, they have to be able to listen to all ongoing transmissions and cooperate if requested and (ii) they should store a copy of any received data packet (regardless of its destination address) until the correct reception of this packet is acknowledged by the intended destination. Hence, the relay set is under saturated conditions, since the nodes have always cooperative packets to send in their buffers.
In NCCARQ-WSN, a cooperation phase is initiated once a packet is not received correctly by the destination. Several error detection mechanisms such as Cyclic Redundancy Code (CRC) can be applied in order to perform error control to the received messages. Therefore, the destination station initiates the cooperation phase by broadcasting a Request for Cooperation (RFC) control packet after a Long Interframe Space (LIFS) period of time, as it is defined in the IEEE 802.15.4 Standard. Furthermore, in the special but not rare case of bidirectional traffic, that is, when the destination station has a data packet for the source station, the packet is broadcasted piggy backed to the RFC message.
The stations that receive the RFC packet are potential candidates to become active relays for the communication process. Therefore, the relay set is formed upon the reception of the RFC and the participants stations get ready to forward their information. Since the partners have already stored the packets that destined both to the destination (so-called cooperative packet) and to the source (so-called piggy-backed packet), they create a new coded packet by combining the two existing data packets, using the XOR method. Accordingly, the active relays will try to get access to the channel in order to transmit the network-coded (NC) packet. A simple scenario that subjects to the initial principles of NCCARQ-WSN is depicted in Figure 1.
In this point, we have to state that NCCARQ-WSN is backwards compatible with IEEE 802.15.4 Standard, as it uses the same frame structure and follows the same principles with the standard. However, some modifications have been made in order for the protocol to efficiently exploit the advantages of both cooperative and network coding techniques.
(1) Each network-coded packet forwarded by the relays requires an ACK packet to guarantee a reliable communication.
International Journal of Distributed Sensor Networks (2) For bidirectional traffic, data packets can be transmitted along with RFC packets without taking part in the contention phase.
(3) Since the subnetwork formed by the relay set operates in saturated conditions, it is necessary to execute a backoff mechanism at the beginning of the cooperation phase to minimize the probability of a certain initial collision.
Once the source and the destination receive the NC packet from the relay, they are able to decode it and extract the respective original data packets. Subsequently, they acknowledge the received data packet by transmitting the respective ACK, thus terminating the cooperation phase. Receiving the acknowledgment packet, the relays are informed that the particular communication has been completed, hence becoming able to erase the packets of their buffers. In case that the received coded packets can not be decoded after a certain maximum cooperation timeout due to transmission errors, the relays are obliged to forward again the NC packet.

Operational Example.
In this subsection, we provide an example of operation of NCCARQ-WSN in order to clarify our proposed access protocol. A simple network topology with four stations is considered, all of them in the transmission range of each other. A source station (S) transmits a data packet (A) to a destination station (D) that does also have a packet (B) destined to the source station. Furthermore, there are two helper nodes (H 1 and H 2 ) that support this particular bidirectional communication. The entire procedure is depicted in Figure 2 and explained as follows.
(1) At instant t 1 , station S sends the data packet A to station D.
(2) Upon reception, at instant t 2 , station D fails to demodulate the data packet, thus broadcasting an RFC packet asking for cooperation of the neighboring stations (H 1 and H 2 in this example) along with the data packet B, destined to the station S.   (6) At instant t 6 , the node S acknowledges the packet B since it is able to decode properly the coded packet A ⊕ B.

Protocol Analysis
3.1. Delay Analysis. The application of network coding techniques in our proposed scheme implies the simultaneous transmission of more than one packet in the network. Therefore, we analytically estimate the expected time that is needed for two packets to be exchanged under the NCCARQ-WSN protocol. The total time that is elapsed from the initial transmission until the correct reception in the destinations can be defined as where E[T D ] represents the average time for a direct transmission of a single data packet from the source to destination and E[T COOP ] corresponds to the average time required for a cooperative transmission via relays to be completed. Since E[T D ] has a value that is easy to be estimated depending on the network's configuration, we focus our analysis on the term E[T COOP ] in order to derive a closed-form expression for the system's delay. The average time that is spent during the cooperation phase can be defined as where E[T min ] is the minimum average delay in case of perfect scheduling among the relays, that is, contentionfree scheme. On the other hand, the term E[T CONT ] is used to denote the additional delay that is caused due to the 4 International Journal of Distributed Sensor Networks · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 1 1 1 contention phase which has been adopted in our protocol in order for the probability of collisions to be minimized.
The expected number of retransmissions (E[r]) that are required in order to properly demodulate the coded packet at the destination nodes is a factor that affects the time needed for a packet to be delivered. It is directly connected with the packet error rate between the relays and the destination (PER R → D ) and could be mathematically expressed as However, in our scheme two packets are sent at the same time via different channels, and, as a result, the number of retransmissions can be calculated as Therefore, the term E[T min ] can be calculated as where T RFC and T ACK are the transmission times for the RFC and the ACK packet, respectively. Furthermore, T A⊕B is the time required to retransmit a coded packet, while T ONC is the time that a relay needs in order to perform network coding techniques. Finally, T LIFS , T TACK , and T CCA are the duration of a LIFS silence period, a T ACK period, and a Clear Channel Assessment (CCA) period, respectively. Moreover, the term E[T CONT ] can be defined as where E[T c ] represents the average time required to transmit a singe packet during the contention phase among all the relays. In order to compute this value we need to model the backoff counter of each of the relays with the Markov Chain presented in [12] (Figure 3), since the formed subnetwork acts as a saturated IEEE 802.15.4 non-beaconenabled network despite the modifications in the access rules. According to this model, the probability τ that a station transmits in a randomly chosen slot is given by where International Journal of Distributed Sensor Networks 5 and the probability of a collision p as a function of τ is given by In the formulas (7)- (8), b i,k represents the steady-state probability of the state {i, k}, W is the size of the contention window, m denotes the number of the backoff stages, and n corresponds to the number of the relays in the network.
Furthermore, the probability that at least one relay attempts to transmit can be expressed as (10) and the probability of a successful transmission, that is, one station transmits conditioned on the fact that at least one station transmits is given by Moreover, the probabilities of having an idle (p i ), successful (p s ), or collided (p c ) slot can be written as Considering the above probabilities, and given that the average number of slots that we have to wait before having a successful transmission can be represented as the total contention time can be written as Applying Bayes' theorem we are able to estimate the average duration of a slot, given that the specific slot is either idle or collided: with σ representing the duration of an idle slot, while T col corresponds to the time of a collision and in our scheme is equal to Therefore, using (13)-(15), the formula (6) can be rewritten as Finally, we are able to derive a closed-form formula and compute the total delay for two packets to be exchanged in the system by exploiting (2), (5), and (17).

Throughput Analysis.
The total throughput of the network can be defined as the sum of the throughput that is produced by the successful direct transmissions plus the throughput derived by the cooperation phase after erroneous packet receptions. This can be mathematically expressed as where In the above expressions, the parameters E[T D ] and E[T total ] have been already defined. Furthermore, the packet error rate between the source and the destination is given by PER S → D , while E[P] denotes the average packet payload. In this point, it must be clarified that the coefficient 2 in formula (20) is mandatory, since two packets are delivered in each particular transmission.
Thus, having obtained a closed-form expression for E[T total ] and since E[P], E[T D ], and PER S → D are known parameters, we are able to compute the theoretical system's throughput.

Energy Performance Analysis.
Having analyzed the operation of the proposed NCCARQ-WSN protocol, we derive a closed-form expression that describes the power consumption in the network: where E COOP and E S represent the energy consumption during the cooperative phase and the initial transmission from the source, respectively. The term E COOP could be further expressed as where E min denotes the energy waste in a perfect scheduled cooperative phase and E CONT is the energy that is consumed during the contention phase (i.e., idle and collided slots). In order to clarify the above equations, we try to compute each term analytically. We consider three different modes: (1) transmission mode; when the node is transmitting data/control packets, 6 International Journal of Distributed Sensor Networks (2) reception mode; when the node is receiving data/control packets, (3) idle mode, when the node is sensing the medium without performing any action.
The power levels associated to each mode are P T , P R , and P I , respectively. Furthermore, the relationship between energy and power is given by E = P · t, where the terms E , P, and t represent the energy, the power, and the time, respectively.
(i) All stations remain idle during the LIFS, CCA, and T ACK times. (ii) The relays that lose the contention phase turn in idle mode. (iii) When a station transmits a packet (control or data), the rest of the stations are in promiscuous mode, thus capturing the packets.
Computing the energy consumed during the contention phase constitutes one of the most challenging parts in this analytical model. The total energy wasted during this phase derives from the energy that is spent during both the idle slots and the collisions as well. Let us start by defining that where E C represents the average energy required to transmit an NC packet during the contention phase among all the relays. In order to calculate the energy consumed during the collisions, we have to estimate the average number of stations that transmit a packet simultaneously. The probability p k that exactly k stations are involved in a collision is Therefore, the expected number E[K] of stations that are involved in a collision is During the idle slots, all the stations in the network remain idle. On the other hand, during the collisions, more than one relay is in transmission mode, two stations (the source and the destination) are in reception mode, while the rest of the relays are in idle mode. Considering the probabilities that we have derived regarding the contention phase (p c , p i ), the above assumptions can mathematically be expressed as where all the parameters have been already defined. Thus, combining (21)- (24) and (27), we are able to estimate the total amount of the energy that is consumed in our protocol.

Performance Evaluation
In order to validate our analysis and further evaluate the performance of NCCARQ-WSN we have developed a timedriven C++ simulator that executes the rules of the protocol.
Here we present the simulation setup along with the results of our experiments.

Simulation Scenario.
The network under simulation consists of a pair of transmitter-receiver (both nodes transmit and receive data) and a set of relay nodes that facilitate the communication, all of them in the transmission range of each other. In our experiments we consider saturated conditions, that is, the nodes have always packet to send in their buffers. Additionally, the relay nodes are capable of performing network coding techniques to their buffered packets before relaying them. In order to focus on the impact of both network coding and cooperative communication, we have made the following assumptions.
(1) The traffic is bidirectional, that is, the destination node has always a packet destined back to the source node.
(2) Original transmissions from source to destination are always received with errors (PER S → D = 1), thus initiating a cooperative phase.
(3) The channel between the source and the destination is error symmetric, that is, PER S → D = PER D → S .
(4) The channel between the source and the relays is error free, that is PER R → S = 0.
The configuration parameters of the network are summarized in Table 1 considering the IEEE 802.15.4 physical layer. The relay set consists of five (5) nodes, each of them implements a backoff counter starting with a contention window CW min = 8. The time for applying network coding (T ONC ) to the data packets is considered to be negligible, since the coding takes place between only two packets. Based on hardware specifications and since different power modes are allowed, we have chosen the following power levels for our scenarios: P T = 15 mW (We use the maximum of the transmission power levels that are offered in IEEE 802.15.4.), P R = 35 mW, and P I = 712 μW [13].
In order to evaluate our approach, we compare our scheme with a simple cooperative ARQ scheme (so-called CARQ-WSN), where the bidirectional communication takes place in two steps. In the first step, the source sends a packet to the destination and, upon the erroneous reception, the destination broadcasts the RFC packet, thus triggering the relays to retransmit the packet. In the second step, the destination transmits its own packet to the source and the same procedure as in the first step is repeated, thus consuming valuable network resources. In both steps, the relays take part in the contention phase in order to access the medium and transmit their packets.
The delay and the throughput, as they have been defined in Sections 3.1 and 3.2, respectively, are the metrics that we use in order to evaluate the QoS performance of our protocol. Moreover, in order to evaluate the energy performance of our proposed protocol we use the energy efficiency metric [14]. It is denoted by η and defined as: total amount of useful data delivered (bits) total energy consumed (Joule) .
Before proceeding to the simulation results, it is worth mentioning that the definition in (28) inherently implies that network coding benefits the energy efficiency of a protocol, as the number of the delivered bits increases by combining multiple data packets. Figure 4 shows that the numerical and simulation results are almost perfectly matched, thus verifying our analysis. Comparing with simple cooperative schemes which have the advantage of spatial diversity through relays without any network coding capability, we can achieve an enhancement in the network's throughput up to 80%. We can see that the throughput in NCCARQ-WSN for one retransmission (the minimum number when the initial transmission contains errors) is 99 kb/s while in simple cooperative schemes, the throughput is approximately 66 kb/ s. Furthermore, upon the increase in the number of required retransmissions (x-axe), the throughput gain increases as well. This significant improvement makes sense since the  number of total transmissions in NCCARQ-WSN protocol is lower compared to CARQ-WSN, as the packets are sent coded, while the number of RFC packets is also decreased. Moreover, in NCCARQ-WSN the cooperation phase is initiated only once when the traffic is bidirectional, thus saving time compared to other cooperative schemes where the cooperation takes place upon every erroneous packet reception. Figure 5 presents the packet delay in both Network-Coding-based and simple Cooperative ARQ MAC protocols. In this point, we must recall that two packets are delivered to their respective destinations in each transmission cycle of NCCARQ-WSN. Hence, in order to be accurate, we compare the delay in NCCARQ-WSN with the time required for two packets to be exchanged in CARQ-WSN.

Simulation Results.
As it can be observed, we can achieve significantly lower packet delay by using network coding techniques. Specifically, the average time that is required for two packets to be transmitted using CARQ-WSN is 0.024 sec in channels where one retransmission is necessary, reaching up to 0.074 sec when five retransmissions are required. On the other hand, the delay values in NCCARQ-WSN are 0.016 and 0.042 sec for one and five retransmissions, respectively. This difference can be rationally explained considering the operation of our proposed NCCARQ-WSN scheme, where some data  packets are sent to the relay (attached to the RFC message), thus avoiding the erroneous channel. Furthermore, in our proposed scheme we manage to reduce the backoff phases by sending two packets simultaneously, while in simple cooperative protocols the relays have to participate in the contention phase for each packet that has to be retransmitted. Therefore, we are able to enhance the packet delay, since the time that is spent in idle slots and collisions is significantly reduced, especially as the number of required retransmissions grows. Figure 6 shows that our analysis verifies the simulation results with regard to the energy performance. Comparing our proposed network-coding-based scheme with simple cooperative protocols for different number of retransmissions (and consequently different PER between the relays and the destinations), we observe that our scheme is more energy efficient than non-network-coding-based schemes, since more bits are delivered over the same amount of energy consumed. Keeping constant the data packet length (100 bytes) the energy efficiency of NCCARQ-WSN decreases as the number of relay retransmissions grows. However, the difference with simple cooperative schemes remains steadily over 30%.

Conclusion
In this paper, a novel network-coding-based MAC protocol for cooperative wireless sensor networks has been presented. Compared to simple cooperative ARQ-based MAC protocols, the proposed solution has been proven to be up to 50% more energy efficient, while the provided quality of service in terms of throughput and delay is not compromised. In order to optimize the energy management in the network, MAC schemes have to be combined with energy-aware routing solutions, while sleep modes techniques for inactive nodes should be considered as an extra option. Our future research will be focused on such issues.