# Device-to-Device (D2D) Multi-Criteria Learning Algorithm Using Secured Sensors
## 3 Proposed Multi-Criteria Learning Algorithm Using Secured Sensors
### D2D Authentication with Multi-Criteria Reinforcement Learning  
In the beginning, the devices build a table containing their neighbor information, which is saved in their memories. We consider that the devices are mobile, and they advertise their current address when they are away from their home network. In the table, each device maintains the neighbors' information, such as identity \(id\), distance, \(d_{i}\), residual energy, \(e_{i}\), and radio coverage limit, \(CR_{i}\), to next-level nodes. Moreover, as the devices are mobile, the proposed algorithm initiates the process of authentication using gateways, \(w_{i}\), by utilizing the session keys, \(K_{s}\). All the nodes are required to distribute the tokens, \(T_{k}\), at the beginning of data forwarding, which consists of identity, timestamp, and positioning coordinates. Additionally, the token is encrypted using the obtained session key, from device \(x\) to device \(y\). The session keys are temporary for a specific authentication process, and when the positioning coordinates of the devices are changed, the generated keys are revoked. Afterward, device \(x\) has to obtain a new session key from the proximity gateway for communication with its other peer devices. Each device generates a request with its id to the nearest gateway for mutual communication with a peer device. Upon receiving this information, the gateway constructs a record inside its table and generates a symmetric key \(sK\) for the peer devices over the secured channel. Later, both devices perform an encryption function, \(e\), to securely transmit the data packets \(m_{i}\) as defined in Equations (1) and (2):  
\[w_{i} \to x:\ e_{sK}\ \left(m_{i}\ \right)\ +d^{\prime} \tag{1}\] \[w_{i} \to y:\ e_{sK}\ \left(m_{i}\ \right)\ +d^{\prime} \tag{2}\]  
where \(d^{\prime}\) shows the digital signatures. On the other hand, the devices first verify the validity of the encryption blocks using digital signature, and afterward, the peer nodes perform a decryption function to recover the data packets. In the proposed algorithm, each device  
Figure 1: Development flow of the proposed algorithm. updates the information in the constructed table and makes an entry of the authorized device as well. In case any device is found faulty, then its entry is removed from the table by the source device. Most of the solutions [31; 32] utilize multiple parameters for data aggregation and route the data in the network system. The proposed algorithm uses the concept of multi-criteria evaluation for data aggregation and optimizing the learning procedure in terms of constraint resources. The learning procedure also makes use of radio coverage, nodes' mobility, and link cost to attain an energy-efficient and stable end-to-end communication system. In the proposed algorithm, each node obtains the information of the neighbor and utilizes the reinforcement learning technique for optimizing the intelligence process with nominal resources' consumption. The source node initiates the process for the selection of the next-hop based on the highest rank. This route rank, \(R(i)\), denotes the most optimal neighbor, \(i\), for decreasing the communication delay, energy consumption, and data disturbance, as defined in Equation (3):  
\[R(i)=re_{i}+\left(\frac{1}{s_{i}}\right)+CR_{i}+1/lcost_{i,j} \tag{3}\]  
where \(re_{i}\) is residual energy, \(s_{i}\) is speed, \(CR_{i}\) is radio coverage, and \(lcost_{i}\) denotes the link cost from node \(i\) to node \(j\). \(lcost_{i,j}\) is the integration of packet reception ratio, \(PRR\), and average delay time, \(ave_{dtime}\).