# A Comparison of Blockchain Recovery Time in Static and Mobile IoT-Blockchain Networks
## 5 Evaluation  
### Real IoT-Blockchain System  
#### 5.1.1 Static Scenario  
The real IoT-blockchain system includes four RPis deployed on the fifth floor of Building 1 of the Faculty of Engineering, Chiba University, Japan. Each node runs on the Ubuntu Mate 20.04 with the Wi-Fi card in ad hoc mode. The detailed information of each node and ad hoc routing protocol are shown in Table 5. Figure 1(a) presents the system's connection diagram and the distance between nodes. The distances between device1 and device2 and device3 and device4 are all 8 m. While the distances between device1 and device4, and device2 and device3 are 41 m. The black dashed lines between the devices indicate the ad hoc connection. We let device2 and device4 join the blockchain network; the red dotted line in the figure indicates the blockchain connection between them. We have device2 as the sender and device4 as the receiver of transactions. We find that, when using all three routing protocols, device2 always chooses the same path to send packets to device4 (i.e., device2-device1-device4). When evaluating the recovery time, we shut down the relay node between the sender and receiver (i.e., device1) (e.g., by using a specific Linux command). Figure 1: Method of obtaining IoT-blockchain’s recovery time. We first evaluate the network performance of the static IoT-blockchain system. We measure TCP throughput, RTT on different links, and RTT from the sender to the receiver. Each throughput or RTT experiment is repeated ten times. Each RTT experiment is conducted with 50 ICMP packets via ping. Since OLSR, BATMAN, BABEL share the same performance, we present the typical results in Figure 3, in which Figure 3,b show the throughput and RTT, respectively. At each condition, the y-axis shows the maximum, minimum, and average. Note that, as shown in Figure 2, we label the name of each link and the two paths from the sender to the receiver. They are pathl (i.e., device2-device1-device4) and path2 (i.e., device2-device3-device4). The results show the consistency between RTT and throughput and the dependence of throughput on distance. We then evaluate the recovery performance of three ad hoc routing protocols in the IoT-blockchain system. We conduct ten experiments to obtain the average, maximum, and minimum values of the blockchain recovery time when using OLSR, BABEL, and BATMAN. We collect from the geth logs of the receiver how the number of transactions in its txpools varies over time. Then we can calculate the recovery time of communication in the IoT-blockchain system. The results are shown in Figure 4, where the protocols are shown in the x-axis. We can see that BATMAN has the lowest recovery time. This is because when the relay node (i.e., device1) failed, the sender no longer received OGM packets broadcast or forwarded from device1. However, the sender also receives OGM packets directly from another node (i.e., device3). Once the number of OGM packets received from device3 exceeds that obtained from device1, the sender immediately switches to a new route. To get a closer observation of the recovery process, we plot the time consumed by each process's  
Figure 2: Real IoT-blockchain system evaluation. (**a**) Static scenario; (**b**) Mobile scenario. \begin{table}
\begin{tabular}{c c} \hline \hline
\begin{tabular}{c} Raspberry Pi \\ \end{tabular} & model 4B \\ OS & Ubuntu Mate 20.04 LTS \\ Linux kernel version & 5.4.0 \\ CPU & Quad core [EMAIL_ADDRESS] GHz \\ \hline Ethereum & Geth 1.10.9-stable-eae3b194 \\ \hline OLSR & olsrd 0.9.9 \\ BATMAN & batman IV \\ BABEL & babeld 1.12.1 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: RPi, Ethereum, and routing configurations. component in Figure 4b. In the figure, we use stacked bars to display the average values of different parts of the recovery time when using each routing protocol. For OLSR, \(T_{MPR\_lost}\) and \(T_{NEIGHB\_HOLD\_TIME}\) accounted for a total of 60.6% and \(T_{pure\_blockchain}\) for 39.4%. For BABEL, \(T_{neighbor\_update}\) accounted for 83.3% and \(T_{pure\_blockchain}\) for 16.7%.