# Architecting Software for the Internet of Thing Based Systems
## 2 Background and Related Work
### Software Architecture for the Internet of Things  
The term 'Internet of Things', which is sometimes also referred to as 'Web of Things', has diverse applications that range from personalized health monitoring, automated home services, to operationalizing large-scale manufacturing [1; 7]. IoT as a concept lacks a unified interpretation and its definition also remains fuzzy due to the diverse applications of the IoT systems. IEEE's initiative towards a definition of the IoTs aims to consolidate a generic definition, architecture and infrastructure to better conceptualize the term and its applications [7; 8] A generic IoT architecture represents a layered structure as per the IEEE standards and available reference architectures in [10]. The layered structure includes at-least a (i) sensing layer, (ii) networking and data communication layer, and (ii) applications layer, as contextualized in Figure 2. Specifically, in Figure 2, we have provided a high-level structural overview of the IoTs (left-hand view), along with its corresponding software architecture (right-hand view). The layered structure for the IoT in Figure 2 highlights that interconnected things, such as a home service robot, a vehicle, and home-based devices are interconnected at the middle layer, which is referred to as interconnection and logic layer. This layer is responsible for managing and operationalizing the interconnection and the desired logic, which helps the things to coordinate and execute over the internet. The layer above the interconnection and logic layer is computation and data storage layer, which manages the computation/analytics and data storage (at a central location) for all of the interconnected things.  
The bottom most layer corresponds to the user interfacing layer, which allows the role of user(s) in the system in terms of supervision, and human decision support to monitor or manipulate the interconnected things in the IoTs. In Figure 2, we have presented the software architecture--corresponding to the layered structure for IoTs--that comprises of layers of architectural components and their interconnections [12]. For example, in Figure 2, at the user interfacing layer, the **setMode** architectural component allows for a user to set the mode of a home service robot as idle. The **setMode** component communicates the user's selected mode to **getStatus** component at the interconnection and logic layer. Finally, the **comState** component communicates the current state of the robot (an individual thing in the IoT) to **persistState** on the computation and logic layer, so that the current state of the home service robot can be persisted and communicated to all other things that are connected to it. The three-layered architecture pattern helps us to layer the system to support separation of concerns and to modularize different architectural components at different layers of system/architectural abstraction [9; 12].  
In the context of Figure 2, we conclude that, by exploiting the architectural model, complexities of implementation and configuration of the IoT systems can be minimized by means of layering. Moreover, the things and their interconnections in IoTs can be mapped to architectural components and connectors to effectively specify, develop, deploy, and maintain IoT systems [9]. Based on the architectural model, model driven engineering and development can be exploited for the automated generation of the source code (code modules and their interactions) from the corresponding architecture (based on architectural component and their connectors) [10; 12]. We aim to investigate the role of software architecture in the engineering, development, operations, and management of the IoT systems in this mapping study.