# Gateway-Assisted Retransmission for Lightweight and Reliable IoT Communications
## 5 Results
Messages published by a device in MQTT-SN is not replaced by newly coming messages and the device always waits for the ACK of the current message it sends. Unfortunately, although \(\rho\) in MQTT-SN is large, the messages may be out-of-date. Since CoAP uses fixed RTO and adopts RRP policy, retransmission is triggered with higher probability, and then the current message is more likely to be replaced by a new message. On the other hand, the number of retransmissions in GaCoAP is small, so the message is hardly replaced. Even though working in the worst network conditions (i.e., MLR = 10% and \(\mu=10\)), GaCoAP still has a 99.8% message delivery ratio, thus it improves the message delivery ratio to at most \(0.998-0.774=22.4\%\) among methods with RRP policy. Figure 7 compares the average latency \(\lambda\) in each method. Overall, the latency in CoAP is the lowest because of frequent retransmissions. Once a message is lost, the device does not take a long time to wait for an ACK. Adopting an appropriate RTO can reduce the number of retransmissions, but this encounters larger latency. If the message is lost, the device may wait for more than a round-trip time and then trigger the message retransmission. Because RTO in GaCoAP is more suitable than other dynamic RTO methods, the latency in GaCoAP is a little bit larger. In the case that MLR = 10 % and \(\mu=10\), the devices adopting GaCoAP sacrifice at most \(21\) s \(-\)\(11\) s = 10 s latency. Note that 10 s latency  
is acceptable in most IoT applications. Finally, the latency in MQTT-SN is the largest due to its large and fixed RTO (i.e., 10 s). To investigate the effect of moving RTO calculation from device to gateway, Figure 8 compares the average number \(\delta\) of retransmissions in CoCoA and GaCoAP under different numbers of devices (connected to a gateway). Note that GaCoAP uses the same dynamic RTO calculation rules as that in CoCoA. After RTO calculation, the gateway in GaCoAP shares the RTO to other devices. The figure shows that, as long as there are more than five devices connected to a gateway, \(\delta\) in GaCoAP is always smaller than that in CoCoA. When the number of devices is small, the effect of overhearing cannot play a role, and the device has to wait for RTO calculation by the gateway. In this situation, a device in CoCoA obtains suitable RTO quicker than that in GaCoAP. Nevertheless, a gateway certainly connects to more than five devices in practice. In fact, we extend our experiment up to 100 devices connected to a gateway, and the results are consistent. Finally, we discuss the power consumption issue. Compared to other methods, devices in GaCoAP can save power owing to the reduction of retransmissions. If a device often triggers retransmission, it encounters higher transfer power consumption. In our experiments, the number of retransmissions in GaCoAP is the smallest, with only one exception (i.e., \(\mu=1\) and MLR = 0%). Assume that the packet size is 31 bytes, the size of Medium Access Control (MAC) ACK is 5 bytes, and the size of the application ACK is 12 bytes (this assumption follows the experiment setting in [14]). Based on Table 4  
Figure 5: The average number of retransmissions \(\delta\) under different \(\mu\). Figure 6: The average message delivery ratio \(\rho\) of device under different \(\mu\). in [14], a device consumes 1182 ms-mA (summation of Id 3, Id 4, and Id 5) power when it transmits a packet. If the device needs to retransmit the packet, an extra \(951\;ms\cdot mA\) (summation of Id 3 and Id 4) is required. For example, if the average number of retransmission is 0.1, the actual power consumption is \(1182+951\times 0.1=1277.1\) ms-mA. From Figure 5, the device in GaCoAP saves \(1.902-0.507=1.395\) retransmission times compared to MQTT-SN in the case that MLR = \(10\%\) and \(\mu=10\). As a result, each device can save 1840.185 ms-mA (951 ms-mA \(\times 1.395\)) power for a packet at most. Even compared to CoCoA, the device in GaCoAP can still save \(0.998-0.507=0.491\) retransmission times.