# Performance Analysis of a Keyword-Based Trust Management System for Fog Computing
## 4 Results and Discussions
### Optimizing the Network
#### 4.6.1 Latency  
Latency can be defined as the time it takes for a fog server to send a message to a fog client in general. System failures can be detected by abnormal response times, such as high latency and irregularity. It can be measured through round-trip time (RTT) or time to first byte (TTFB). RTT is the time calculated when a fog node sends a packet request to the fog server and receives a response packet. TTFB calculates the time from the request sent to the fog server and receiving the first byte of the packet. Figure 8 compares the network usage and latency between fog and cloud configurations in six different trust keyword scenarios. The \(x\)-axis represents the different trust keyword scenarios, while the \(y\)-axis shows each scenario's network usage and latency. The blue bars represent the network usage values for the fog configuration, while the orange bars represent the network usage values for the cloud configuration. The green bars represent the latency values for the fog configuration, while the red bars represent the latency values for the cloud configuration. The plot shows that the network usage and latency values for some trust keyword scenarios are similar for the fog and cloud configurations. However, for other scenarios, there are significant differences between the two configurations. In some cases, the network usage and latency values are better for the fog configuration, while the cloud configuration performs better in other cases. Figure 8 visually represents the network usage and latency values for the different trust keyword scenarios in the fog and cloud configurations. It can help evaluate the two configurations' performance and identify which configuration may be better suited for a particular scenario or application. Figure 9 shows the trust scores for two different parameters: latency and packet delivery ratio (PDR). The \(x\)-axis represents the different trust score levels, while the \(y\)-axis shows the percentage of samples within each trust score level. The blue line represents the percentage of samples that fall within each trust score level for the latency parameter. In contrast, the orange line represents the percentage of samples that fall within each trust score level for the PDR parameter. The plot shows that the trust score distribution for the two parameters is different. Most samples fall within the lower trust score levels for the latency parameter, indicating that the latency values are generally higher and less reliable. Most samples fall within the higher trust score levels for the PDR parameter, indicating that the PDR values are usually better and more reliable. Overall, Figure 9 provides a visual representation of the trust score distribution for two different parameters, highlighting differences in the reliability and performance of the trust scores. Figure 8: Network usage latency fog vs. cloud in trust keywords for 6 configurations. Figure 9: Trust score for latency and PDR. two parameters. It can help evaluate different system components' performance or identify areas for improvement or improvement. The figure compares the network usage latency between fog computing and cloud computing and how it is affected by trust keywords in six different configurations. The term \"configurations\" refers to various scenarios or settings in which the network is operated. The six configurations in the figure are likely different combinations of network parameters, such as network size, processing power, and data transfer rates, that have been used to evaluate the network's performance. The \"network usage latency\" measures the time taken for data to be transmitted from one node to another. It can be affected by various factors, such as network size, processing power, and data transfer rate. The \"trust keywords\" refer to a set of keywords used to evaluate the trustworthiness of the network. These keywords may be used to assess the security and reliability of the network and the authenticity of the data being transmitted.