## 1 Introduction
In recent years, different technologies around modern cloud computing infrastructures have evolved allowing one to streamline development and operations tasks (Google Cloud Platform, Kubernetes (K8s), and Docker containers). These technologies allow a flexible development and integration process of the system components and facilitate monitoring and scalability [7]. Additionally, IoT software services can be modeled using microservices design patterns. Thus, it is possible to have simulation tests in a more realistic way using a cloud computing infrastructure and leaving aside the cloud computing simulation tools. Additionally, some of the concerns related to distributed application modeling can be addressed through the use of the principles of reactive manifesto. These principles can be applied to achieve reactive applications that use observable models, event streams, and stateful clients [8]. This article proposes an approach for the modeling and simulation of IoT systems and services in smart cities leveraged on a simulator of WSANs and technologies of cloud computing. The main objective is to facilitate the modeling of IoT systems for the design and experimental verification before the actual construction of this type of system. Focused on the use of microservices, we provide an approach that helps to model and simulate IoT reactive web services (using Finite State Machine (FSM) and other patterns) with the elements for real-time data collection, transfer, and storage based on the idea of using reactive components. Our approach was verified through experiments with two use cases. The first use case was the construction of a WSAN model of an IoT system for the monitoring and control of a city park. This WSAN was used to simulate the data collection of certain physical variables. This model was extended by replication using [PERSON]'s hierarchical modeling capacity to model an IoT application for the control and monitoring of multiple parks in a city. Through this use case, we analyze the hierarchical modeling and scalability of the system whose sensors constantly emit data. This first verification of our approach was carried out with all the components of the system model locally [9]. Thus, we show the basic use of our approach when modeling a simple IoT application that does not require interactions with microservices in the cloud platform. The second use case is related to the scenario of the parking reservation service of a city. We build a model of a cloud-based IoT reactive parking lot system. Additionally, the service request of the system users was simulated using an M/M/c/N queuing system. The data simulations were based on certain values generated through probability distribution variables. Additionally, our approach has considered the design-time verification of some aspects, such as the sensor network's dimensioning, the delimitation of web services, and components' performance. Contribution. Our study makes the following contributions. 1. Model of a wireless sensor network as part of a simple IoT application to monitor and control constantly the parks of a city. 2. Model of a wireless sensor network as part of an IoT application that provides service to users with an M/M/c/N queuing system. 3. Model of infrastructure for the support of reactive web services in the cloud platform to simulate IoT applications. We show the potential use of our approach for the replication of simulation models (parameterizable and modifiable) for the scalability of simulation models. Additionally, the models help us evaluate the resizing and performance of IoT systems. The characteristics of our approach are valuable in the preliminary design and the construction of prototypes of applications of IoT in a smart city. Organization. The remainder of this article is organized as follows. Section 2 discusses related works. Our modeling and simulation architecture to support the proposed approach is described in Section 3.