## 3 Proposed Framework
#### Scheme 1: M/D/1 with PU delay and non-pre-emptive priority model
Infinite buffer capacity is assumed, as for the non-pre-emptive priority with the PU delay scheme. In addition, this scheme does not incorporate the time delay, TD, prior to the start of a time slot, which differentiates it from the scheme in [4]. The average total waiting time of the tagged PU packet is determined by the sum of the mean service time and the combined service times of both PU and SU packets in the system. Furthermore, it experiences a delay of i occurrences prior to transmission, resulting in the following equation:  
\[W_{P}^{q(premp)}(d)=\frac{1}{2}\left(\frac{\lambda_{P}}{\mu_{P}^{2}}\right)+ \frac{N_{P}^{q}}{\mu_{P}}+\frac{i}{\mu_{S}},\ \forall\ d=i \tag{10}\]By applying [PERSON]'s theorem, we derive the following equation:  
\[W_{P}^{q(premp)}(d)=\frac{\frac{1}{2}\bigg{(}\frac{\lambda_{P}}{\mu_{P}^{2}}\bigg{)} +\frac{N_{P}^{q}}{\mu_{P}}+\frac{i}{\mu_{S}}}{1-\rho_{P}} \tag{11}\]  
Finally, an expression describing the average total waiting time for each PU packet is derived. \[W_{P}^{q(non-premp)}(d)=\frac{1}{2}\left(\frac{\frac{\lambda_{P}}{\mu_{P}^{2}} +\frac{\lambda_{S}}{\mu_{S}^{2}}+\frac{i}{\mu_{S}}}{1-\rho_{P}}\right) \tag{3}\]0  
where \(c_{p}\) represents the average time it takes to complete a task. The mean waiting time in the system for the tagged SU packet is determined by considering the mean service time, the average service times of all PUs and SUs present, and the service time of the marked packet. The outcome of this leads to the following mathematical expression:  
\[W_{P}^{q(non-premp)}(d)=\frac{1}{2}\left(\frac{\frac{\lambda_{P}}{\mu_{P}^{2}} +\frac{\lambda_{S}}{\mu_{S}^{2}}+\frac{i}{\mu_{S}}}{1-\rho_{P}}\right) \tag{3}\]1  
When [PERSON]'s theorem is utilized, it is expressed as follows:  
\[W_{P}^{q(non-premp)}(d)=\frac{1}{2}\left(\frac{\frac{\lambda_{P}}{\mu_{P}^{2}} +\frac{\lambda_{S}}{\mu_{S}^{2}}+\frac{i}{\mu_{S}}}{1-\rho_{P}}\right) \tag{3}\]2  
Finally, the derivation concludes with the expression for the average total waiting time of the SU. \[W_{P}^{q(non-premp)}(d)=\frac{1}{2}\left(\frac{\frac{\lambda_{P}}{\mu_{P}^{2}} +\frac{\lambda_{S}}{\mu_{S}^{2}}+\frac{i}{\mu_{S}}}{1-\rho_{P}}\right) \tag{3}\]3  
The mean completion time, denoted as \(c_{S}\), is represented by [13]. The mean cumulative waiting time for SU is provided as follows:  
\[W_{P}^{q(non-premp)}(d)=\frac{1}{2}\left(\frac{\frac{\lambda_{P}}{\mu_{P}^{2}} +\frac{\lambda_{S}}{\mu_{S}^{2}}+\frac{i}{\mu_{S}}}{1-\rho_{P}}\right) \tag{3}\]4  
Next, the assumption that there is only one slot for service time is utilized, and the equations for calculating the average total waiting time for both PU and SU are produced. \[W_{P}^{q(non-premp)}(d)=\frac{1}{2}\left(\frac{\frac{\lambda_{P}}{\mu_{P}^{2}} +\frac{\lambda_{S}}{\mu_{S}^{2}}+\frac{i}{\mu_{S}}}{1-\rho_{P}}\right) \tag{3}\]5  
\[W_{P}^{q(non-premp)}(d)=\frac{1}{2}\left(\frac{\frac{\lambda_{P}}{\mu_{P}^{2}} +\frac{\lambda_{S}}{\mu_{S}^{2}}+\frac{i}{\mu_{S}}}{1-\rho_{P}}\right) \tag{3}\]6  
The pseudocode presented below in Algorithm 1 describes the mechanism of user prioritization in CRN, where the capacity and service rate are the major factors that are considered. It can manage arrivals and departures, along with the capacity limitations at various levels so that the whole system is leveraged to the maximum degree while maintaining fairness between the PU and SUs.