## 4 Simulation Experiments
### Performance of the Communications  
In the simulation experiments, we compared the latencies and the packet delivery ratios attained by three implementations of blockchain in VANETs:  
* A non-virtualized configuration with a protocol stack like the one on the left hand side of Figure 1, with IGRP as the routing protocol. * A VaNetChain configuration with a protocol stack like the one on the right hand side of Figure 1, with VNAODV+ as routing protocol (reactive). * Another VaNetChain configuration with a protocol stack like the one on the right hand side of Figure 1, with VNIBR as routing protocol (geographic, intersection-based). Latencies were measured as the time elapsed since a _m_ConfirmMRSU_ message is sent until the _m_StatusMRSU_ confirmation is received in the state machine of Figure 3. The consensus or mining time of a transaction is not part of this analysis, as the difficulty of the PoW is constantly adjusted to maintain a 10 seconds average. The simulation scenario comprised a two-lane, 800 \(\times\) 800 m Manhattan-type urban scenario with 64 intersections, 100 m away from one other. In the virtualized configurations, the road segments were always covered by 3 VNs (421 overall). Regarding the simulation software, three tools were used: ns-3, 30 th release ([[https://www.nsnam.org/releases/ns-3-30/](https://www.nsnam.org/releases/ns-3-30/)]([https://www.nsnam.org/releases/ns-3-30/](https://www.nsnam.org/releases/ns-3-30/))), SUMO ([[https://sumo.dlr.de/docs/](https://sumo.dlr.de/docs/)]([https://sumo.dlr.de/docs/](https://sumo.dlr.de/docs/))), and SimBlock ([[https://dsg-titech.github.io/simblock/](https://dsg-titech.github.io/simblock/)]([https://dsg-titech.github.io/simblock/](https://dsg-titech.github.io/simblock/))). In ns-3, all the procedures followed by the VaNetLayer to achieve the emulation of VNs over PNs were defined; in addition, VaNetChain packets are given top priority thanks to the concept of cVN. SUMO is an urban mobility simulator that provides traces of node mobility. Finally, SimBlock is one good choice to implement a blockchain network, as its parameters can be modeled to model the behavior of any specific technology. The parameters that are considered key to the simulations are summarized in Table 1.  
In the first experiment, aiming to measure packet delivery ratios, we varied the vehicular density (128, 256 or 512 vehicles) in a scenario where 10,000 transactions had to be recorded. The results are shown in Figure 4. It can be seen that the VaNetLayer in conjunction with VNIBR yields the best results at low/medium density. The non-virtualized configuration with IGRP outperforms the virtualized one of VNAODV+, because the reactive nature of the latter fails to properly handle scenarios of high mobility. When comparing VNIBR and IGRP at high traffic densities, the differences are small differences because the mobility of the vehicles is reduced and, therefore, the environment is less challenging. To assess end-to-end delays, we set the number of vehicles to 256 and progressively increased the number of transactions: 100, 1000, 10,000, and 100,000. The results can be seen in Figure 5. The curves of the three configurations exhibit similar dynamics, but VNIBR attains the best performance in all cases. VNAODV+ delivers packets more slowly, mainly because its route maintenance algorithms commonly lead to longer multi-hop paths. IGRP often makes the packets go through fewer hops, but it is less effective than VNIBR in dealing with route breakages, which causes retransmissions from the source and, thereby, additional delays.