## 5 Simulation Results and Analysis
### Comparison of the DRFTM Performance in Different Attack Modes
#### 5.3.3 Performance of the DRFTM under Single Mode Attack  
To provide a conclusive comparison, we assessed the performance of the four models exclusively in single-mode attack scenarios. In these experiments, we initiated each test  
Figure 8: Error rate: (**a**) error rate over time; (**b**) number of nodes vs. error rate; (**c**) the ratio of malicious nodes vs. error rate.  
with an initial percentage of 30% anomalous nodes, focusing on a single type of attack. No attack occurs in the first five iterations, and after five iterations, 30% of the nodes switch to anomalous behavior state (experimental verification confirms that altering anomalous behavior after a specific number of iterations results in a consistent trend in trust value changes. The figure illustrates this trust value variation of malicious nodes when switching anomalous behavior within five iterations as an illustrative example), launching a DDoS attack, a selective forwarding attack, a data contamination attack, and an on-off attack, respectively (Section 3.2). We compared the average trust levels of malicious nodes across the four trust models.  
As shown in Figure 9, during the initial five iterations when the malicious node refrains from launching an attack, all four models consistently estimate high average trust values for the nodes. However, when the malicious node initiates an attack, the DRFTM rapidly detects and reflects this change by observing a sharp drop in the average trust value assigned to the malicious node. While trust values exhibit slight fluctuations under various attack scenarios, the overall trend remains consistent. This is because the DRFTM model uses a deep reinforcement learning adaptive trust update strategy, which is able to react quickly to outliers in the trust evidence and determine the node as low trust during trust evaluation, assigning it a very low trust value. The other three models also respond to the actions of the malicious node, albeit with a slower reaction time, resulting in a gradual decline in the trust value assigned to the malicious node. Figure 9d shows that while the malicious node launches a DDoS attack, selective forwarding attack, and data contamination attack, the malicious node performs an on-off attack. Because the switch attack is launched intermittently, the trust values estimated for the malicious node by the four models exhibit varying degrees of fluctuation, but the fluctuation magnitude of the DRFTM is small and the trust state is stable. This is because the DRFTM model not only considers the current trust state but also combines the node's historical behavior when updating the trust. The malicious node executes the on-off attack, and even when the node occasionally performs well, the node's trust value will not be restored to the normal node's trust state, and the overall trend shows a fast decline and a slow rise. Taken together, the above results show that malicious nodes can be quickly identified by their trust values, which indicates the reliability of the DRFTM model to detect malicious nodes and their resistance to face multiple attacks.  
Figure 9: _Cont._