# A Cross-Layer Optimized Opportunistic Routing Scheme for Loss-and-Delay Sensitive WSNs
## 5 The Design of the COOR Scheme
### COOR Protocol  
The main goal of the COOR scheme is to make full use of the unbalanced load of the network, and to improve the network performance by changing the transmission power of nodes in different areas of the network. Based on the different emphasis on network performance, two optimization methods are provided. Specifically, the implementation of the two methods is given by Algorithm 1. The priority of candidate nodes is not fixed, mainly determined by the effective forwarding distance and the current energy surplus. **Definition 2**. : _Suppose that \(d(S,sink)\) represents the distance from node \(S\) to the sink, \(d_{i}\) represents the effective forwarding distance of node \(n_{i}\) selecting candidate node \(C_{i}\), and \(\psi_{i}\) represents the current remaining energy of node \(C_{i}\). The priority of the node \(C_{i}\) under the COOR scheme is:_  
\[Pri_{i}=\alpha\cdot d_{i}+\beta\cdot\psi_{i} \tag{35}\]  
_where the effective forwarding distance is:_  
\[d_{i}=d(n_{i},\ sink)-d(C_{i},sink) \tag{36}\]  
_Here, \(\alpha\) and \(\beta\) are weight factors, they can adjust the importance of effective forwarding distance and residual energy in the priority calculation. Meanwhile, it can be known from the formula that the longer the forwarding distance and the more residual energy, the higher the priority._  
In order to maintain the reliable communication between candidate nodes, the distance between candidate nodes need to be limited to distance \(D_{rd}\). That is \(d(C_{i},C_{j})<D_{rd}\). In the COOR protocol, the transmit power of each node is different, thus the size of the communication area is different. Figure 16: Transmission radius of node at different distance in COOR(R) method. However, there is no significant difference in transmit power between the candidate nodes, and the communication message is much smaller than the data packet. Therefore, a reasonable approach is to select the maximum transmission radius of the sending node \(r_{max}\) as the limit distance \(D_{rd}\) between the forwarding nodes. ```
1: Using COOR (R) method or COOR (P) method to calculate the power of the node, set the optimal transmit power. 2:If COOR(P) method is adopted then
3: Adjust the sending radius of the node;
4:End if
5: Sensors start monitoring, and the wireless sensor network is regard alive until one of the sensor nodes run out of its energy. 6:While The energy of the node is not exhausted
7: The sending node generates a packet according to specific application;
8:For each data transmission Do:
9:If Data fusion required then
10: Reorganizes the current data packet with local stored information;
11:End if
12: Reads the local information of forwarding distance and the residual energy;
13: Calculates the priority of each node in the transition region;
14: Selects the highest priority N nodes to form the candidate node set;
15:Sender broadcasts Request to Send (RTS) message to all candidate nodes and wait;
16: Receiver replies a Clear to Send (CTS) message to the Sender when it is free, where the updated information of residual energy is attached;
17: After receiving all the CTS messages, Sender broadcast data packets to all candidate nodes. Here, the priority information of each candidate node is appended to the data packet;
18: After data reception is completed, candidate nodes broadcast its result in order of priority. 19:For each candidate nodes Do:
20:If the reception succeeds then
21: Broadcast the ACK message to all candidate nodes and the send node. The remaining candidate nodes delete the duplicate data packets;
22:Else
23: Check its priority;
24:If is the lowest then
25: Broadcast the final NACK message to the send node;
26:Else
27: Broadcast the NACK message to remaining candidate nodes.