## 3 Preliminaries
### Reputation System Performance Metrics
#### 3.2.2 Node Classification Metrics  
The objective of node classification metrics is to measure how well and how fast nodes classify each other as good or malicious in the simulation when faced with various percentages of black-hole nodes.  
The detection ratio represents the percentage of malicious nodes detected by all nodes in the simulation. This means that for a detection rate of 100%, both good and malicious nodes must identify all black-hole nodes. Thus, if the simulation has \(B\) black-hole nodes, each good node should identify \(B\) black-hole nodes, and each malicious node should identify \(B\)-1 black-hole nodes, not counting itself. Considering \(B\)Hs as an abbreviation of black-hole nodes, \(N\) as the total of good nodes, \(B\) as the total of black-hole nodes, and \(T\) as the total number of nodes in the simulation, the detection ratio is calculated using:  
\[\textit{detection ratio}\left[\%\right]=\frac{\sum_{i=0}^{T}(\textit{ number of BHs classified as BHs}_{i})}{N\times B+B\times(B-1)}\times 100 \tag{5}\]  
The detection ratio for good nodes is the percentage of malicious nodes detected by good nodes in the simulation. Here, contrary to the detection ratio, only the classification of black-hole nodes by good nodes is relevant. The distinction is made between the two detection ratios because it is in a reputation system. However, all nodes must identify the threats, which is more valuable for the network if all good nodes identify all bad nodes. The detection ratio for good nodes presents a clearer view of this point. Considering \(N\) as the total of good nodes and \(B\) as the total of black-hole nodes, this metric is calculated as:  
\[\textit{detection ratio for good nodes}\left[\%\right]=\frac{\sum_{i=0}^{N}( \textit{number of BHs classified as BHs}_{i})}{N\times B}\times 100 \tag{6}\]  
The false-negative ratio is the percentage of black-hole nodes mistakenly classified as good. With a high false-negative ratio, good nodes exchange messages with malicious nodes thinking they are good and cooperate in the message exchange. Considering \(T\) as the total number of nodes in the simulation, the false-negative ratio is obtained using:  
\[\textit{false-negative ratio}\left[\%\right]=\frac{\sum_{i=0}^{T}( \textit{number of black-hole nodes classified as good})_{i}}{\textit{total number of classifications}}\times 100 \tag{7}\]  
The false-negative ratio for good nodes is the percentage of black-hole nodes mistakenly classified as good by good nodes. Considering \(G\) as the total number of good nodes in the simulation and \(B\)Hs as the number of black-hole nodes, the false-negative ratio for good nodes is obtained using:  
\[\textit{false-negative ratio}\ \textit{for good nodes}\left[\%\right]=\frac{\sum_{i=0}^{G}( \textit{BHs classified as good by good nodes})_{i}}{\textit{total number of classifications by good nodes}}\times 100 \tag{8}\]  
The false-positive ratio is the percentage of good nodes mistakenly classified as malicious. This is a crucial metric if it is decided to punish bad behavior. If the false-positive ratio is high, good nodes may be prevented from contacting other nodes, unfairly impairing the exchange of messages. Considering \(T\) as the total number of nodes in the simulation, the false-positive ratio is obtained using:  
\[false-positive\ ratio\ [\%]=\frac{\sum_{i=0}^{T}(number\ of\ good\ nodes\ classified\ as\ black-hole\ nodes)_{i}}{total\ number\ of\ classifications}\times 100 \tag{9}\]  
The false-positive ratio is the percentage of good nodes mistakenly classified as malicious by good nodes. Considering \(G\) as the total number of good nodes in the simulation and \(BHs\) as an abbreviation of black-hole nodes, the false-positive ratio for good nodes is obtained using:  
\[false-positive\ ratio\ for\ good\ nodes\ [\%]=\frac{\sum_{i=0}^{G}(good\ nodes\ classified\ as\ BHs\ by\ good\ nodes\ )_{i}}{total\ number\ of\ classifications\ by\ good\ nodes}\times 100 \tag{10}\]