# A TDMA-Based Access Protocol for Dense Networks with Moving Nodes for IoT Applications
## 3 Algorithm Description
### Operation of the Proposed Algorithm
The logic behind this principle is to mitigate the possibility of a lost packet as mentioned above. Same as previously mentioned, phase two acts as a time scheduler with insurance being able to schedule all transmissions and in advance to reserve slots for all the nodes that would have change their position to a higher SF zone until the time of the actual transmission. The sequence diagram of Figure 2 represents in detail the operation of the MOTILO algorithm. Latency-prone though it may seem, the proposed algorithm manages to overcome the latencies that may arise from the slot reservation, as from phase one it eliminates the empty slots and this counteracts for the additional reserved slots in phase two. Being also a point of segregation from the modified version of [6], MOTILO eliminates the collisions and for the majority of the moving patterns based on life-like scenarios, it can keep the lost packets in minimum levels. Taking into consideration the range of a LoRa transmission of a given SF, being roughly 2 km, it is not prohibited to transmit with a higher SF for shorter than its maximum theoretical range distances. On the other hand, transmissions with lower SF are not recommended for higher distances due to free space/structural attenuation. Taking all the above into consideration, each ED builds the global transmission schedule and for every reserved slot from the first phase, it reserves another one for every node, in the SF + 1 schedule (line 15). That way, in case a node has sent its schedule for a specific SF and before the scheduled transmission time it has migrated to a higher SF zone, it can still utilize the higher SF with minimum possibility of a packet loss. If the node migrates to a lower SF zone, it can still utilize the higher SF as the lower SF time slot generally will not be available due to its shorter duration. We opted for this option in order to eliminate complicated queue mechanisms, being a protocol for IoT applications with mobile nodes without any exceptions due to energy or processing power limitations. Yet, additional round-trip latency may occur in the system when some of the pre-reserved time slots in higher SF zones are left unused in cases where some EDs have moved to lower SF zones (closer to the sink) or remained at the same position, and as a consequence they have to transmit their data using their lower SF's time slot assignment. Phase two is the actual transmission of the packets from every node. Utilizing the GPS module, MOTILO does not rely on predefined ED positions as in [6]. Instead, it initializes one GPS measurement upon the reception of the WuR message and builds the transmission map. We referred to the map as the GPS measurement practically places every node inside the system's topology. With this measurement, at the end of the phase one, every node is aware of its transmission slot. The second GPS measurement is fired just before the aforementioned slot. Therefore, if the ED has not changed SF zone, it will use the initial SF as reported. Otherwise, if the ED has migrated to a lower SF zone and the time of the initial SF slot has passed, the ED can utilize the higher SF that has been reserved by the algorithm. In case of a higher SF zone migration, the ED will make use of the reserved SF. Given the fact that the MOTILO is based on the work of [6], we should recall the main differences between these two protocols. Primarily, [PERSON]'s work considers stationary nodes while MOTILO is based on moving nodes either aerial or terrestrial. Secondly, MOTILO utilizes a LoRa based GPS device in addition to the WuR transceiver that it has been used in [6]. Apart from the previous systemic differences, MOTILO eliminates empty transmission slots that are present in the basic work. In order to provide grounds for a proper validation and comparison of the proposed work, we opted to amend the work of [6] with the same rules as MOTILO and for an even equitable comparison we end up with a second version of the [6] offering the second GPS measurement that MOTILO uses.