# Optimizing Retransmission Threshold in Wireless Sensor Networks
## 7 Experiment Evaluation  
The effectiveness and efficiency of the proposed algorithms are evaluated through simulations in this section. Several experiments are conducted to demonstrate the relationships between the performance of real-time data delivery and the input parameter, such as deadline, the number of hops of the given delivery path and the number of packets queued at the relay node. The first two group of simulations are carried out by MATLAB, and the third group is implemented with NS2. One hundred sensor nodes and the sink are randomly deployed into a region of size 200 m \(\times\) 200 m (m for meters), and we assume that the sensors have the same transmission radius. In each simulation, source and destination nodes are randomly selected. Each simulation is repeated 100 times and the simulation result corresponds to the average value over 100 times. To understand the benefits of the proposed algorithms, the comparison with the general method is conducted. The main idea of the general method is that we set the same retransmission threshold for all of the sensor nodes. The first group of experiments is to investigate the Deadline Success Ratio (DSR) of the proposed algorithms, where DSR is the ratio of the packets delivered to the destination before their deadlines. Figure 3a shows the relationship between the deadlines and DSRs. The proposed algorithms have better performance. For example, when the deadline is 0.22 s, the DSRs of LMDAA and general method are 74% and 61%, respectively. Furthermore, we investigate the impact of the number of hops of a delivery path on the DSR. The remaining time to the deadline and link quality have been considered; thus, our algorithms can achieve higher deadline success ratios as shown in Figure 3b. Figure 3c depicts the relationship between the average number of packets queued at relay nodes and DSRs. From Figure 3c, the DSR becomes worse with the increase of the packets queued on the condition that the deadline is a constant. LMDAA is a distributed algorithm and enables the node to adaptively set the optimal retransmission threshold based on the link quality and the remaining time to the deadline. Therefore, LMDAA has better performance in terms of DSR than that of LPAA. The second group of experiments is to investigate the Real-Time Ratio (RTR) of the proposed algorithms, where RTR is the ratio of the packets delivered to the destination before their deadlines among the packets successfully delivered to the destination node. Figure 4a shows the relationship between the deadlines and RTRs. As expected, the proposed algorithms can reach higher RTR than that of the general method. Figure 4b depicts the relationship between the number of hops of a delivery path and RTRs. The figure shows that our algorithms have better performance. For example, the real-time ratio of LPAA is more than 60%. Similarly, we investigate the impact of the average number of packets queued at relay nodes on RTR, with results illustrated in Figure 4c. Experimental results show that the proposed algorithms can reduce the deliveries of the packets, which cannot meet their deadlines. Therefore, our algorithms can improve the real-time ratio and energy efficiency. Figure 4: Real-Time Ratio (RTR) of the proposed algorithms. (**a**) RTR _vs._ deadlines; (**b**) RTR _vs._ number of hops; (**c**) RTR _vs._ the average number of packets Queued. Figure 3: Deadline Success Ratio (DSR) of the proposed algorithms. (**a**) DSR _vs._ deadlines; (**b**) DSR _vs._ the number of hops; (**c**) DSR _vs._ the average number of packets queued. The third group of simulations is implemented with NS2, which is a widely-used simulation tool in wireless sensor networks. From the experimental results of the first two groups of simulations, LMDAA can reveal the effectiveness of the proposed algorithms more neutrally, then we compare the results of LMDAA and the general method. The reasons why DSRs in the simulations implemented by NS2 are lower than those in case of MATLAB are as follows.