# QoS-Aware Resource Management in 5G and 6G Cloud-Based Architectures with Priorities
## 2 Scheduler Priority Queue
### q Service Class Buffer Delay Analysis
Calculations on transition probabilities could be facilitated by applying the following lemma:  
**Lemma**: _transition probability \(Q_{(2,2)\rightarrow(1,2)}\) could be calculated as [14]:_  
\[Q_{(2,2)\rightarrow(1,2)}=\frac{2\mu_{n}}{2\mu_{n}+(\mu_{b}+2\mu_{d})+(\mu_{ b})}. \tag{5}\]  
**Proof of Lemma:** transition (2,2) \(\rightarrow\) (1,2) is a feasible transition only when service time of traffic classes p \(\big{(}T_{\mu n}\big{)}\) is less than the minimum class q service time between \(\Big{(}T_{\mu d}\), \(T_{\mu b}\Big{)}\) in state (2,2) and the remaining patience time \(\Big{(}T_{\mu b}\Big{)}\), that is:  
\[Q_{(2,2)\rightarrow(1,2)}=P\Big{(}min\Big{(}\Big{(}T_{\mu d},T_{\mu b}\Big{)},T_{\mu b}\Big{)}>T_{\mu n}\Big{)}\]However, for any arbitrary value of time t,  
\[P\Big{(}min\Big{(}\Big{(}T_{\mu d},T_{\mu b}\Big{)},T_{\mu b}\Big{)}>t \Big{)} =P\Big{(}\Big{(}\Big{(}T_{\mu d},T_{\mu d}\Big{)}>t\Big{)}\cap\big{(}T _{\mu m}>t\Big{)}\Big{)}=P\Big{(}\Big{(}T_{\mu d},T_{\mu d}\Big{)}>t\Big{)}\cdot P \big{(}T_{\mu m}>t\Big{)}\] \[=\Big{(}1-F\Big{(}T_{\mu d},T_{\mu d}\Big{)}\Big{)}\cdot\big{(}1-F \big{(}T_{\mu n}\big{)}\big{)}.\]  
According to our initial considerations and based on the typical queueing theory assumptions, arrival and service times follow the respective exponential distributions \(f(t)=ae^{-at}\) and \(F(t)=1-e^{-at}\), where a is the mean service or arrival rate. Hence,  
\[P\Big{(}min\Big{(}\Big{(}T_{\mu d},T_{\mu b}\Big{)},T_{\mu b}\Big{)}>t\Big{)}=e ^{-(2\mu_{d}+\mu_{b})\cdot t}\cdot e^{-\mu_{b}\cdot t}=e^{-(2\mu_{d}+\mu_{b}+ \mu_{b})\cdot t}\]  
Since \(T_{\mu n}\) follows exponential distribution with mean rate \(2\mu_{n}\) in state (2,2), then  
\[\mathbb{Q}_{(2,2)\rightarrow(1,2)}=\int_{0}^{\infty}2\mu_{n}\cdot e^{-2\mu_{ n}\cdot t}\cdot e^{-(2\mu_{d}+\mu_{b}+\mu_{b})\cdot t}dt=\frac{2\mu_{n}}{2\mu_{n}+2 \mu_{d}+\mu_{b}+\mu_{b}}\]  
Additionally, the Lemma has been proven. Based on this proof, all other transition probabilities can be calculated in the same way. Figures 4-6 feature further in-depth calculations:  
\[P_{i,j} =T_{yout/(i,1)\rightarrow(i,j)}\cdot P_{i,1}+T_{yout/(i,2) \rightarrow(i,j)}\cdot P_{i,2}I.\] \[\quad+T_{yout/(1,j)\rightarrow(i,j)}\cdot P_{1,j}+T_{yout/(2,j) \rightarrow(i,j)}\cdot I+\ldots+S_{Y_{in}\to i,j}\cdot Y_{in}\]  
A more compact way to represent the calculation of \(P_{i,j}\) is the use of a matrix representation technique, developed by [PERSON] and [PERSON] [PERSON] and [PERSON] (2015), which can replace the well-known Mason's rule when many repetitive calculations must be executed. \[P=T_{yout}\cdot P+S\cdot Y_{in}\Leftrightarrow W=P/Y_{in}=inv\big{(}I-T_{yout }\big{)}\cdot S\]  
where W is an N \(\times\) 1 matrix with N states in the Markoff state model and S an N \(\times\) 1 matrix declaring the transition probability from \(Y_{in}\) into any possible system state. Figure 3: The state diagram with queue to calculate \(T_{yout/(i,j)}\). \[Q_{(2,2)\rightarrow(1,2)}=P\Big{(}min\Big{(}\Big{(}T_{\mu d},T_{\mu b}\Big{)},T_{\mu b}\Big{)}>T_{\mu n}\Big{)}\]0 First case of transition from states (0,3) or (1,3) or (1,2) or (2,2) into state (0,2). \[Q_{(2,2)\rightarrow(1,2)}=P\Big{(}min\Big{(}\Big{(}T_{\mu d},T_{\mu b}\Big{)},T_{\mu b}\Big{)}>T_{\mu n}\Big{)}\]1 Second case of transition from states (1,3) or (2,3) or (1,2) or (2,2) or (2,1) into state (1,1).