## 3 Proposed Protocol
### Cluster Formulation, Maintenance and Update  
The cluster formulation mechanism in NEURON has a significant impact on the WSN from multiple perspectives. It improves the energy efficiency and facilitates the design and deployment of higher layer protocols and applications. Clusters are autonomously formulated, maintained and updated based on neighbour to neighbour communication among the sensor nodes. The _Autonomic Estimation Algorithm_ provides information necessary for the optimisation of the CHs selection and distribution. Routing information acquired during the clustering process is stored in nodes' local caches and used by the routing algorithm applied. Controlled flooding is also utilised in order to avoid traffic forwarding outside the cluster zone. NEURON allows each node to become a CH according to specific criteria. A node that is selected as CH acts as a proxy for the rest of the members in its cluster. Each node may be in two states; either belonging to a cluster or being in the process of joining to a cluster. The clustering process starts only after the _Autonomic Estimation Algorithm_ has been converged and, thus, the size \(N\) and density \(d\) of the WSN is estimated. Based on these two parameters, each node decides to become a CH with a probability _Pclust_ given by the following equation:  
\[P_{clust}=\frac{\log(N)}{10*d}*KPI \tag{1}\]  
where:  
\[KPI=0.5*\frac{available\_battery}{total\_battery}+0.5*\frac{available\_memory}{ total\_memory} \tag{2}\]  
The Key Performance Indicator (KPI) in Equation 1 refers to the capabilities of each sensor. Nodes with better KPI present higher probability of becoming CHs and remaining in this status for a longer period of time until their resources are reduced significantly. In our case, the KPI is related with the available battery and memory of each node and is given in Equation 2. These parameters were considered crucial for a sensor node deployment and operation in a WSN. However, any other parameter that better addresses application- specific requirements (for the KPI) may be selected. According to equation 1, a smaller number of CHs is expected to be elected in dense networks than in sparse ones. In addition, a higher number of CHs is anticipated in larger networks compared to smaller ones. Equation 1 was selected to cover a wide set of possible WSN topologies. However, if the network size or density is known _a priori_, more optimal possibilities _Pclust_ may be selected. The _Pclust_ is updated regularly based on the current parameters \(N\) and \(d\) of the network. This allows NEURON to adapt to changes in the network topology or conditions and optimise the clustering formulation process. For example, in case of a node transitioning from a CH operation mode to normal operation mode, the nodes of the cluster decide to become CHs taking into consideration the latest estimations of the parameters \(N\) and \(d\). In this case, if the average density is reduced, more than one CH may be elected. This process, combined with the cluster formulation update mechanism described in the next paragraph, facilitates the better distribution of CHs among the WSN and the extension in the network lifetime. Cluster Formulation, Maintenance and Update Mechanisms  
Each CH is responsible for periodically broadcasting its existence utilizing a controlled flooding mechanism. According to this approach, at a certain time interval the CH broadcasts a _MSolicitateCH_ message. This message contains its MAC address (which is also the group identifier), its updated KPI and an auto increment number that is used for cycle prevention. The goal for this solicitation message is threefold:  
1. _Cluster Formulation & Maintenance_: Upon the receipt of a _MSolicitateCH_ message by a node not registered to a CH, a _MRegisterNode2 CH_ response message is send to the CH. The latter updates its routing cache and then the node automatically becomes a member of the broadcasted cluster.