# DARAL: A Dynamic and Adaptive Routing Algorithm for Wireless Sensor Networks
## 1 Introduction  
Smart City is a concept that is rising in the last years. It is not only an academic topic, but also a trending topic for political and public organizations. Its relevance is pushing research groups around the world to analyse and study how to develop and to connect it with citizenship. Recent projects and studies show the relevance of this topic [1; 2; 3], dealing with how to instantiate it. Technology is moving forward very quickly and what some years ago was expensive and unsustainable is feasible today. Thus, embedded electronics are a very interesting option today for the development of a Smart City infrastructure. It presents different possibilities like 8-, 16-, 32- or 64-bit architectures, low-power systems, cable- or wireless-communications, etc. It is possible to build up a specific system with relative ease and a contained cost. Some examples are systems like Raspberry Pi Zero [4] or Arduino [5]. With the expansion of affordable embedded systems such as the cited ones, another necessity as to the communication appears. As long as the systems are small in size, these communications need to be wireless, also allowing the ability to reach places difficult to access and expand the available applications. Technology is already capable of supporting projects like Smart City, but there are still other issues to be solved such as the number of nodes a Smart City needs. Well, that is an uncertain question; it depends on the service offer and the government. However, considering large-size scenarios such as Smart Cities or Internet of Things, there is always a common actor, the infrastructure, which is usually based on a combination of fixed and mobile devices. The infrastructure must provide the supportfor many other services, spreading out the devices as much as possible in order to completely cover a certain scenario. A good approach to answer the question previously formulated, is the work of [PERSON] et al. [1] or even the work of [PERSON] et al. [6], where they presented precise data about the ideal Smart City node distribution. Using the data published in these works as reference, the conclusion is that the total number of nodes of each particular scenario depends on its size, and thus the node density appears as a fundamental parameter in Smart City deployments. The node density of a large infrastructure like a Smart City can be defined as medium or low, depending on the available services in the scenario. The definition of _node density_ can be found in the work of [PERSON] et al. [7], which defines the high, medium and low density as 15, 10 and 5, respectively. The wireless communication field is wide but there are some well-known standards that regulate it and mark the development. Some of these standards are the ones from the Institute of Electrical and Electronics Engineers (IEEE) _IEEE 802.11_[8], _IEEE 802.15.1_[9], _IEEE 802.15.3_[10] and _IEEE 802.15.4_[11]. These technologies are a major area of research, mainly _IEEE 802.11_ and _IEEE 802.15.1_, but considering the scenario and topic of this work, _IEEE 802.15.4_ is the most suitable standard because it is oriented towards wireless sensor networks (WSN) and low-rate communications. This standard is well-known in industrial sectors or areas like home automation, so it is also logical to extend its application to the Smart City. As _IEEE 802.15.4_ regulates only the access to the medium by definition of the physical (PHY) and medium access (MAC) layers, there exist different routing algorithms, due to the lack of an advanced routing method in the standard. Star and peer-to-peer topologies are standard-defined but cluster-tree and mesh (also defined by _IEEE 802.15.5_[12]) are extended by algorithms in upper layers. These routing algorithms are needed for complex scenarios, and indeed the Smart Cities are one of the most complex possible scenarios. Moreover, other features more than topology are required, and routing algorithms are fully qualified to provide them.