# Enabling Trustworthy Multicast Wireless Services through D2D Communications in 5G Networks
## 4 The Proposed eCMS-sD2D Protocol
To verify the origin of data, it also checks the signature \(\sigma_{1}\) and, if it is valid, data are accepted. Otherwise, it is possible that data may have corrupted. In this case, \(UE_{i}\) must send to eNB a _beacon_ in order to report the fabrication of the original data and to allow it to identify the attacker:  
Figure 2:1  
The beacon must be sent within the timestamp \(T_{i}^{\prime}\), which satisfies the condition \(T_{i}^{\prime}<T_{i}+\Delta T\), where \(\Delta T\) is the time interval, starting with \(T_{i}\), where the eNB is willing to wait for feedback from \(UE_{i}\). Thanks to Equation (16), the eNB must keep track of any malicious behavior of users. If beacon arrives during the time interval \(\Delta T\), the eNB first checks the validity of \(\sigma_{1}\) and, if it is invalid, it is judged that data are not the original ones and may be fabricated by the transmitter. Thus, the eNB also verifies the validity of \(\sigma_{2}\) to ensure that the fake message comes from the entity corresponding to \(PID_{j}\). A malicious behavior amount (MBA) counter is stored by the eNB for each user that does not transmit data correctly in the D2D communication. Thus, in the case of malicious behavior of \(UE_{j}\), the eNB increments by one its MBA counter. When a user's counter exceeds a given threshold, called the maliciousness threshold, the user is punished by the network, i.e., it is excluded from future communications. The maliciousness threshold belongs to the interval \([0,+\infty)\). Its value is of utmost importance in the evaluation of the performance of the proposed protocol, as it determines its degree of selectivity. A user \(UE_{k}\in N\) (where \(N\) is the set of registered users) can be chosen as RN only if its MBA value is less than or equal to the maliciousness threshold, i.e., the following condition must be verified:  
Figure 2:2  
This means that the value of the threshold represents the maximum number of malicious behaviors tolerated to allow a user playing the role of transmitter (i.e., RN) in D2D communication. When it is set to zero, only users with an MBA value equal to zero can be selected as RN, which means that selecting a malicious user is only possible if the user has never had malicious behavior in the past. As the value of the threshold increases, the algorithm is always less selective; this means that more users that, in the past, have already behaved maliciously can be chosen as RN. We highlight that the MBA counter is incremented only in the case that a certain malicious behavior is detected (i.e., in case the eNodeB receives a beacon message from a D2D receiver \(UE_{i}\) alerting a malicious behavior from RN \(UE_{j}\) and the eNodeB verifies that \(UE_{j}\) has actually served as a data transmitter). Thus, an increment in the MBA counter can not be due to misdetection of a malicious behavior. Thus, for low values of the maliciousness threshold, the goodput increase is not at the expense of maliciousness misdetection. Setting the maliciousness threshold to a value higher than zero (i.e., choosing a not too selective approach in the relay election procedure) could be useful in case a node turns its malicious nature to non-malicious. In fact, in case a node stops exhibiting a malicious behavior, it will no longer be selected anyway as a relay node in case the maliciousness threshold with a goodput increase that can be relevant in case the node is in good channel conditions and can serve as relay for a high number of neighbors.