# Secure PD-NOMA with Multi-User Cooperation and User Clustering in Both Uplink and Downlink PD-NOMA
## 4 Simulation Results  
This section provides the performance analysis of the proposed algorithms (secure PD-NOMA, multi-user Cop-PD-NOMA, and user clustering strategy) in both uplink and downlink PD-NOMA systems. Both the downlink and uplink PD-NOMA are tested for a single cluster of four users, \(R_{1}\), \(R_{2}\), \(R_{3}\), and \(R_{4}\). Users' distances are in the order of \(d(R_{1})<d(R_{2})<d(R_{3})<d(R_{4})\). The performance of the four-user downlink PD-NOMA is depicted in Figure 6, where each user is assigned a power factor that is based on the distance from the gNodeB. Users who are closer to gNodeB are given minimum power, while users who are far away are given maximum power. Figure 6 shows that \(R_{1}\) has a higher BER than other users. This is due to the complexity of performing m-level (3-level) SIC to eliminate the effect of \(R_{2}\), \(R_{3}\), and \(R_{4}\) signals in order to retrieve the \(R_{1}\) signal. BER curves are obtained by averaging repeated simulation runs against different SNR values. Users achieve a threshold BER of \(10^{-3}\) at SNR values of: \(R_{1}\) at 19 dB, \(R_{2}\) at 17 dB, \(R_{3}\) at 16.2 dB, and \(R_{4}\) at 14 dB. Similarly, Figure 7 shows the BER performance for the four-user uplink PD-NOMA, because each user transmits at maximum power (\(P\)) with different channel gains in the uplink PD-NOMA. The received signal power is attenuated more for the users located at a greater distance with lower channel gains than the others. At the gNodeB, \(R_{1}\) signal is decoded first due to its high power, while other users' signals are decoded after the SIC operation to eliminate the high power signals. Figure 7 shows a threshold BER of \(10^{-3}\) is achieved at SNR values: \(R_{1}\) at 8 dB, \(R_{2}\) at 16 dB, \(R_{3}\) at 24 dB, and \(R_{4}\) at 29 dB. The proposed secure PD-NOMA technique is employed to protect the data from unintended users or eavesdroppers. We used Walsh and PN codes that are only known to gNodeB and registered users, such as \(R_{1}\), \(R_{2}\), \(R_{3}\), and \(R_{4}\). In Figure 3, the downlink scenario is tested for the proposed secure PD-NOMA communication. At the gNodeB, users' signals are combined into a single composite signal and multiplied with their secret code. The spread signal is received by the registered and unregistered users. The registered users (\(R_{1}\), \(R_{2}\), \(R_{3}\), and \(R_{4}\)) de-spread the composite signal correctly using their secret code. Post processing, such as SIC, is used to decode and eliminate the high-powered signals. On the other hand, \(E_{1}\) as an unregistered user is not capable of correctly decoding the composite signal due to a lack of the secret code. This way, the data can be protected during the MUD in the multiple access PD-NOMA technique. Figure 8 depicts the BER performance analysis for the proposed technique, where the BER curve for the \(E_{1}\) is a flat line, indicating that the data was incorrectly decoded at the \(E_{1}\) receiver. In the upl  
Figure 6: BER performance analysis of 4 users downlink PD-NOMA system. method is used to protect data so that it can be correctly decoded at the desired station, such as the gNodeB. Presently, we present the performance analysis of the proposed multi-user D&F Cop-PD-NOMA. A total of four users are served around the gNodeB. As shown in Figure 4, the positions of users' \(R_{1}\), \(R_{2}\), and \(R_{3}\) are less than half the distance to the gNodeB as the \(R_{4}\) position. Due to the greater distance, the \(R_{4}\) signal undergoes more attenuation as compared to other users. The BER performance of the proposed system is shown in Figure 9, where three users \(R_{1}\), \(R_{2}\), and \(R_{3}\) act as relay stations, transmitting the D&F signals for the user \(R_{4}\). The \(R_{4}\) performance greatly improves using this multi-user cooperation. The results are compared to single-user cooperation scenarios [23], in which the cell-center user assists the cell-edge user through D&F cooperation.