# Multilayered Network Model for Mobile Network Infrastructure Disruption
## 4 Routing in MNM
### Routing in MANET Layer  
Routing in MANET layer of MNM is independent of routing in WSN layer when a local entity such as AP is available to all devices. When communication with AP is disrupted, sensors of WSN layer are unable to deliver its measured data to cloud services. Sensors, therefore, start to evaluate their data and produces only urgent data. Only those data are allowed to enter the MANET layer in order to enhance the delivery process. We assume that WSN gateway sensor is capable of using dual protocol stack with IEEE 802.11 WiFi connectivity. This allows the WSN gateway sensor to be seen by MANET nodes and vice versa. WSN gateway sensor is therefore allowed to send urgent data to any available MANET node.  
Since WSN layer in MNM uses IPv6 protocol, it should be implemented in MANET layer as well. The routing protocol for MANET layer in MNM should be proactive, since topology maintained by proactive routing protocols is required for DRONET clustering algorithm. The example of MANET IPv6 protocols are IPv6 enabled DSR [33], AODV6 [34] or IPv6 OLSR [35]. Those routing protocols, however, do not support interference avoidance such as AR-CRM mentioned in Section 3.3.1. On the other hand, AR-CRM was not designed to support IPv6. This problem needs to be addressed by implementing interference avoidance mechanism of AR-CRM into mentioned routing protocols or implementing IPv6 into AR-CRM. It is also important to collect GPS positions since that information about topology could be used by DRONET layer to perform its clustering analyses. None of this is the scope of this paper and we assume that missing functionalities mentioned above are implemented.  
Regardless of the selected routing protocol, the exception mechanism for urgent data delivery needs to be implemented to deployed routing protocol in order to work in MNM. The implemented exception helps main routing algorithm to recognize urgent data from WSN and provide necessary operations. This mechanism is described by flowchart depicted in Figure 10.  
In the beginning, the MANET node that obtained urgent data needs to encapsulate IPv6 packet from WSN layer to recognize if obtained data are indeed urgent. If not, obtained data is recognized as not urgent and MANET node drops this data. If the obtained data are urgent, MANET node tries to access AP. If AP is available in the MANET network, data are sent to AP. If not, the MANET node is looking for MANET gateway.  
If the MANET gateway is not recognized or is not available, the Data Backup algorithm described in Section 4.1 is called. If coming status from the Data Backup is Continue, algorithm check again for MANET gateway availability. If the status is Fail, the node drops the data. Otherwise, the status is Successful and it means the data was successfully delivered to AP and exception algorithm ends.  
If MANET gateway node is available, urgent data is delivered to it. MANET gateway than check for UAV availability. If UAV is available, data are sent to DRONET layer and exception algorithm ends. If UAV is not available, gateway node calls Data Backup algorithm that stores data or tries to deliver it to AP. The urgent data are then dropped or the exception algorithm checks for UAV availability again according to the status obtained from Data Backup algorithm.