## 3 The Proposed Protocol
### Network Clustering  
A distributed data-centric clustering approach is utilised to partition an LDS network into a number of clusters. The clustering technique is commonly used to establish hierarchical routing infrastructures according to nodes' similarities--mainly location, sensor recordings and/or computation and communication capacities. Clustering aims to reduce network transmitted traffic and congestion, especially if bandwidth is restricted [18]. Using clustering, simultaneous requests to access wireless channel are reduced. This results in reduced concurrent communications and consequently decreased network congestion compared to flat infrastructure networks. Moreover, data robustness is enhanced in clustered networks [31]. Data robustness is reduced in flat networks, as packet failure is increased due to bottleneck congestion, whereas this is increased in clustered networks, as they avoid bottlenecks by restricting data transmissions into intra-cluster communications. Algorithm 2 is utilised to form the data-centric clusters. This is a light-weight clustering algorithm that is executed by LDSs which has data records matching the sink's query in a distributed fashion. Unlike centralised clustering, LDSs do not need to transmit their information to a single node (e.g., sink) to form the clusters. This would reduce network transmitted traffic and consequently enhance network resource conservation--mainly regarding bandwidth. According to this algorithm, an LDS that receives a valid query message (in terms of region address and/or time stamp) introduces itself as a candidate cluster-member by broadcasting a \(cluster\_msg\) message. This message is comprised of LDS's connectivity degree (the number of single-hop interconnected LDSs), data type and location address. Each LDS updates its clustering table once a \(cluster\_msg\) is received. Cluster-head (CH) selection starts at a particular time period after the clustering procedure in a distributed manner. This enhances network resource conservation--mainly bandwidth, as LDSs locally recognise their CHs with minimised communication. CH selection is executed when LDSs receive \(cluster\_msg\) from their next-hop neighbourhood. According to [32], a two-second timer (\(Tm\)) is used to support allowed loss since a \(cluster\_msg\) is sent out until a reply is received. That way, each LDS which receives \(cluster\_msg\) checks its own clustering table to recognise the LDS with the maximum connectivity degree and shortest Euclidean distance to the sink. This LDS selects its own CH and joins the cluster as a cluster member (CM) by forwarding data records (\(Data\_pkt\)) for aggregation. An LDS recognises itself as a CH when it receives a \(Data\_pkt\) with no additional communications. An LDS that already belongs to a cluster as a CM can be still selected as a CH. This is when a cluster member receives \(Data\_pkt\) from an LDS. It marks itself as a CH and sends a \(joint\_msg\) to its own CH. A CH which receives the \(joint\_msg\) becomes a \(joint\_point\), which is used to form the tree branches and change MA direction. Indeed, an MA changes its direction to sweep three branches if a \(joint\_point\) is visited. This MA route planning will be discussed in Section 3.4. However, an LDS becomes an isolated CH if it receives no \(cluster\_msg\) message from its neighbours and \(Tm\) expires. ```
Data: Clustering Table (CT); Timer (\(Tm\)); /*A Valid Query is Received. */ if(Query.data == LDS. data)then  Broadcast (cluster_msg); \(Tm\).reset; /*Updates CT whileTm is not expired. */ while(Tm \(\
eq\) 0)do ifcluster_msg \(\
eq\) Nullthen  Update_CT0;  end if  end if  end if /*Invalid Query is Discarded. */ else  Discard Query;  end if /*=====CH Selection===*/ sort.CT(connectivity | distance);  CH \(\leftarrow\) CT.top(); ifCH \(\
eq\) LDS.IDthen /*This is selected already as CH by other LDSs, but has its own CH. */ ifData_pkt \(\
eq\) Nullthen  Forward \(joint\_msg\) to CH;  end if  Forward \(Data\_pkt\) to CH for aggregation;  end if /*A CH knows no other CHs.