## 6 Experimentation
### Simulation Experiments  
CTP and ZERO have been implemented in JAVA in order to be able to evaluate them in a large scale. The experiment constructed a network as a k-ary tree with n nodes. \[n=\frac{k^{h+1}-1}{k-1}\]  
The maximum depth was set to five hops (h = 5), a maximum number of child nodes of six (k = 6) per each node and a unique sink which leads to a network of 9,331 nodes. Initial ETX rates have been assigned following a uniform distribution. The simulation aimed to evaluate the number of messages routed by each node in the network and compare the approaches taken by CTP and ZERO. In the experiment each node aimed to transmit 1,000 packets which were routed to the sink following the route determined by CTP or ZERO. For ZERO the triangular distribution metric with \(a=c=1\) and \(b=3\) was selected as route determination policy. The probability of successful transmission was set in the range of 80% to 99.9% since we aimed to evaluate the behaviour of the protocols under considerably low failure rates. Experiments were repeated 50 times and average results are presented. Figure 3 compares the results obtained in our simulation regarding the number of packets relayed by each routing node (Node that routes information from other nodes) in CTP and ZERO. For the CTP implementation, routing nodes transmitted in average 17.23 messages whilst nodes in ZERO transmitted 3 times less messages (5.76 in average). This is attributed to the probabilistic distribution of routes in ZERO that in average balances the load in the \(b\) paths. However the distribution is not equitable for eachof the path but best paths will keep transmitting more packets. Figure 3(b) shows the number of nodes routing information from other nodes. Figure 4 presents the number of messages relayed by nodes in the network. Nodes have been sorted in a decreasing way as regards to the number of packets transmitted. Figure 4(a) shows only 778 out of the 9,331 nodes in the network since the rest of nodes did not relayed packets from others (only transmitted their 1,000 packets). Root nodes (node 1 in the figure) from CTP and ZERO almost transmitted the same number of messages, around 920,000 in average with slight variations attributed to the randomized probability of successful transmission attributed to each node. It can be seen either in CTP and ZERO that the distribution of transmitted packets follows a power law where few nodes have transmitted the majority of the information. As the overlay created by CTP and ZERO are trees this is the expected distribution. However, looking at Figure 4(b) it can be seen that for CTP the number of packets transmitted are distributed in a pseudo-step distribution. Relay nodes at the same depth in the network transmit almost the same number of messages due to the homogeneity of the network. For ZERO the number of transmitted packets are distributed more uniformly due to the fact that loads are triangular distributed and consequently two consecutive transmission does not always follow the same path even prioritizing best routes. Figure 3: Number of messages per routing node and number of nodes routing information from other nodes. (a) Average number of messages per routing node (in average for the 50 repetitions of the experiment), (b) Number of nodes routing messages from other nodes. Figure 5 show in average the number of routing nodes at different depth of the network. Root nodes route all packets but at subsequent network depth the ratio of nodes routing information is 1:3 for CTP in respect to ZERO. The results obtained by the simulation demonstrated that ZERO balances the load at routing nodes by introducing new suitable paths for transmission to the sink reducing then the number of transmitted packets per node. As a consequence, energy depletion of hot spots is also mitigated. Figure 4: Number of messages routed per node. X-axis show nodes descending sorted by the number of messages routed. Node 1 represents the root node as it routes all messages generated in the network.