# A TDMA-Based Access Protocol for Dense Networks with Moving Nodes for IoT Applications
## 4 Simulation Results
Moving one step forward, we test our protocol with another variation of the work in [6] that executes a second GPS measurement as our algorithm does. This diminishes the possibility of a lost packet. The results of this aforementioned protocol are denoted as TDMA-2M. If the second GPS measurement is outside the initial SF ring and migrated to a higher SF, then the ED does not initiate the transmission as it would result in lost packet. Nevertheless, under TDMA-2M implementation the node is able to send its packet by reserving the appropriate time slot according to its id using the higher SF as determined from the second GPS measurement. In order to have an estimation about the mean data latency, we consider the following terms:  
1. \(N\) corresponds to the number of EDs considered in each network scenario. 2. \(L\) corresponds to network load and varies from 10% to 100%. For example, a value of load at 50% indicates that for this cycle, half of the nodes will have data to transmit and a 100% loads means that in this cycle all the EDs will request a slot for transmission. 3. \(aToA\) (average time on air) stands for the average time (in ms) that takes for all the signals before the receiver receives them. This is a statistical factor extrapolated from the averaging between the 6 different ToA derived from the 6 SFs. 4. \(ALM\) (Average LoRa message) is the time needed (in ms) for all the nodes to transmit their messages averaged by the load. This factor refers to the average time needed by the EDs to complete a simulation cycle and is directly related to the load and the number of EDS along with the average ToA. In case of a stationary system, the average delay would be calculated from the following relation as there are 4 basic components: (a) the LoRa message from SN to the CH, (b) the WuR message from CH to the EDs, (c) the broadcast messages from the EDs to inform about their data availability, and finally (d) the actual LoRa message from the EDs to the SN:  
\[Average\ Delay=ToA_{SN->CH}+WuB_{CH->ED} \tag{2}\]  
\[+N\times WuB_{ED->CH}+ALM\]  
\[ALM=N\times Load\times aToA \tag{3}\]  
For moving nodes, the term aToA (average Time on Air) changes as the EDs move inside the simulation area and change the SF based on the time it has elapsed from the first phase of the algorithm. While this is a continuous-time random walk and may require the probability functions for the number of jumps and the position, the averaging rationale simplifies the following formulation. We consider that for the total time of running \(m\) EDs will change SF zone, which is directly based on the total number of EDs. A system with a small number of EDs means that there will not be enough time for the EDs to move and change SF zone. On the other hand, a system with a higher number of EDs means that numerous nodes will have ample time to move and change their SF zone as they will have to wait for a larger number of EDs to complete their transmission prior to their own time slot. Without the accuracy of the aforementioned stochastic processes, as the process is random, from the \(m\) nodes that will have changed their SF, (\(m\) is a small percentage of all the nodes that will have changed their SF at the end of the simulation) half of them will have moved to a higher SF and the others to the lower SF. Those who will change their SF zone to a higher one will increase the aToA by that percentage while the others will keep their initial SF. As a result, the relation (3) will read:  
\[ \begin{split} ALM=(N-m/2)\times Load\times aToA\\ +m/2\times Load\times(aToA+[\text{SF}])\end{split}  \tag{4}\]The term \([\text{SF}]\) is obtained using the Equation (5), while the terms \(N7\), \(N8\),... and \(N12\) corresponds to the number of nodes that have moved from one SF (SF) to a higher one (SF + 1) (i.e., \(N7\) refers to all the nodes that have moved from SF7 to SF8).