# A Proof-of-Multiple-State Consensus Mechanism for Mobile Nodes in Internet of Vehicles
## 6 Simulation Results
Figure 6 illustrates the variation in the time required for the vehicle to complete consensus for different probabilities of malicious node generation. Malicious nodes disrupt the network by generating useless packets with no information load, consuming resources, or interrupting message transmission. Therefore, the question of how to effectively identify malicious nodes as relay nodes and reduce their probability has become an important research topic. The PoMS algorithm proposed in this study is able to verify all node behaviors in the next consensus round by recording node behaviors and reporting them back to the blockchain, thereby reducing the weight of malicious nodes during the selection process. As the probability of malicious nodes increases, the increase of invalid messages in the network has a significant impact on the speed of consensus execution. In networks with less malicious nodes, the time cost in [27] is mainly the baseline waiting time, while [29]  
Figure 4: Success rate of message transmission at different speeds. Figure 5: Consensus time at different speeds. and PoMS perform similarly; in networks containing more malicious nodes, [30] it spends more rounds to check credible nodes for the election period and the waiting time increases; The PoQF determines the normality of behavior based on the node's votes. The more malicious nodes there are, the longer it takes to get enough votes, the larger the number of malicious nodes, which increases the time consumption. and the PoMS consensus shows more efficient resistance by assigning weights based on the historical behavior of nodes. As the number of malicious nodes increases, RSU nodes can collect node behavior information and report back to miner nodes more quickly, thereby improving the anti-interference ability of the network. In a high probability malicious node environment, the consensus time required by PoMS is reduced by 9.8% on average. Figure 7 shows the resilience of PoMS to different proportions of malicious nodes in the network. The upper blockchain of the algorithm records the behavior of vehicles in the system and dynamically adjusts the weights of nodes in the consensus process according to their performance to resist the impact of malicious nodes on the system. As the proportion of malicious nodes increases, more invalid blocks are generated in the network and the validity of miner nodes' collected values and the number of votes decrease, resulting in slower blockout. However, it can still be seen that the throughput of the blockchain proposed in this paper decreases more slowly, and in the presence of malicious nodes, PoMS consensus is still the more powerful algorithm, maintaining a more efficient blockout efficiency in all cases. Figure 8 shows the average time spent for each additional hop of a message in the network. The number of message hops in PoMS reaches the specified threshold. The number of message hops in PoMS reaches the set threshold and it is proven that the message has been successfully transmitted to the destination and the entire network establishes a communication link. Malicious nodes increase the time it takes for miner nodes to collect enough blocks, which leads to an increase in the selection time of each relay node, thus affecting the time to complete the final round of consensus. The PoMS algorithm has a relative speed and a relative distance The calculation in the PoMS algorithm causes the miner nodes to select more distant vehicles as relay nodes as much as possible and to connect within the communication range in fewer hops during the transmission process final destination, effectively reducing the average time spent per hop. Figure 6: Consensus time for different number of malicious nodes. While Figure 9 shows the effect of vehicle speed on the time per hop.