## 4 Building the Reputation System
### Detection Phase  
#### 4.3.1 Independent Detection Scheme: Scheme Description  
The detection part of the reputation system in each node has the purpose of identifying black-hole nodes in the scenario. For this reason, to classify the detection schemes, only three metrics were used: The detection ratio, false-positive ratio, and false-negative ratio.  
Various strategies can be used to identify malicious nodes, as seen in the Background section. For this work, some considerations were deemed necessary. First, the detection phase must be decentralized, allowing each node to have its reputation rating for other nodes in the network. Second, the reputation rating should be achieved in the most independent manner possible, and when necessary, exchanged information between nodes should be done carefully. In addition, it is of higher importance to achieve the best metric possible and a fast convergence rate in the false-positive ratio than in the false-negative and the detection ratio. This decision was made because of the impact that the false-positive and false-negative ratios have in the action phase of the scheme. In a worst-case scenario where a reputation system has a detection ratio of 0%, the network's impact would be approximately the same as if no reputation system was applied. The same goes for the false-negative ratio. If a system has a false-negative ratio of 100%, then all black-hole nodes are considered good, and it is the same scenario as if no reputation were applied. However, a high false-positive ratio classifies many good nodes as malicious. This is a bigger problem as the goal of the whole reputation system is to improve the delivery ratio of good nodes. Classifying good nodes as bad, considering that a punishment will be applied to these nodes will probably decrease the good nodes' delivery ratio, which is the opposite to what is desired.  
The first attempt at a detection scheme is straightforward. Each node has a black-hole node list and a good node list. The black-hole node list saves the identification of nodes that are classified as bad, and the good node list saves the identification of nodes that are classified as good. When a node receives a message, all nodes that contributed to forwarding the message, as listed in the path stored in the message, are classified as good, put on the good node list, and removed from the black-hole node list, if they were listed there. The message source is considered malicious and put on the black-hole list unless it is already on the good node list. This scheme is called the Independent Detection Scheme. A node is classified as bad if it is listed in the bad node list, and classified as good otherwise.  
Figure 1 represents an example of the classification made in this detection scheme. In the figure, C refers to car and P to pedestrian; the following number serves as the identification of the node for scheme purposes. Figure 2 presents a flowchart of the detection scheme that is executed by each node when a contact is established with another  
\begin{table}
\begin{tabular}{c c} \hline
**Simulation Time** & **24 h** \\ \hline Map & Helsinki downtown (4500 m \(\times\) 3500 m) \\ Movement Model & Shortest Path Map-Based Movement Model \\ Nodes’ speed & Pedestrians 1.8-5.4 km/h; Cars 10-50 km/h; Trams 25-36 km/h \\ Number of nodes & 206 (Pedestrians: 100; Cars: 100; Trams: 6) \\ Nodes’ buffer size & 5 MB \\ Nodes’ wait time & 0–120 s \\ Message size & 500 kb–1 MB \\ Message generation interval & 25–35 s \\ Message TTL (Time to Live) & 5 h \\ Interfaces’ data rate & 250 kbps = 2 Mbps \\ Interfaces’ transmission range & 10 m \\ \hline \end{tabular}
\end{table}
Table 2: Simulation parameters.  
node to exchange messages, detailing how the information in the messages received is used to update a node's reputation tables.