## 3 Proposed Clustering Routing Protocol
### Configuration Phase  
Initially, network assumptions and its topological structure must be defined since different network configurations can be established depending on the requirements of the application. The network assumptions comprise the characteristics of the sensor nodes. On the other hand, in the network structure, the establishment of WSNs includes the deployment of nodes in the sensing area to create a topological structure where the data will be collected. Under such considerations, the proposed protocol considers the following network assumptions and structure. This configuration has been adopted to be consistent with other related works. Network assumptions:  
1. The network has one base station \(BS\), a set of cluster heads \(CH\), and a set of sensor nodes \(n\)
2. The power of the base station is externally supplied, while the energy of sensor nodes is limited
3. A sensor node will be considered dead when it is out of power
4. All sensor nodes are homogeneous  
Network structure:  
1. Initially, all nodes are randomly deployed in the sensing area
2. Nodes location will not change during the whole life of the network
3. The base station is placed at the center of the sensing area
4. The number of clusters is not fixed
5. Every normal node (also called leaf node) is added to its nearest cluster head  
Once the network topology is determined, the entire network connection establishment process begins, where the set-up phase is executed. In the set-up phase, initial CHs are chosen to build the initial cluster network configuration. In the selection of the optimal CHs, the proposed strategy considers the following energy consumption model. Energy Consumption Model  
In WSNs, the activities that consume most of the energy are data transmission and reception. The energy consumption for transmitting or receiving data depends on the distance \(d\) and the size of the data packet. Under such considerations, the required energy to transmit a \(l\)-bit data packet is defined in Equation (8). \[E_{TX}(l,d)=\left\{ \begin{array}{ll}lE_{dec}+l_{fg}d^{2},&d\leq d_{th}\\ lE_{dec}+l_{emp}d^{4},&d>d_{th}\end{array} \right. \tag{8}\]  
where \(E_{TX}\) is the energy consumption for transmitting data, \(l\) is the data length, \(E_{dec}\) is the energy dissipation for transmitting or receiving \(1\) bit of data, \(\varepsilon_{fs}\) is the coefficient of energy dissipation in the free space model, \(\varepsilon_{mp}\) is the coefficient of energy dissipation in the multi-path attenuation model, and \(d_{th}\) is the transmission distance threshold defined in Equation (9). \[d_{th}=\sqrt{\frac{\varepsilon_{fs}}{\varepsilon_{mp}}} \tag{9}\]  
The required energy to receive a \(l\)-bit data packet is calculated in Equation (10). \[E_{RX}(l)=lE_{elc} \tag{10}\]  
Since a normal sensor node \(n_{i}\) only transmit data to the cluster head, the following equation can calculate its energy consumption:  
\[E(n_{i})=E_{TX}(l,d) \tag{11}\]  
However, the energy consumption of a cluster head must include the energy consumption of receiving packets from cluster member nodes, aggregating data, and transmitting aggregated data to the base station. Therefore, the energy consumption of a cluster head \(CH_{j}\) is calculated as Equation (12). \[E\Big{(}CH_{j}\Big{)}=E_{RX}(l)N_{j}+\Big{(}N_{j}+1\Big{)}lE_{DA}+E_{TX}(l,d) \tag{12}\]where \(N_{j}\) is the number of member nodes in cluster \(j\), and \(E_{DA}\) is the energy for 1 bit of data aggregation. Under the above considerations, the residual energy of a leaf sensor node \(n_{i}\) can be estimated by Equation (13). \[E_{r}^{t}(n_{i})=\left\{ \begin{array}{cc}E_{r}^{t-1}(n_{i})-E_{TX}(l,d),&E_{r} ^{t-1}(n_{i})>0\\ 0,&E_{r}^{t-1}(n_{i})\leq 0\end{array} \right. \tag{13}\]  
While the residual energy of a cluster head \(CH_{j}\) is described in Equation (14). \[E_{r}^{t}\Big{(}CH_{j}\Big{)}=\left\{ \begin{array}{cc}E_{r}^{t-1}\Big{(}CH_{ j}\Big{)}-E\Big{(}CH_{j}\Big{)},&E_{r}^{t-1}\Big{(}CH_{j}\Big{)}>0\\ 0,&E_{r}^{t-1}\Big{(}CH_{j}\Big{)}\leq 0\end{array} \right.