## 4 Performance Analysis of QoS Metrics
### Latency Analysis of Zigbee with Multi-Hop AES Encrypted Communication  
Latency is another important aspect of IoT and sensor networks. It is more crucial in real-time applications, such as health monitoring and vehicular communication [51]. Latency is affected by various factors including baud rates, data packet size, number of hops, and encryption of the data. Based on the real-time data collection, this work conducts the experimental analysis on how the above-mentioned three factors affect the latency of Zigbee communication. Baud rates being one of the primary and obvious factors affecting the latency, this work first studies this. For measuring the latency at different baud rates, the round-trip latency (RTL) is taken into consideration by sending packets ranging from 10 to 60 bytes from the coordinator to the end node, which is again looped back to the coordinator as presented in Figure 11. RTL is the summation of transmit time (T\({}_{\text{TX}}\)) and reception time (T\({}_{\text{RX}}\)). The test is conducted in an indoor environment as preliminary tests suggest no significant variation in latency measurement in indoor and outdoor environments. The coordinator is placed at C\({}_{1}\), and the end node is deployed with a 30 m distance at E\({}_{30}\) as depicted by Figure 4. The Rx and the Tx pin of the end node module are shorted to loop back the received data to the coordinator without any data preprocessing delay. Figure 12 depicts the latency of single-hop Zigbee communication with a variation of baud rates and packet size for both encrypted and unencrypted communication with a transmission distance of 30 m. The mean of 50 readings is taken into consideration for any data point of the plots. For both AES encrypted and unencrypted data, the latency increases linearly with the increase of data packet size for all the baud rates. Overall, with any packet size, RTL is minimum with the baud rate of 115,200, which increases with the decrease of the baud rate and reaches the maximum at 4800. With the baud rate of 115,200, the RTL is 0.075 s and 0.028 s for the packet size of 10 bytes, which increases linearly and reaches 0.095 s and 0.04 s for the packet of 60 bytes for encrypted and unencrypted data, respectively. Thus, the latency increases by 5.34% and 8.57%, respectively, for encrypted and unencrypted data with the increase of each 10 bytes of the packet size. On the other hand, when the transmission is switched from the baud rate of 115,200 to 4800, with every 10 bytes/packet, the RTL increases by 66.67% and 221.43%, respectively, for encrypted and unencrypted communication, which is 257.89% and 625%, respectively, for 60 bytes/packet. Thus, it is evident that the trend of the percent increase of the RTL with the increase of packet size and also with the decrease in the baud rate is stepper in unencrypted communication in comparison to the AES encrypted one. Now, it is quite intriguing to analyze how the latency changes due to encryption and the hopping of the data. To do this study, the best performing baud rate, 115,200, is taken into consideration for one-hop and two-hop transmission. This would greatly help to understand better the trade-offs of AES and multi-hop communication. For this, the coordinator is placed at C\({}_{1}\), the end node at E\({}_{30}\)  
Figure 10: RSSI values of single-hop and two-hop communication with P\({}_{\text{Trans}}\) = 3 dBm for various transmission distances and deployment scenarios. which is at a 30 m distance from the coordinator as depicted by Figure 4. For two-hop communication, a router is placed at an equidistance from a coordinator and the end node. Figure 13 compares the RTL performances of the one-hop and two-hop routing with and without AES encryption. It is perceptible from the figure that the measured RTL of one-hop communication both with and without AES encryption is significantly less than that of two-hop communication instances.