# Communication Manager for Hyper-Connected RPAS Environments
## 3 Communication Infrastructure Manager: Design and Deployment
### Software-Defined Networks
#### 3.4.3 Network Monitoring Application  
As explained in Section 2, SDN technologies such as OpenFlow have not been designed with the special considerations/characteristics of multi-RPA environments in mind. For example, SDN switches (Section 3.4.1) react to different events in a wired network. When one of these events occurs, the corresponding switch reports the SDN controller (using the OpenFlow protocol) which, with this information and those of the other switches in the network, can make the appropriate decisions. However, these events do not operate correctly in decentralized wireless networks, such as the ad hoc Wi-Fi networks we often find in multi-RPA environments. For example, due to the nature of ad hoc wireless networks, it is impossible to determine when a network participant is reachable or not [28], except with an external application such as the one we need to implement.  
To solve this problem, we have implemented a network monitoring application that collects different metrics not only about the network status but also from the status of the device that hosts the switch. This information is periodically sent to the controller, whether there are changes or not. With this information, the SDN controller acquires real-time knowledge about what is ensuing in the network. In this case, each network participant (RPAs and RPS) has a built-in Python script that collects the different metrics. Since the network monitoring application is custom-built in Python, it can collect many metrics (as many as programmed). Some examples are the available bandwidth, the jitter, or the resilience. For this study, we consider the following metrics:  
* Connectivity [Boolean]: the connectivity metric indicates whether connectivity exists between two network participants (for all the available interfaces).
* Round Trip Time [ms]: this metric indicates the current Round Trip Time (RTT) value between two hosts (for all the available interfaces). This measurement is performed using the Linux _ping_ tool.
* RX/TX Traffic [bit/s]: this metric indicates the number of received and transmitted bits on each available network interface (e.g., Wi-Fi, 5G, 4G/LTE).
* Power consumption [W]: this metric indicates the current power consumption of each host. This measurement is performed using the UM34C USB multimeter.  
It should be noted that the connectivity metric not only refers to neighbouring nodes, i.e., single-hop communication, but also considers multi-hop communication.  
This information from the network monitoring application applies not only to the SDN controller (to make the appropriate forwarding decisions at any given moment), it is also of particular interest to other actors, such as RPS operators, who can observe in real-time what is happening in the network. On the other hand, this information is stored in a database for two primary purposes: (i) to perform an exhaustive ex-post analysis if something has not worked as expected, and (ii) as a communication flight recorder system (also known as black box) in the case of an accident or emergency.  
The network monitoring application has been released as open-source [29]. The scripts have been developed for Ubuntu 18.04 LTS but can be easily adapted to any operating system. The data are transmitted in JSON format to incorporate custom metrics efficiently.