## 3 Basic System Operation
### SBD Routing
### Insertion

Within a sector, data is further distributed among nodes according to their distance from the SH. To do this, a sector is divided into segments. Figures 6, 7 and Table 4 illustrate the idea of sector segmentation. Given a _k_th sector containing _M\({}_{k}\)_ member nodes, the _SH\({}_{k}\)_ first sorts all member nodes based on RSSI in ascending order. The member nodes are then divided into \(r\) segments. Each segment forms a ball, denoted by _B\({}_{(X,Y)}\)_(_r_), where the ball centered in (X, Y) of radius _r\({}_{i}\)_. (X, Y) is the geographic co-ordinates for _SH\({}_{k}\)_. The number of segments depends on the WSN application, the size of a sector and the number of member nodes in each sector. Thus the set of sensors that are within a Euclidean distance _r\({}_{i}\)_ from (X, Y) form the segment defined by:

\[\textit{B}_{{}_{(x,r)}}(\textit{r}_{i})=\left\{\textit{sensorsCoordinate}(x,y) \colon\left(X,Y),(x,y\right)\leq r,\right\} \tag{25}\]

\[\textit{B}_{{}_{z}}=\left(\textit{P}_{{}_{z+1}}-\textit{P}_{{}_{z}}\right)/r, \quad 1\leq k\leq S \tag{26}\]

\[\left\{\textit{P}_{{}_{x+i}}\right\}_{{}_{k=1}}\left\{\textit{



By Equations (26) and (27), the pivot points for \(r\) segments within the \(k\)th sector are calculated. An event with hash value, denoted by \(h\), is stored in a member sensor node of \(i\)th segment where \(\mathrm{P}_{u_{i}(i)}\leq h\leq\mathrm{P}_{u_{i}(i+)}\). In order to balance the load, data is distributed among the nodes inside a segment in a round robin fashion (see Algorithm 5). \begin{table}
\begin{tabular}{|c|c|c|} \hline \multicolumn{2}{|c|}{**Member Node Id**} & \multicolumn{2}{c|}{**Received Signal Strength Indicator**} \\ \hline \multicolumn{2}{|c|}{\(m_{1}\)} & \multicolumn{2}{c|}{\(RSSI_{i}\)} \\ \hline \multicolumn{2}{|c|}{\(m_{2}\)} & \multicolumn{2}{c|}{\(RSSI_{i}\)} \\ \hline \multicolumn{2}{|c|}{\(m_{4}\)} & \multicolumn{2}{c|}{\(RSSI_{i}\)} \\ \hline \multicolumn{2}{|c|}{\(r_{2}\)} & \multicolumn{2}{c|}{\(...\)} \\ \hline \multicolumn{2}{|c|}{\(m_{i}\)} & \multicolumn{2}{c|}{\(RSSI_{i}\)} \\ \hline \multicolumn{2}{|c|}{\(r_{3}\)} & \multicolumn{2}{c|}{\(...\)} \\ \hline \multicolumn{2}{|c|}{\(m_{i}\)} & \multicolumn{2}{c|}{\(RSSI_{i}\)} \\ \hline \multicolumn{2}{|c|}{\(r_{4}\)} & \multicolumn{2}{c|}{\(...\)} \\ \hline \multicolumn{2}{|c|}{\(M_{K}\)} & \multicolumn{2}{c|}{\(RSSI_{i}\)} \\ \hline \end{tabular}
\end{table} 
Table 4: Member table of a SH node. Figure 6: Formation of balls or segments inside a sector. Figure 7: Segmentation architecture of member nodes inside a sector. ### Querying

#### 3.6.1 Range Query

Range query, issued by the query nodes from a sector of the network, denoted by _Range_ (\(q\), \(r\)), where \(q\) can be defined by an \(l\)-dimensional tuple, (\(q_{1}\), \(q_{2}\), \(q_{3}\), \(\ldots\), \(q_{l}\)) where \(q_{g},\bigtriangledown_{g}\in\llbracket l,l\rrbracket\), denotes the query value of the \(g\)th attribute and \(r\) is the weighted range to be considered. Hence, the query node first calculates

\[h_{q}=\sum\limits_{i=1}^{i}\big{(}\big{(}a_{i}/A_{\text{\tiny{range}}}\big{)} \times w_{i}\big{)} \tag{28}\]

where, \(h_{q}\) denotes an aggregated query hash. The query range can be defined by \([h_{q}-r\), \(h_{q}+r]\). The target head nodes where the query is to be forwarded are \(SH_{i}\), \(SH_{i+1}\), \(\ldots\), \(SH_{k}\) where \(P_{j}\leq h_{q\cdot r}\leq P_{j+1}\), \(P_{k}\leq h_{q+r}\leq P_{k+1}\) and \(j\leq k\). \(SH_{j}\) pulls data from the member nodes belonging to the segments: \(\textbf{{B}}_{(X,Y)}\big{(}r_{t}\big{)}\,\textbf{{B}}_{(X,Y)}\big{(}r_{t+1} \big{)}\),..., \(\textbf{{B}}_{(X,Y)}\big{(}r_{r}\big{)}\) of the \(j\)th sector, where \(\text{P}_{M_{j}(t)}\leq h_{q\cdot r}\leq\text{P}_{M_{j}(t+1)}\). In contrast, \(SH_{k}\) pulls packets from the member nodes belonging to the segments: \(B_{(X,Y)}\big{(}r_{0}\big{)}\,B_{(X,Y)}\big{(}r_{1}\big{)}\)..., \(B_{(X,Y)}\big{(}r_{t}\big{)}\) where \(\text{P}_{M_{j}(t)}\leq h_{q+r}\leq\text{P}_{M_{j}(t+1)}\).