## 4 The COASYM-MAC Protocol
### Wake Up Scheduling  
Duty cycling is the best technique for saving a significant amount of energy. [PERSON] et al. proposed a depth based wake up scheduling protocol in [54] based on the node's depth without considering various factor like residual energy, distance, etc. In this section, we introduce multi-factor based wake up scheduling so that an ordinary node can select efficient relay nodes for data forwarding. At first, in this tree structure, we calculate the duty cycle time of each node by multiplying fixed wake up times by the tree level \(\delta\)  
\[Duty\ Cycle=\delta\times Fixed\ Wakeup\ time \tag{1}\]As discussed in Section 4.2.2, each node knows its parent node. Now, we calculate the factor value of each node using the following equation:  
\[Factor\ value=\alpha\times CSI+\beta\times RE+\gamma\times\frac{1}{d_{u,p_{u}}} \tag{2}\]  
Here, RE is the residual energy, and \(d_{u,p_{u}}\) is the distance between a node and its parent. We consider three factors to calculate the factor value of each node. A node measures the Channel State Information (CSI) by using the Received Signal Strength Indicator (RSSI) [55]. To establish a relationship among channel state information (CSI), residual energy (RE) and the distance, three constants, \(\alpha\), \(\beta\) and \(\gamma\), are incorporated. From the simulation results, we found that a value of 0.4 for \(\alpha\), 0.4 for \(\beta\) and 0.2 for \(\gamma\) gives the optimum result for calculating factor value. Now, we calculate the backoff score from Equation (3). Here, the node that has a comparatively high CSI, high residual energy, and low parent child distance takes the short backoff.  
\[backoff=\frac{1}{Factor\ value} \tag{3}\]  
Now, each node wakes up periodically by combining the duty cycle time with the backoff time using Equations (1) and (3).  
\[Node\ Waking\ Time=Duty\ Cycle+Backoff \tag{4}\]  
Thus, nodes under the same parent as well as the same level will wake at the same time with Equation (1), but they differ in the backoff time. In the traditional MAC protocols, backoff is used for delaying the opportunity of transmission by a sender when multiple senders are contending for data transmission, thereby reducing the probability of collision. In such cases, transmission time is closely related to the backoff. However, in our proposed protocol, we use backoff to achieve a different goal. Here, backoff is used to differentiate the wake-up schedule among all siblings so that the node having the highest factor value (Equation (2)) wakes up early (Equations (3) and (4)) to send the beacon first. Unlike CL-MAC, here we consider distance because distance is one of the main factors for choosing the best node as a relay node. Since wake-up schedule of nodes are different from neighboring nodes, there is less probability of collision by hidden terminal problem. We formally represent the details of the wake-up schedule algorithm in Algorithm 3.  
```
1:for each node in the network do
2: Determine the CSI by using RSSI, residual energy and distance from the parent node;
3: Calculate the factor value according to Equation (2) by using the information from Step 2;
4: Compute the backoff value according to Equation (3);
5: Compute the duty cycle according to Equation (1);
6: Determine the node wake-up time according to Equation (4);
7:endfor
```  
**Algorithm 3** Wake up scheduling.