## 4 Improved Adaptive Backoff Algorithm (I-ABA)
### Markov-Based Mathematical Model for I-ABA
However, it is essential to highlight a relatively high CV(RMSD) value of around 16% for the channel collision time parameter between the simulation results and the MATLAB results. The discrepancy between the theoretical and simulation models for this metric can be explained by the fact that the theoretical value is calculated as C = \(1-\mathrm{U}-\mathrm{T}\), where the error is the sum of errors of U and T.  
The implementations for the Java-based simulator, C-based simulator, and MATLAB are made available at GitLab (see [25; 26; 27]). The simulation settings and parameters are specified in Figure 5:9 The simulation setup is described next. We utilized custom-developed tools based on Java and C to evaluate the performance of the network. The Java-based tool was used for the initial development and debugging of the algorithm. The standard JDK with additional networking and data handling libraries have been used. The C-based tool was used to run extensive simulations and gather performance metrics (C was selected due to it being optimized for performance). The GNU Compiler Collection (GCC) and POSIX libraries were used for low-level network simulations and timing functions. Furthermore, Python was used for curve-fitting to derive the mathematical expression that relates the optimal contention window to the network size. The simulations were run on Linux and Windows to ensure platform independence and robustness. Each simulation was run extensively (at least 100 runs). Performance \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Performance Metric** & **J\_Sim/C\_Sim** & **J\_Sim Theoretical** & **C\_Sim Theoretical** & **Average** \\ \hline Probability of Collision & 0.16\% & 0.61\% & 0.68\% & 0.48\% \\ Channel Utilization & 0.06\% & 3.17\% & 3.20 & 2.14\% \\ Channel Idle Time & 0.13\% & 4.84\% & 4.86\% & 3.27\% \\ Channel Collision Time & 0.27\% & 16.23\% & 16.41\% & 10.97\% \\ Transmission Delay & 0.03\% & 0.48\% & 0.48\% & 0.33\% \\ Reliability & 0.1\% & 0.18\% & 0.26\% & 0.18\% \\ Energy & 0.12\% & 11.90\% & 11.78\% & 7.93\% \\ Energy Collision & 1.98\% & 8.02\% & 6.03\% & 5.34\% \\ \hline \hline \end{tabular}
\end{table} 
Table 2: CV(RMSD) values. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Network Topology** & **Star** \\ \hline
**Traffic** & **Saturated and Unacknowledged** \\ \hline Average Power & Rx & 40 \\ Consumption (mW) & Tx & 30 \\  & CCA & 40 \\  & Sleep & 0.8 \\ \hline  & Timeslot Duration & 0.32 ms (80 bits) \\  & Frame Length (\(L\)) & 14 timeslots \\  & ACK Frame Length (\(L_{ack}\)) & 2 timeslots \\  & Simulation Time & 320 s \\ \hline  & macMaxCSMABackoffs & 5 \\  & macMaxFrameRetries & 4 \\  & macMinBE & 3 \\  & macMaxBE & 5 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Simulation settings and parameters. metrics were averaged over all runs to obtain the final results, and 95% confidence intervals were calculated. Since floating-point arithmetic can lead to precision errors, especially in simulations involving small time scales or energy measurements, we carefully managed precision by using double-precision floating-point numbers where necessary. To minimize rounding errors, we applied appropriate rounding techniques only during the final result presentation. To ensure reproducibility and avoid biases due to random number generation, we used fixed random seeds for simulations. We compared our results with those from the standard BEB and ABA to ensure that any performance gains observed were due to the improvements in I-ABA, not experimental biases. The results obtained from the Java and C simulations were cross-validated to check for consistency between different simulation platforms. All simulation runs were logged with detailed information about the network configuration, the number of collisions, and other relevant parameters to trace and debug any anomalies. For validity threats, we next discuss the internal and external threats to our simulations. We identify programming bugs, model accuracy, and simplified simulation assumptions as potential internal threats.