**5. Experimentation**

The sample case is carried out within the context of the "Cloud Computing and Network Service Management" subject, which belongs to the MSc degree in Computer Science Engineering. This degree is composed of a set of mandatory and optional subjects, some of them having 6 ECTS credits and others 4 ECTS credits. The subject considered in this work is mandatory, consists of 4 ECTS credits and is studied in the first semester of the first academic year. The degree is taught at the Computer Science Engineering School of the public Spanish University for Distance Education (*in Spanish, Universidad Nacional de Educación a Distancia*, UNED). The learning/teaching methodology is totally on distance, since Master degrees at UNED do not consist of face-to-face classes.

The subject focuses on specific competencies and skills in developing cloud computing solutions [58]. Students are provided with a guided example on the use of these technologies over a complete IoT solution. Three different and interconnected practical activities have to be solved by the students of this subject. The cybersecurity practice was not used, as it was out of the subject syllabus:


This solution is especially important for distance educational environments, which should satisfy the following requirements:


The following sections describe each one of the practices implemented.

#### *5.1. Practice 1: Simple Application in a Cloud Service Provider*

As it was mentioned earlier, the use of IoT devices is required in the second assessment. In this case, the specific skills to be learned focus on the first layer of the development of IoT solutions, this is, the sensors/devices/protocols layer. In this practice, students have to deal with three of the essential characteristics: edge programming, fog programming and protocol communication. A specific setup is integrated into the LoT@UNED infrastructure for providing students with remote access to this working layer (IoT devices). This setup is replicated, and it consists of a Raspberry Pi device and its corresponding sensors. These setups are connected to the LoT@UNED infrastructure, so they are available to the students by using the service portal. Each IoT device is able to record video and capture photos, as well as measure temperature, humidity and pressure. It also captures values associated with motion/location sensors (gyroscope, accelerometer and magnetometer), and it includes a GPS module in anticipation of future mobile scenarios.

The physical implementation of this setup is carried out with a Raspberry Pi 3, as the basis of the device/microcontroller component. This device, by default, does not have any specific sensor/actuator, but many of them can be connected to develop different projects. In this specific case, a set of additional elements has been incorporated to generate an environment with a set of sensors. These elements are:


**Figure 8.** Example of individual Raspberry Pi device.

Students can access the Shell console to interact with the sensors by developing code in Python. This code is used to ge<sup>t</sup> sensor values (temperature, pressure, humidity, accelerometer data and GPS data). They can also write values directly on the LED array, so a word or phrase can be displayed in the array. The setup provides a video stream that can be programmed using python code (starting and stopping the video stream). To implement this activity, the related practice is designed using the corresponding runtime service "IoT". This service is defined as one of the three runtime services available, as it was mentioned earlier.

The service is configured to connect with a Cloud IoT Service Platform (IBM Watson IoT). This way, the setup's environment provides the MQTT library (owned by IBM and deployed on the setup) for programming and implementing the MQTT services (messages, topics and so on). These services must be deployed via Python code and consumed by an external application, which has to be developed by students (similar to the application shown in Figure 9).

**Figure 9.** Game of words. IoT devices with sense hat.

Node-RED [59] is used to program this application. This framework is a visual development tool for programming IoT environments. As the setup uses MQTT, students have to use connectivity blocks for sending and receiving MQTT messages or topics. On the one hand, this tool allows the subscription to one or several topics of the MQTT message system (coming from one device, or several ones); such as the data from the sensors, current sessions or stops and messages between them. On the other hand, a topic (message or event) to the MQTT message system for session managemen<sup>t</sup> can be published.

#### *5.2. Practice 2: Connecting IoT Devices to IoT Cloud Services and Platform from a Cloud Provider*

After developing the "local" solution, corresponding to the sensors/devices/protocols layer, students must learn and know the operation and services of an IoT platform in the cloud. In this case, it is specifically intended that they learn how to store data from the sensors they are using in the local solution. Since MQTT is used as a communication protocol, any cloud service platform that supports this protocol can be used in this part of the learning scenario (layer 2 of the IoT's full development model). The platform used by the students for their practices is IBM Watson IoT because the LoT@UNED infrastructure itself is based on this platform.

The main objective of this activity is to become familiar with the use of a series of services offered by IBM Watson IoT, focusing on the storing of sensor data and device management. IBM Watson IoT has a managemen<sup>t</sup> space for device types and registered devices. Again, to understand the services provided by the Cloud IoT Platform, a student must use a specific activity defined in LoT@UNED. This practice is based in the "IoT" runtime service and its goal is to connect with the managemen<sup>t</sup> space (using MQTT protocol) and check the services for this Cloud IoT Platform. The full documentation and services description is available in [60].

Additionally, to provide a cloud storage service, students must develop a single cloud application, which uses the Cloudant [61] service to store the sensor 's data. This application uses Node-red framework to facilitate the integration with the MQTT protocol and ge<sup>t</sup> the data from the device (assigned using LoT@UNED infrastructure). The Node-red distribution, included as a service in the IBM Cloud platform, has specific blocks to connect with Cloudant services to simplify the storing of information (see Figure 10). This data will be used in the next step of the learning scenario for the Layer 3 of our sample case.

In short, the practice focuses on the aspects related to the specific communication protocols of IoT and the integration with external suppliers. In addition, students experiment with the security mechanisms of these protocols and the applications/services that use them. For the essential characteristics, students work on: protocol experimentation and cybersecurity.

**Figure 10.** Cloudant integration in a Node-Red application.

#### *5.3. Practice 3: Development of Dashboards and Data Analytics*

In previous sections, the theoretical aspects of dashboards and assisted decision layer learning were given and, also, how this layer is linked with the LoT@UNED platform. Now, we detail a concrete example of an application for this layer.

The presentation and decision layer provides human-readable information to see what is the status of the IoT solution (specifically, status and information data from sensors). Sensors produce valuable information from the environment in which they are integrated. This information allows the generation of indicators to monitor different types of environments where sensorization can be critical. For example, in the case of medical environments, biomedical sensors allow information to be collected and displayed on dashboards to monitor patients [62,63]. The importance of the development of these dashboards depends on the information monitored, but usually, at least, a dashboard is developed to have monitoring information of the IoT environment. As previously seen, the information from the environment is stored in a data storage service that is usually in the cloud. This information can be represented in real-time, by dashboards, or analyzed to calculate performance indicators. These indicators can be used in decision-making and risks evaluation [46]. Therefore, these decisions are assisted by IoT data.

In this particular practice, the student will work on the development of a dashboard that uses the analytical capacity of the cloud providers and will represent the relevant information from the IoT data. This way, students will work on the essential characteristics corresponding to cloud dashboard and analytics programming. The dashboard must show real-time information about temperature, humidity and pressure (provided by the Sense Hat sensors). In addition, other indicators can be shown dynamically, such as time, the accelerometer values (X, Y and Z coordinates), pitch, yaw and roll. Figure 11 shows an example of a single dashboard built with basic gauges. This example is a basic template provided to students, which has to be modified and enriched following basic visualization techniques.

**Figure 11.** Single dashboard for sensor data.

Once the student has proven to be able to solve IoT data representation problems, they have to add the decision element in the production line related to an IoT solution. These decisions must be based on using stored data from sensors, and they will vary depending on the environment in which the solution is integrated [64]. The use of instantaneous data is not enough, so it is necessary to verify the evolution of the data and calculate performance indicators (usually statistical indicators). The cloud IoT service platform stores the data (layer 2 in our model), so the indicators can be analyzed and graphically represented. Data being in the cloud allows for its use in different service providers that have data analysis tools and in many cases, given the nature of the IoT data production ratio, Big Data techniques must be applied.

On the other hand, by using the Apache Spark analytics service, students have to analyze the stored data. Another service named IBM Watson Studio is used jointly with the Apache Spark Engine to facilitate the use of the analytics service. These services allow for the creation of notebooks in a variety of programming languages (among others, Python or Scala) for interactive work with the aforementioned services. Students must use one of the following sensed parameters as a basis of the analysis: temperature, humidity, or pressure. Additionally, some filter tasks are necessary for data. Some examples are changing the sensed time from string to DateTime, grouping values, filling empty values, transforming data to make specific accesses or truncating values. This way, students learn how to manage the generated data in the cloud and prepare them for the data analysis itself.
