## 5 Results and Discussion  
The proposed grid-based routing model for smart building applications was tested using MATLAB software with the following system configurations:  
* Processor: Intel (R) Core TM i5-3330s CPU @ 2.70 GHz
* Memory (RAM): 8.00 Gb (7.88 Gb usable)
* System type: 64-bit operating system, x64 based processor  
The experimental analysis was carried out with the help of sensor nodes deployed within 1000 \(\times\) 1000 m\({}^{2}\) dimensions, and the total energy of the deployed node was fixed at 10 J. In addition, some of the simulation setups considered for analysis is listed in Table 3.  
Initially, the nodes are deployed in the specified region of the building to sense various types of information. Approximately 20 sensor nodes were deployed in each building. The location coordinate for the sink is (4, 4), and the location coordinate for the server is (4, 1). These deployed nodes are then formed into grids based on the intercommunication range. The formation of the grid using the intercommunication range is shown in Figure 6. The nodes that are present within the grid are referred to as grid members.  
From each grid, one node was selected as the grid organizer. The elected grid organizer functions as the head for a specified period of time. Using the sailfish optimization algorithm, the grid organizer is selected based on two significant parameters: distance and residual energy. The election of the grid organizer is represented in a pictorial format in Figure 7. The selection of the grid organizer in each grid is displayed in the previous figure. In each grid, the node highlighted in green is referred to as the grid organizer. The sensed information from every grid member is transmitted to the grid organizer. Then, from the grid organizer, the data must be transmitted to the sink.  
The source grid organizer selects its neighbor grid organizer based on the relay-node selection technique to perform this function. In this study, the grid organizer is referred to as a relay node. The relay node is selected using a fuzzy expert system. The input for creating the fuzzy rule is the grid organizer's distance, residual energy, and choice. Based on this parameter, the relay node is selected to transmit data from the grid organizer to the sink. The grid organizer selected as the relay node is displayed in pictorial format in Figure 8.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Simulation Parameter** & **Values** \\ \hline Type of channel & Wireless \\ Simulator & MATLAB R2020b \\ MAC type & 802.11 \\ Number of sensor nodes & 300 \\ Simulation time & 50 s \\ X\&Y dimension & 1000 m\&1000 m \\ Packet size & 100 bytes \\ Packet rate & 100 packets/s \\ Energy & 10 joule \\ \hline \hline \end{tabular}
\end{table}
Table 3: Simulation parameters considered for analysis.  
Figure 6: Formation of grid using the deployed nodes.  
Figure 7: Election of grid organizer in each grid.  
In the above figure, the grid organizers selected as relay nodes are illustrated. The grid organizers selected as relay nodes are highlighted in red. Using these relay nodes, the grid organizer transmits the acquired data to the sink using the shortest path. Then, from the sink, the data are transmitted to the server for further monitoring. Prior to the transmission of data to the server, the data were encrypted using a two-fish algorithm. The encrypted data were then transmitted to the server. At the server end, the encrypted data are decrypted again for visualization. Finally, based on this routing protocol, smart building applications can attain energy-efficient and secure data transmission. Performance metrics were evaluated to perform an experimental study of the proposed framework. The evaluation of various performance metrics related to the experiment is described in the next section.