# Device-to-Device (D2D) Multi-Criteria Learning Algorithm Using Secured Sensors
## 4 Simulation Setup
### Results and Discussion  
In this section, we first evaluate the security test of our proposed algorithm against different possible attacks. In the proposed algorithm, the D2D communication is based on the authenticity and verification of devices. Once on the communication channels, the devices are verified, and then they generate session keys. Using the sessional keys, the device initiates the sharing of data over secure links. It might be possible that the session keys are compromised, so the proposed algorithm utilizes the encrypted procedure to forward the security keys. Additionally, session keys are automatically revoked, and each node has to send a new request to the gateway for issuing the session key. In our proposed algorithm, the devices are assumed as mobile, so when any node shifts to other coverage limits, then the obtained session key will not work and it generates a request packet to the new gateway for mutual association and further authentication. Table 4 shows the general network attacks and the procedures of the proposed algorithm used to avoid them. In Figure 6a,b, the performance evaluation of the proposed algorithm is evaluated with other solutions for the packet delivery ratio. It can be computed as the ratio of the number of delivered packets to the total number of transmitted packets from the source node to the destination node. It is seen that with a varying number of nodes and rounds, the proposed algorithm increases the packet delivery ratio by an average of 18% and 17%. This is because the proposed algorithm utilizes the route rank function to estimate the aggregate condition of the devices. Unlike QL-MAC and CTEER solutions, the proposed algorithm periodically judges the situation of the mobile devices in terms of speed, coverage ratio, and packets information, and supports robust IoT-based routing development. Accordingly, it offers the most reliable neighbors for the selection of routing states. Moreover, the proposed algorithm utilizes the position of mobile sensors to balance the load among devices, thus ultimately increasing the delivery performance towards the sink node. Additionally, the sensing range is exploited by the route rank function to incorporate the high node density option in \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline Simulation area & 300 \(\times\) 300 m \\ Deployment & Random \\ Propagation Model & Two Ray Ground \\ Node speed & 5 m/s \\ Pause time & 20 s \\ Malicious nodes & 10 \\ Simulations & 10 \\ Regular nodes & 100-500 \\ Initial energy & 5 j \\ Transmission range & 10 m \\ MAC layer & IEEE 802.11 b \\ Mobility model & Random waypoint \\ Simulation rounds & 500–2500 s \\ Data traffic & CBR \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Simulation configuration. routing decisions. The proposed algorithm makes use of multi-hop mode for forwarding the network data rather than single-hop mode, and gateways perform the intermediate roles among mobile sensors and the sink node. Such an approach efficiently exploits the coverage option and robust connectivity among deployed devices and network applications. \begin{table}
\begin{tabular}{p{113.8 pt} p{113.8 pt}} \hline \hline
**Security Attacks** & **Proposed Procedures** \\ \hline Device authentication & Unique ID \\  & Session keys \\ \hline Session key security & Encryption \\ \hline Verification & Decryption using symmetric key \\ \hline Confidentiality & Ciphered data using the session-oriented encryption \\ \hline Malicious nodes regenerate request packet for session key & ID and session key expire automatically \\ \hline Storage overload & Distributed data chunks and diffusion \\ \hline Connectivity loss & Reinforcement learning \\ \hline Additional resources’ consumption & Computing route rank \\ \hline Network load & Distributed forwarding \\ \hline Data originality & MAC, Digital hashes \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Security attacks and their related procedures.