## 5 Priority-Based Data Delivery
It relies on the physical features of the communicating medium. The processing delay is the variance in time between when the packet is obtained in the receiving queue and the time the packet is moved to the transmit queue. In cases where there is an increase in network congestion, the overall delay increases, thus influencing the performance of routing to a greater extent. To overcome these issues, a queuing model that categorizes packets based on priority, either as real- or non-real-time, is included in the proposed system. The responsibility of the traffic classification model is to determine the class of the arriving data packets and forward them to the respective queue. The packets arriving in 'C\({}_{1}\)' and 'C\({}_{2}\)' with a pre-defined time period are given high priority and put in the RT queue, and those in 'C\({}_{3}\)' and 'C\({}_{4}\)' are moved to the NRT buffer. To control the data packets so that they are in the right queue based on queuing policy priority and data type, a packet scheduler is designed as shown in Figure 5. \begin{table}
\begin{tabular}{l l} \hline
**Parameters to Be Observed** & **Type of the Packet Traffic** \\ \hline Scalar data (Pressure, Heat) & RT traffic \\ \hline Scalar data (Humidity) & NRT traffic \\ \hline Periodic monitoring of videos & NRT traffic \\ \hline Tracking of image/videos & RT traffic \\ \hline \end{tabular}
\end{table} 
Table 2: Type of data traffic in WSNs. \begin{table}
\begin{tabular}{l l l l l} \hline
**Fitness Factor** & \(\mathbf{C_{1}}\mathbf{C_{2}}\) & \(\mathbf{C_{3}}\) & \(\mathbf{C_{4}}\) & \\ \hline \(N_{RE}^{i}\) & High & Average & High & Same \\ \hline \(Trust_{xy}^{*}\) & High & Average & High & Same \\ \hline \(T_{dist}\) & High & High & Low & Same \\ \hline \(T_{s}^{k}\) & Average & Low & Average & Same \\ \hline \end{tabular}
\end{table} 
Table 3: Importance and weight levels. It is assumed that the size of every queue is assigned a threshold value, \(Thr\). A queue with priority 'a' for a node 'k' includes data packets with lower priority \((NQ_{L})_{k}\), those with the same priority \((NQ_{a})_{k}\), and those that are critical \((NQ_{c})_{k}\). If a packet \(P\) arrives at the \(m\)-th queue \(Q_{m}\) at node \(k\), the anticipated wait time \(WT\) computed [11] is decided based on the following: (i) the residual time for a packet that is served currently for delivery \((rt[cur]_{k})\), (ii) the servicing time for arriving packets with high priority or the same priority \((NQ_{a})_{k}+(NQ_{c})_{k}\), and (iii) the delivery-based servicing time for the arriving packets of high priority in the course of the packet's wait time (\(wt[NQ_{b}^{k}]\)). The number of incoming data packets is less than the threshold (Thr). Hence, the overall anticipated wait time for a packet (P) is given by  
\[[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}\]  
According to Equation (18), the traffic classifier decides on the transmission of data packets as follows: '\(C_{1}\)' is allotted the highest priority, followed by '\(C_{2}\)', '\(C_{3}\)', and '\(C_{4}\)', which is given the lowest priority. As shown in Figure 6, the queue model involves a particular queue size for every type of packet, thus effectively managing the throughput of every data class. So as to realize RT data transmission within a particular time period, the proposed scheme fixes a bandwidth ratio (br) that denotes the amount of bandwidth to be dedicated to '\(C_{1}\)' and '\(C_{2}\).' The value of 'br' is employed to compute the service rate for '\(C_{1}\)' where '(1-br)' denotes the transmitting rate of '\(C_{2}\).' In order to realize the real-time data transmission within a particular time period, the proposed scheme fixes a bandwidth ratio br, which denotes the amount of bandwidth  
Figure 5: Traffic categorization model. Figure 6: Service rate and size of queue in a node. to be devoted to the parameters C1 and C2.