## 5 Priority-Based Data Delivery  
This phase includes application, routing, queuing, and neighboring node modules. The application module categorizes the incoming data packets into control and data packets, respectively. Data traffic is determined based on QoS demands. The packets can be classified as (i) reliable, (ii) normal, (iii) delayed, and (iv) critical. Control packets are transmitted to neighboring nodes such that every node locally updates the neighbors with the routing decision. If a packet of data is broadcast, this application module enables the following routing module to establish a route based on packet type. The queuing module is responsible for allocating priority to every packet before sending the packet for channel access. The application module utilizes a traffic categorization module as presented in Figure 3. The neighboring node module observes the forwarded packet to share details of node quality and node state among its neighbors. The routing module is responsible for the selection of optimal routes based on the attributes of neighbors that represent node quality. The selection of nodes and CH will be based on the clustering technique and FF. The queuing module is responsible for categorizing packet priority into two types: (i) RT and (ii) NRT queues. Delay-sensitive packets are assigned high priority and are put into the RT queue. The remaining classes of data packets are put into the NRT buffer. The attempt to categorize incoming packets into real and NRT buffers produces reduced latency for data packets within a pre-defined time. Further, the queuing model uses a first-in-first-out (FIFO) procedure for assigning priority to packets. This reduces delays in the data traffic as in Figure 4.  
Table 2 shows the type of data traffic in WSNs. Data traffic is classified into four types, namely 'C1', 'C2', 'C3', and 'C4', where 'C1' represents high RT traffic that demands less delay and high reliability as it is associated with critical tasks, 'C2' represents scalarRT packet traffic that requires packet delivery within a pre-defined time for the packet's arrival at the sink, 'C3' represents scalar NRT packet traffic that demands delivery without any pre-defined time but permits an acceptable packet loss for the periodic monitoring of applications, and 'C4' represents best effort (BE) traffic without any particular requirements. Figure 4: Network traffic classification model. Figure 3: Traffic categorization module  
Priority-based data delivery allocates priority to every packet that is forwarded in the communicating medium depending on the traffic type. A multi-queuing priority policy is established to enable the nodes to construct several queues of priority for various classes of traffic by assigning a dissimilar level of importance to each class in a service policy. Every queuing model contains a particular value of threshold for the incoming packets based on the priority queues that handle network congestion effectively and also enhance the overall network performance. The data types involve several levels of importance and quality and therefore include diverse priorities in routing data packets. Hence, to fulfill several QoS parameters based on diverse classes of data, every class is assigned a level of priority, and every packet type should be handled in a different way based on the allocated priority. Further, traffic categorization can be used as a basis for making routing decisions. The overall delay involved in data packets includes delays associated with transmission, queuing, propagation, and processing. Transmission delay varies with the size of data packets and the data rate of nodes computed from the time of transmission of the opening bit of data to that of the last bit. Queuing delay is the difference in time between the data packet entering the queue and the time of transmission. In cases where the data transmission from a communicating link is higher, the waiting time of the packet will be extended. The propagation delay is usually ignored as it is too short.