## 4 Performance Evaluation
### Hidden-Terminal Topology
In order to validate this assertion and to explore the dynamics of RI-MAC contention window, we recorded the contention window announced by the sink for each successful packet. Figure 14 depicts the distribution of the contention window size with which each successful packet was transmitted under RI-MAC for 50 devices and \(\lambda=0.9\). The figure clearly depicts that for high loads, practically all packets were transmitted in the largest window (256). Recall that for this high traffic load, the sink was awake throughout the simulation duration (see Figure 12), which means that after waking up for the first time, the sink stayed awake throughout the simulations. Accordingly, due to the high load, after resolving the contention between many backlogged devices, the window was set at the appropriate window size for such a high load (256) and stayed at this size throughout the simulation duration. Note that, in the presence of hidden terminals (like the topology for which the results are presented in the figure), collision can occur not only upon transmission initiation, but also during the transmission itself (i.e., after a transmission has been started by a device, a hidden device that cannot sense the transmission can initiate its own transmission). However, since we adopted the parameters used in [9], in which the packet size is quite small (only 28 bytes), the packet transmission time is  
Figure 13: Hidden-terminal topology: The probability density distribution (PDF) of the number of retransmissions in RI-MAC. (**a**) Twenty devices. (**b**) Fifty devices. short; hence, the vulnerable period is also short, and the effect of collisions between hidden terminals in RI-MAC is not dramatic. Obviously, when enlarging the packet size, the effect on RI-MAC's performance can be much more severe, while it affects the performance of MAR-RiMAC only in the transmission time and has no effect on the MAR-RiMAC contention mechanism. As previously explained, the longer sojourn time experienced by MAR-RiMAC with respect to RI-MAC can be associated with the lower sink duty cycle. In particular, in MAR-RiMAC, since both the sink and the devices are awake for short time intervals, a device receiving a packet for transmission needs to first wait for its awake time and then until the sink's awake time before attempting to transmit the packet. In contrast, in RI-MAC, since both the sink and the devices are awake for longer time intervals, it is more likely that when a device is receiving a packet, both the device and the sink are awake; hence, the longer waiting time for both to be awake can be skipped. In order to filter the waiting time for the device and sink to be awake and to evaluate the delay due to collisions, we measure the latency from the time epoch in which the packet is queued at the device and both the sink and the device are awake until the packet is transmitted successfully, i.e., if the backlogged device wakes up while the sink is asleep, we measure the time elapsed from the sink's wake-up to the successful reception of the packet by the sink. If the backlogged device wakes up while the sink is awake, we measure the time elapsed from the device's wake-up time to the successful reception of the packet by the sink. Figure 15 depicts the comparison of this latency between the two protocols for 20 and 50 devices. It can be seen that when both the device and sink are awake, the average delays experienced by packets are much longer for RI-MAC than for MAR-RiMAC due to the longer collision resolution intervals, i.e., the latency of a packet because it is backlogged and both  
Figure 14: Hidden-terminal topology: RI-MAC contention window size distribution (PDF) for \(N=50\) and \(\lambda=0.9\). Figure 15: Hidden-terminal topology: The average latency experienced by the packets from the time that both the transmitting device and the sink are awake until the successful reception of the packet by the sink for: (**a**) 20 devices; (**b**) 50 devices. the device and the sink are awake is much shorter for MAR-RiMAC.