## 5 Priority-Based Data Delivery
This value of br is employed to compute the service rate for C1, where (1-br) denotes the transmitting rate of C2. **Queuing and Average Delay Computation**  
To determine the optimal path based on QoS parameters that satisfy the needs for every traffic type, computation of the queuing buffer along with the average delay is essential. The total load on a node 'a' is determined as shown below. \[(T_{s})^{m}=PI_{m}\cdot SN_{m}+\sum_{m}^{l}(l|m)\cdot\lambda_{n} \tag{19}\]  
\[(\lambda_{a})^{m}=\frac{D_{l}}{D_{r}}+\text{tim}_{BOT} \tag{20}\]  
\[\text{tim}_{BOT}=r(\text{tim}_{CCA})+\sum_{d=0}^{r-1}\text{tim}_{BOA}(\text{d MinBE}+d,\text{dMaxBE}) \tag{21}\]  
where \(PI_{m}\) represents the data packet interval, \(SN_{m}\) represents the sourcing node, and \((l|m)\lambda_{n}\) represents the service rate for the neighboring nodes for transmitting data packets, \(D_{l}\) represents the data length, \(D_{r}\) represents the data transmission rate, \(\text{tim}_{BOT}\) represents the time for back-off, which relies upon the channel load, \(\text{tim}_{BOA}\) represents the number of back-off attempts, \(r(\text{tim}_{CCA})\) is the amount of time with clear access to the channel, \(d\) represents the maximum number of attempts for back-off before decline, the value of \(\text{dMaxBE}=5\), and the value of \(\text{dMinBE}=3\). According to Equations (19)-(21), the data load in a node increases when a node receives data from diverse neighboring nodes. Such an increase in data load results in network congestion, while the service rate of a node that forwards data packets is lower when compared with the interval of the arriving packets. Congestion leads to packet loss due to failure in accessing the channel or the capacity of the buffer overflowing beyond the pre-determined threshold value. The overall queuing delay in node 'a' is calculated as shown below. \[(queue)^{m}=\frac{(Load)^{m}}{(\lambda_{a})^{m}}=\frac{\text{PI}_{m}\cdot \text{SN}_{m}+\sum_{m=0}^{l}{(\lambda_{m})\choose(\lambda_{a})^{m}}}{(\lambda_ {a})^{m}} \tag{22}\]  
The queue length for a node is determined as shown in Equation (18). In cases where the packet quantity increases beyond the queue length and its value exceeds the threshold value, the packets will be dropped as follows:  
\[\text{pktdrop}=\frac{\text{PI}_{m}\cdot\text{SN}_{m}+\sum_{m=0}^{l}{(\lambda_ {m})\choose m}}{(\lambda_{a})^{m}}>\text{Thr}_{h} \tag{23}\]  
where \(\text{Thr}_{h}\) is the threshold value that keeps the data packets in the queue and \((\lambda_{a})^{m}\) refers to the RT data transmission rate of a node. The presented protocol allocates a high service rate to the RT traffic categories \((\lambda_{a})^{m}\) when compared with that of the non-real-time classes \((1-\lambda_{a})^{m}\). Considering that the RT service rate \((\lambda_{a})^{m}\) is equal to \(n(1-\lambda)^{m}\), the proposed protocol drops the packet dropping ratio for RT packets as shown in Equation (24). \[\text{droprate}=\frac{\text{PI}_{m}\cdot\text{SN}_{m}+\sum_{m=0}^{l}{(\lambda _{m})\choose m}}{(\lambda_{a})^{m}} \tag{24}\]To ensure the reliable delivery of RT data packets to the sink from the source, the average queuing delay for a specific path'm' can be computed as follows:  
\[[WT]^{k}=rt[\text{cur}]^{k}+\sum_{a,c,b=0}^{Thr}\Big{(}(NQ_{a}^{k}),(NQ_{c}^{k} ),(NQ_{b}^{k})\Big{)} \tag{18}\]0  
\[[WT]^{k}=rt[\text{cur}]^{k}+\sum_{a,c,b=0}^{Thr}\Big{(}(NQ_{a}^{k}),(NQ_{c}^{k} ),(NQ_{b}^{k})\Big{)} \tag{18}\]1  
According to Equations (22)-(26), the hop count, or the distance between the node and sink, influences the average delay. As long as the node is in proximity to the sink, it involves less hopping delay and will be a highly beneficial node for delivering RT data packets.