# Reputation-Driven Dynamic Node Consensus and Reliability Sharding Model in IoT Blockchain
## 4 Experiment and Result Analysis
### Local Outlier Factor (LOF) Experiment  
To test the reputation-based abnormal-node judgment, the following five experimental situations were designed: (1) There is one continuous malicious node in 10 nodes; (2) There are two consecutive malicious nodes in 10 nodes; (3) There are three consecutive malicious nodes in 10 nodes; (4) There are three probable malicious nodes in 10 nodes; (5) In 10 nodes, there is one node that acts maliciously when it becomes a master node, one node that is continuously malicious, and one node likely to be malicious. After each round of consensus, the updated reputation was calculated by the LOF algorithm, and the test results of the above five cases were visualized as the situation shown in Figure 8 below. In the figure, the horizontal axis is the reputation value after the previous consensus, the vertical axis is the reputation value after the current consensus, the red dotted line is the threshold curve, and the nodes outside the red range are judged as abnormal nodes, which need to be removed. Figure 8A is the result of case (1). After the first round of consensus, nodes with malicious behaviors were judged as abnormal nodes. Figure 8B,C are the results after the first two rounds of consensus. Since there were two nodes with malicious behaviors, the reputation of both nodes decreased after the first round, which had a great impact on the value of the outlier factor in the LOF algorithm, so it was not considered an anomaly in Figure 8B. After that, two consecutive malicious behaviors led to a large reputation gap with normal nodes, which was judged as an abnormal node in Figure 8C. Figure 8D-F are the results of case (3) after the first three rounds of consensus. It can be seen that, in Figure 8F, the abnormal nodes are determined. It can be seen that the more abnormal the nodes, the more consensus time is needed to judge the nodes with malicious behavior, but the abnormal nodes can still be determined quickly by the continuous malicious behavior. Figure 8G-J are the results of the second, fourth, sixth, and eighth round consensus in case (4), respectively. From the above analysis, it can be seen that the malicious behavior of a single node is easy to judge as abnormal, so the three nodes are defined as acting indirectly maliciously at the same time. From Figure 8G-I, it can be seen that the three nodes with malicious behavior are gradually farther away from the normal node cluster and closer to the threshold line, and the nodes in Figure 8J are judged as abnormal nodes. Even if it is not consecutive malicious behavior, the indirect malicious nodes can be judged as abnormal nodes within a small number of consensus rounds. Figure 7: Comparison of reputation of different shards. Figure 8K,L are the results of the first, second, and fifth consensus, respectively, in case (5). The node reputation of case (5) is as shown in Figure 6. In the first round of consensus, the probabilistic malicious nodes worked normally, and only one node was  
Figure 8: LOF experimental results. (**A**) is the result of case (1), (**B**,**C**) are the result of case (2), (**D–F**) are the result of case (3), (**G–J**) are the result of case (4), (**K–M**) are the result of case (5). judged as an abnormal node for malicious behavior. In the second round of consensus, there was only one node in the consensus network that acted maliciously and was judged as an abnormal node. In the fifth round, when the master node acted maliciously, the point became the master node, started to act maliciously, and was judged as an abnormal node. Since the master node is punished more severely for malicious behavior, it can still be judged as an abnormal node quickly even though the master node has a high degree of reputation before becoming malicious. Table 3 shows the results of the comparison with the other three papers on node elimination schemes. In Reference [42], the author adds the concept of participation degree (PD). The upper limit of PD value is 3.