## 5 Cross-Layer Cluster-Based Energy-Efficient Protocol
### Steady Transmission Phase  
In the transmission phase, intra- and inter-cluster CH routing happens. In intra-cluster routing, the CM sends data to the CH in the same cluster. In inter-cluster routing, the data aggregated by the CH will be forwarded to the sink or CH node. The CH will forward the packets of three previous CHs to the sink  
Figure 3: TDMA in both sink and CH frames. according to the hexagonal structure. Before forwarding the data to the next CH or sink, it aggregates the data based on the cluster aggregation scheme. The cluster aggregation scheme consists of the sink, CHs and CMs. the cluster aggregation scheme is shown in Figure 4. The aggregation scheme can consist of different aggregation levels. The aggregation level of each CH is based on the remaining energy of the particular CH. More aggregation happens when the remaining energy is low. The energy window for an aggregation level is found by dividing the total energy capacity of the node by the total number of the aggregation level. The aggregation level increases when the energy depletion increases. The aggregation levels for different residual energy is shown in Table 1. The data aggregation has different components to reduce the data; for example, considering the temperature as a parameter, to fuse the temperatures of different sensor nodes. The goal of maintaining extreme data records is fusing many similar CMs and thereby maintaining as much precision of the data as possible. Thus, fusing similar objects is preferable. Most data aggregation schemes only focus on averaging data in the fusion process. In this paper, we propose a cost-aware decision scheme to select the two sensor nodes to fuse information to reduce the size of the packets. Furthermore, a cost-aware scheme helps to reduce the loss of extrema values and increases the precision of the data. Additionally, this aggregation level of each CH is used to control the amount of aggregation based on the current \(E_{res}\) of each CH. The cost-aware decision uses a weight function to calculate the fusion costs of two CMs \(a\) and \(b\), considering all contained parameters. Let \(p\) denote the set of parameters and \(a_{i}\) be the value for the \(i\)-th parameter of node \(a\). Furthermore, let \(w_{i}\) be the weight for parameter \(i\). Then, the cost can be calculated as indicated in Equation (14). \[cost=\sum_{i\in p}w_{i}*|\frac{a_{i}-b_{i}}{max_{t}}| \tag{14}\]  
\[w_{1}+w_{2}+w_{3}\ldots+w_{i}=1 \tag{15}\]  
\[w_{1}+w_{2}=1\Rightarrow w_{2}=1-w_{1},0\leq w_{1}\leq 1 \tag{16}\]  
Using this notation, assuming a system using only two parameters \(P=\{temp,hum\}\), let the weights be \(0.5\) for both the temperature and position. The weights allow one to determine the importance  
Figure 4: Aggregation based on clustering. of temperature and position. Furthermore, varying weights from zero to one can determine the best performance of the decision component. For aggregation level, the total energy capacity of the CH and the number of aggregation levels are considered. The energy window (EW) size for each aggregation level can be calculated from Equation (17), where \(E_{cap}\) is the energy capacity of sensor nodes and \(n\) is the total number of aggregation levels. This method can be explained further using an example; from Table 1, \(n\) is considered as \(10\) and \(E_{cap}=2j\). The EW size is calculated, and each window size is assigned to each aggregation level. Firstly, each CH checks its \(E_{res}\) and compares with the aggregation level size. If there is a change, then it updates its aggregation level. The CH checks its \(E_{res}\) every time before it transmits to the sink node. \[EW=\frac{E_{cap}}{n} \tag{17}\]  
After the aggregation of data in the CH, the CH will transmit data to the next CH in the direction of the sink. The CH operates at the range of \(R\), which is the maximum distance between two adjacent cells in a hexagonal structure.