## 6 Design of an Intelligent Middleware Platform
### SDN and Machine Learning-Based Multi-Network Management Layer  
A multi-network infrastructure generates a vast amount of network data. The management of a multi-network infrastructure and the utilization of network data to maximize system performance are challenging tasks [55]. Existing network-level protocols are not designed for a heterogeneous multi-network infrastructure that integrates ad hoc and infrastructure-based network technologies. Therefore, they do not efficiently utilize heterogeneous routes, simultaneous transmission on multiple communication technologies, and several network-level parameters, such as link quality, link lifetime, and transmission energy consumption. Recently, several machine learning-based protocols were proposed to address network management and routing problems. However, these protocols are designed for either infrastructure-based or ad hoc networks. Thus, they use conventional attributes, such as throughput, and are unable to utilize a vast amount of data generated by a complex heterogeneous multi-network infrastructure. A new SDN and machine learning-based multi-network management layer aim to use the capabilities of machine learning and SDN to enable adaptive, efficient, and reliable communication among devices interconnected via multiple heterogeneous mobile ad hoc and infrastructure-based LANs. This layer comprises eight services. _Data Transfer Service:_ This service aims to enable efficient and reliable transmission of data across multiple heterogeneous networks. It provides a simple and unified interface to network layer services and can interface with multiple communication technologies, such as Wi-Fi and Bluetooth Low Energy (BLE), via technology-specific protocols. The functions of this service include the following: (1) packing and unpacking of data, (2) transmission of data on a route selected by a routing service or simultaneous transmission of data on multiple routes via multiple communication technologies, and (3) communication with multiple technologies to transmit and receive data. _Multi-Network Discovery and Monitoring Service:_ This service aims to discover and monitor information about multi-network infrastructure. The collected information is stored in a semantically enriched data store. Information, such as throughput, delay, energy consumption, and packet loss rate, stored in the semantically enriched data store can be used to train machine learning models [56; 57] that predict device and task failures, identify reliable nodes, and optimize network and application performance. Figure 5: Container-based physical device. _Mobility Management Service:_ This service is responsible for maintaining mobility information and using Markov chain-based models to predict the next probable location and time that a device spends at the location. This information can be used to predict link failures and a device reliability index. The design and implementation of the Markov chain-based location prediction mechanism were discussed in [2]. _Multi-Network Routing Table:_ A routing table is responsible for storing available routes and characteristics, such as lifetime, energy consumption rate, and available throughput of each route. Raw and historical data are stored in the semantically enriched data store. The routing table proposed in [61] can be extended to support a multi-network environment. _Multi-Network Aware Machine Learning-Based Virtualized Routing Service:_ This service is responsible for selecting a route or set of routes based on an application's quality of service (QoS) requirements. It includes the following services. _New traffic estimation service:_ The prediction of traffic volume is important in congestion control, resource allocation, and routing [60]. However, measuring traffic volume by using conventional methods is expensive and communication-intensive. This service is responsible for using a new machine learning model to measure network traffic volume.