## 7 Conclusions and Future Work  
We need to have the technology layers that satisfy the requirements of an IoT application that handles cloud-based services. Thus, we can effectively simulate the scalability of an IoT system. Compared to other IoT simulators, we provide an architecture that flexibly \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{\begin{tabular}{c} **Number of** \\ **Threads** \\ \end{tabular} } & \multirow{2}{*}{\
\begin{tabular}{c} **Ramp-Up** \\ **Period** \\ \end{tabular} } & \multirow{2}{*}{
\begin{tabular}{c} **Average** \\ **Throughput** \\ \end{tabular} } & \multicolumn{3}{c}{**Response Time**} & \multirow{2}{*}{**Error (\%)**} \\ \cline{5-6}  & & & **Average** & & **Minimum** & **Maximum** \\ \hline
1500 & 60 & 7.8/s & 71,207 & 8050 & 130,141 & 0.00\% \\
2000 & 60 & 7.8/s & 102,529 & 6313 & 203,920 & 0.00\% \\
2000 & 120 & 7.9/s & 72,774 & 4214 & 136,719 & 0.00\% \\
2000 & 180 & 7.9/s & 41,169 & 2376 & 79,713 & 0.00\% \\
2500 & 180 & 7.9/s & 72,628 & 3907 & 136,963 & 0.00\% \\
10,000 & 3600 & 2.7/s & 1119 & 1089 & 4218 & 0.00\% \\ \hline \hline \end{tabular}
\end{table} 
Table 16: Apache JMeter metrics of the reservation service. Figure 29: Throughput and response time of the reservation service behavior for 3 min. covers the technologies layers for modeling and simulating applications with cloud-based services: WSAN modeling of IoT, the cloud layer, and the application layer. Our approach takes advantage of the technologies around cloud computing such as Kubernetes and Docker containers to achieve a more realistic simulation environment promoting the use of open source technologies. To our knowledge, IoT simulators have an underdeveloped cloud computing layer for the requirements of IoT applications. In this article, the Ptolemy II simulation tool allowed to simulate the IoT application using the hierarchical modeling capacity of actors with certain computational models (MoC). The most important components used by Ptolemy are the MQTT-Accessors. Through the MQTT-Accessors, the Gateways of the IoT facilities based on WSANs were simulated emitting or receiving data from outside. MQTT-Accessors are components that make communication with the message broker in the cloud platform more flexible. A message broker (eMQTT) was the essential intermediary for data exchange and supporting the scalability of the IoT application. This message broker can also be used as an intermediary for other simulations of IoT applications with other scenarios, allowing the simulation of heterogeneous IoT scenarios  
Another interesting feature of our design was modeling the behavior of service requests to the IoT system by end-users. Thus, we took into account the behavior of the user in the system by modeling a user layer. Thus, in the case use of the cloud-based IoT reactive parking lot system model, an M/M/c/N queuing system was implemented. Furthermore, the Ptolemy simulator helped design WSANs in a modular and hierarchical way and helped extend the model to simulate the growth and expansion of various WSANs in large areas, such as a set of city parks. The simulation of the scalability of the IoT application was carried out with the replication of components, which helped to analyze the sizing of the system. Additionally, we could affirm that by using the simulation with a distribution of replicas of the IoT Application on several computers it is possible to accelerate the global simulation of an IoT application. Although Ptolemy facilitates hierarchical modeling and the replication of components and models, one of the limitations of our work is the inability to provide complete documentation regarding all the assumptions made about how the components were built and used. Moreover, through cloud computing technologies, we could quickly have a minimal infrastructure to perform more realistic tests with IoT systems that have services in the cloud platform.