## 5 Results
### Scalability Simulation Analysis
\begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline \multirow{2}{*}{**Number of Devices**} & \multirow{2}{*}{**CCTV Fog**} & \multirow{2}{*}{**CCTV Cloud**} & \multirow{2}{*}{**CCTV Difference (\%)**} & \multirow{2}{*}{**CO2 Fog**} & \multirow{2}{*}{**CO2 Cloud**} & \multirow{2}{*}{**Difference (\%)**} & \multirow{2}{*}{**Light Fog**} & \multirow{2}{*}{**Light Cloud**} & \multirow{2}{*}{**Difference (\%)**} \\  & & & & & & & & & \\ \hline
20 & 217.93 & 750.58 & 70.97\% & 102.42 & 672.76 & 84.78\% & 100.78 & 684.74 & 85.28\% \\
40 & 220.86 & 776.04 & 71.54\% & 84.59 & 731.42 & 88.44\% & 95.38 & 740.23 & 87.11\% \\
60 & 196.79 & 825.04 & 76.15\% & 79.16 & 819.58 & 90.34\% & 80.52 & 806.02 & 90.01\% \\
80 & 189.99 & 865.57 & 78.05\% & 76.44 & 842.96 & 90.93\% & 73.12 & 848.23 & 91.38\% \\
100 & 177.68 & 903.00 & 80.32\% & 81.17 & 869.01 & 90.66\% & 78.99 & 857.16 & 90.78\% \\
120 & 169.57 & 905.27 & 81.27\% & 81.89 & 885.81 & 90.76\% & 81.26 & 895.89 & 90.93\% \\
140 & 171.42 & 911.62 & 81.20\% & 90.01 & 912.87 & 90.14\% & 91.19 & 904.85 & 89.92\% \\
160 & 165.15 & 923.48 & 82.12\% & 94.32 & 915.08 & 89.69\% & 93.95 & 907.88 & 89.65\% \\
180 & 163.93 & 945.86 & 82.67\% & 101.45 & 906.32 & 88.81\% & 103.48 & 918.59 & 88.74\% \\
200 & 169.97 & 949.41 & 82.10\% & 118.47 & 922.16 & 87.15\% & 117.38 & 926.42 & 87.33\% \\ \hline \hline \end{tabular}
\end{table} 
Table 8: Latency (ms) results for device data management. Figure 4: Cloud/Fog scenario energy consumption comparison. Table 8 highlights Cloud and Fog-only latency simulation results for managing CCTV, CO2, and light sensor data in the smart building environment. The Cloud-only simulation is high at between 750.58 ms for 20 devices and 949.41 ms for 200 devices compared to the Fog-only simulation, which was significantly lower at 217.93 ms, a 70.97% difference for 20 devices, and 169.97 ms, an 82.10% difference for 200 devices. This highlights a direct correlation between an increased number of devices and latency for Cloud-only simulations. However, the Fog-only simulation results showed an indirect correlation between increased devices and decreased latency. This results from established scheduled routing and offloading activities within the Fog node cluster for data processing transfers. Furthermore, some of the benefits of Fog computing are data process and storage optimisation, distributed resource availability and distributed load balancing capability, and optimising data processing locally at the network's edge in a decentralised architecture design instead of processing at a centralised Cloud location further away from the network's edge. This decentralisation also reduces data transfer distance and frequency, taking advantage of the distributed network resources at the network's edge. Table 8 displays the latency simulation results for CCTV, CO2, and light sensor IoT devices, respectively, which showed a similar trend, i.e., a direct correlation between an increase in devices and an increase in latency for Cloud-only simulation. Conversely, there is an indirect correlation between the number of devices and latency with Fog-only simulation, where the increase in the number of devices showed a decrease in latency. Table 8 shows the Cloud-only latency simulation at 672.76 ms for 20 devices, which increased to 922.16 ms for 200 devices, a difference of 249.39 ms. In contrast, the Fog-only simulation, compared to the Cloud-only simulation, shows significantly less latency by 84.78% at 102.42 ms for 20 devices and 87.15% less latency at 118.47 ms for 200 devices, a difference of 16.05 ms. This difference represents a significantly lower latency between Cloud-only and Fog-only data management and computation processing resources, clearly highlighting the benefits of Fog computing in the smart office building architecture. There is a similar trend in the Cloud-only light sensor latency simulation at 684.74 ms for 20 devices, which increased to 926.42 ms for 200 devices, a difference of 241.68 ms.