# Decentralizing Private Blockchain-IoT Network with OLSR
## 5 Evaluation
### Latency Performance  
In an ad hoc network, nodes can directly communicate with peers in their wireless communication range. Deploying the OLSR protocol will provide paths to other nodes in the network. In our experiment, the connections between peers are marked as OLSR links, as shown in Figure 2. The distances of Links 1 and 2 are 10 m, while those of Links 3 and 4 are 40 m. As a result, the blockchain communication between the sender and the receiver can go through two paths denoted as Paths 1 and 2. First, we evaluate the performance of each path with \(Ping\) time, packet loss rate, and throughput. We use the iperf3 tool to measure those performance metrics, and the results are shown in Table 4. It is obvious that the OLSR link has a better performance when the nodes are between a shorter distance. The table also shows the comparison of wireless link performance in an infrastructure network with Wi-Fi. We replace Node 3 with an access point; hence, Path 2 becomes the infrastructure-based links. We let the packets pass through the same path for comparison. We can see that the transmission delay is smaller in the infrastructure mode, and the loss rate is lower, which lead to a shorter propagation latency in the later measurements.  
In the following, we present the latency measurement in our IoT blockchain network. During the data streaming, submitted transactions are propagated to the receiver through one path from the sender to the server. The receiver then loads a JavaScript file, which starts the mining process to admit and execute transactions into blocks when the _Txpool_ is not empty. The generated blocks are propagated to every participates in confirming their uploaded transactions. We collect both Geth logs and measure Transaction-Oriented Latency (TOL) and Block-Oriented Latency (BOL) with different groups of transactions. The TOL results are shown in Figure 4. We can see that the TOL of a single transaction propagation is on average 18.9 and 19.1 ms for the two-hop paths. When sending multiple transactions in groups, transactions are propagated continuously without waiting to confirm previous transactions. Consequently, propagating ten transactions consumes 66.7 and 68.2 ms for both paths, while 100 transactions averages 443.4 and 449.3 ms, respectively. Propagated transactions are mined into blocks by the receiver, which is disseminated back to the sender. With more transactions inside, a block becomes more extensive and has a greater BOL. The blocks with a single transaction have a similar BOL an TOL. However, as the transaction number grows, BOL becomes smaller than TOL. The results indicate blockchain over an ad hoc network has a better experience on block propagation than transaction propagation. Because transactions are transferred individually, each transaction is divided into three or more TCP packets, while blocks are serialized before transmission. In comparison with infrastructure mode, the packets are re-transmitted by the access point. Hence, it is reasonable that information dissemination is commonly quicker than ad hoc mode.  
Figure 3: Experimental results of recovery time.