## 4 Simulation Evaluation
### Simulation Result  
We first evaluate the performance of the end-to-end delivery latency. For the chain topology, node 0 generates a CBR flow at the rate of 1 packet every 10 seconds. The simulation time is set as 1,200 seconds. For the random topology, a random sensor node is selected every 10 seconds to send one packet to the sink. The simulation time is set as 19,200 seconds. Figure 9 shows the growth trend of the average packet delivery latency with respect to the increase in path length in the chain topology and random topology, respectively. Both figures show that the delivery latency in P-MAC increases at a much lower rate than S-MAC and RMAC. This is because S-MAC only forwards a packet to a 1-hop distance in each operational cycle and RAMC has to wait for the start of the next _DATA_ period to forward data again if the path length exceeds the PION relaying number, while P-MAC can forward data in a pipeline fashion. Provided the path length does not exceed the PION relaying number, data transmission can be completed within a single cycle in RMAC, spending about _TDATA_ time. For P-MAC, the data frame moves to a 1-hop distance per _SEND DATA_ period, spending about _TSR_ time. In our simulation, _TDATA_  
Figure 9: **(a)** Delivery latency in the chain topology. **(b)** Delivery latency in random topology. (168.0 ms) is 66.0 ms less than \(T_{SR}\) (234.0 ms), so Figure 9 shows that RMAC has slightly less delivery latency when the path length is within 4 hops, as \(N=4\) in our simulation. Figure 9 also shows that the basic P-MAC has lower delivery latency than the full P-MAC with routing, since the RTS is sent to a certain node during data transmission in the basic P-MAC, which reduces network congestion and improves the data delivery ratio. Next, we evaluate the network throughput and energy efficiency for P-MAC. The network throughput is recorded in terms of the average number of packets successfully received by the sink per second. For the chain topology, we keep \(n=24\), and the data input interval for node 0 varies from 10-1 seconds. For the random topology, the interval for randomly selecting a sensor node to send data varies from 10-1 seconds. In both topologies, the simulation time is set as 1,200 seconds. In the chain topology, Figure 10(a) shows that when the input interval is less than 8 seconds, the output rate in S-MAC decreases rapidly, since S-MAC has poor traffic contention handling due to its weakness of forwarding a packet to a 1-hop distance in each operational cycle. Because the network throughput of S-MAC decreases when the input interval is less than 8 seconds, the corresponding energy consumption also decreases, as shown in Figure 10(b). For P-MAC and RMAC, Figure 10(a) shows that the output rate follows the input rate until the input interval is less than 5 seconds, and finally reaches the steady state. When the network throughput reaches its peak point, the incoming injected packets cannot continue to be sent, and the network energy consumption will not be increased, as shown in Figure 10(b). When the input interval is smaller than 4 seconds, P-MAC with routing will have higher energy consumption than RMAC because of its higher throughput. The basic P-MAC has almost the same throughput as the full P-AMC but has lower energy consumption, since it doesn't consider the routing issue. In the random topology, Figure 11(a) shows that RMAC has better performance than the P-MAC integrated with routing in terms of throughput. But the basic P-MAC has better throughput than RMAC when the input interval is less than 4 seconds. Figure 11(b) shows that P-MAC is more energy  
Figure 10: **(a)** Throughput in the chain topology. **(b)** Average power consumption per sensor node in the chain topology. efficient than RMAC and S-MAC in the random topology. For all protocols, the range of improvement of the average power consumption is not obvious as the input interval decreases.