## 6 Simulation and Analysis
### Performance of the Proposed Transport Scheme  
The proposed reliable transport scheme (RTS) considered the selfish behavior of relays in practical applications, and made an optimal trade-off between energy consumption and delay. To verify the effectiveness of RTS, the performance was compared with that of a modified version of the RTS (denoted as RTS-MV) under different conditions. In RTS-MV, there was no control or intervention over the redundancy and diffusion process of the coded packets, and file delivery was achieved based on coding and acknowledgement without any optimization in energy consumption. RTS-MV represents a class of methods that considered neither redundancy control nor optimization of the forwarding process. Moreover, the cache management strategy we used is the first-in-first-out (FIFO). We set simulation time \(TE\) = 20,000, total energy of relays (the number of packets transmissions allowed) \(DC\) = 24,000, and weight parameter \(\alpha=0.5\). The values of \(\left\{M_{r},T_{s\_r},T_{w\_r}\right\}_{r=1}^{K}\) were set according to the optimal setting provided by the optimal program. The performance metrics we used were the mean round-trip delay of files, the mean energy consumption it took to deliver a file, and the number of files successfully delivered over a certain period. Note that we did not specify the units of the simulation time in experiments. One can think of simulation time = 20,000 as simulation time = 20,000 s, in which case, \(\lambda=0.01\) has to be \(\lambda=0.01\) s\({}^{-1}\). Similarly, one can think of simulation time = 20,000 as simulation time = 20,000 min (resp. delay = 20,000 h), in which case, \(\lambda=0.01\) has to be \(\lambda=0.01\) min\({}^{-1}\) (resp. \(\lambda=0.01\) h\({}^{-1}\)). Let \(p\) denote the level of the residual power that triggers the selfish behavior of node; we compared the performance of the RTS and RTS-MV versus \(p\). In Figures 10-12, the mean round-trip delay of files, the mean energy consumption to deliver a file, and the number of files successfully delivered in the simulation time of both RTS and RTS-MV are illustrated, respectively. Figure 10: The mean file round-trip delay of both the reliable transport scheme (RTS) and modified version of the RTS (RTS-MV) under different \(p\). It can be seen from the Figures 10-12 that, with the increase of \(p\), the mean round-trip delays of both schemes rose greatly, while the energy consumption declined with the increase of \(p\), that is, the number of files successfully delivered. A higher \(p\) meant that the relays' selfish behavior appeared easier, and the number of nodes that were willing to participate in message forwarding became smaller. Hence, the efficiency of file delivery was affected, and the power consumption caused by forwarding/replication was reduced. What is more, the mean round-trip delay of the RTS was slightly higher than that of the RTS-MV when \(p<70\%\). For example, when \(p=30\%\), RTS had a 26% larger delay than that of RTS-MV. In RTS-MV, to make the destination node decode the file as quickly as possible, the source added a lot of redundancy to the network, and packets were spread and forwarded in the epidemic style for a long time. In other words, RTS-MV got a satisfying delay at the cost of energy. Otherwise, the RTS considered both delay and energy consumption and tried to make a compromise between those two metrics, resulting in a larger delay than that of RTS-MV. However, when \(p\) was very high, i.e., 70%, the RTS-MV ran out of \"free energy\" very quickly; then it faced the dilemma that most nodes in the network refused to forward messages, which resulted in a very long delay, and even the failure of the delivery of the file. On the contrary, RTS could extend the time period for relays to participate in the communication service by providing a relatively fair transmission scheme for the source and relays.