# LPWAN-Based Vehicular Monitoring Platform with a Generic IP Network Interface
## 4 Architecture of the Proposal  
In this Section, the details of the architecture for remote monitoring in the field of road vehicles is presented. This architecture, briefly introduced in Figure 1, and now detailed in Figure 4, comprises an LPWAN-enabled access network in which end-nodes (i.e., the vehicles) directly communicate with a communication gateway, by means of long-range links established by an LPWAN technology. This communication is abstracted to applications, thanks to a new network interface that appears to the user as a regular UNIX one. As depicted in Figure 4, this new interface acts as an LPWAN tunnel that transports UDP/IPv6 datagrams, which finally reach an application gateway after passing through the wireless LPWAN medium. The network server deals with MAC-level LPWAN packets, while the application gateway is in charge of interconnecting with IPv6 Internet and forwards the packets to a processing node in the cloud, which provides processed information to final services, or in a dashboard fashion. As can be seen in the diagram, the interconnection with IPv6 Internet is possible thanks to the use of SCHC, which adapts packets to traverse the constrained LPWAN network domain. Although there is a direct application of the architecture in the regular car domain, it is important to emphasize the potential of the system presented to monitor new-age personal mobility vehicles, given the advantages of the synergy between embedded hardware platforms and LPWAN communications. For these vehicles, an embedded hardware platform can benefit from the solution, providing monitoring capabilities at low energy cost. Given that a great part of energy consumption in mobile devices is from the communication module, the usage of LPWAN technologies bring power savings within a new mobile IoT domain. A detailed description of the generic UNIX interface embedded in the solution is given in Figure 5. It is assumed that the on-board computer is provided with a UNIX-based operating system, and it is attached with the LPWAN modem within the same enclosure or a different one. In the diagram, LoRaWAN is showed, as it is the LPWAN technology used in the proof of concept. Figure 4: Overall system architecture. Figure 5: Design of the network interface solution for LPWAN. The data flow starts in the OBU application, which collects data and sends them to the remote server through the internet, using the LPWAN link as a wireless last-mile network access. The data collected (or the information to be transmitted) is packed and sent using a common UNIX socket, programmed in our OBU. This is possible thanks to a new tunnel (TUN) interface, which captures the packets and adapts them to be transmitted through the LPWAN network. Our middleware compresses and fragments data using SCHC, following a context previously agreed, as explained above. Then the adapted packet, or a set of fragments, are passed to the modem for their transmission. The design showed in Figure 5 includes a set of interfaces between the main software modules, which are detailed next:  
* Socket Interface: Allows the creation of transport-level packets and their transmission through the communication stack. * Routing Interface (RI): Applies layer-three rules to the packets received by the interface, such as filtering and routing to enter the tunnel interface. * Packet interface (PA): Moves packets to be transmitted to the SCHC compression and framing module. * Modem Interface (MI): Takes care of modem configuration commands and sends/receives the SCHC packets. * Controller Interface (CI): Forwards LPWAN packets and modem configuration commands to the PHY radio unit. * Radio interface (RA): Sends information through the radio medium using LPWAN modulation and coding. UDP is chosen as the transport protocol for the Socket Interface, given the communication constraints imposed by LPWAN technologies, which make it impractical to consider connection-oriented protocols, such as TCP.