## 4 Application-Aware (AA) Scheduling Approach  
The main contribution of this work is the application-aware (AA) scheduling approach, which modifies the current scheduling approach in real time to ensure the application's QoS requirements. Figure 1 shows the adopted system architecture, which consists of three planes: (i) the infrastructure plane, (ii) the control plane, and (iii) the application plane. The control plane contains the IT-SDN controller, which periodically receives the traffic data from the infrastructure plane, calculates the delivery rate and delay metrics, sends them to the application plane, and disseminates the new schedule to the network nodes. Two modules were added to the application plane: (1) the application manager module, which periodically receives the calculated metrics, checks if the application's QoS requirements are met, and asks the TSCH scheduler to assign adequate scheduling, and (2) the TSCH scheduler module, which calculates the new scheduling and sends it to the controller. To be aware of the application's requirements, the different planes of the adopted system exchange five types of control messages:  
* Statistical message: it counts the sent/received data messages, besides recording the message's arrival time. It is periodically sent from the sensor nodes and sinks to the controller. * Calculated metrics message: includes the calculated delivery rate and delay metrics for each of the considered applications. It is periodically sent from the controller to the application manager module. * Rescheduling request message: contains the number of timeslots that should be added to/removed from each application. It is sent from the application manager module to the TSCH scheduler module. * Rescheduling message: it is sent from the TSCH scheduler module to the controller and contains the new scheduling. * New scheduling message: it is sent from the controller to the network nodes and contains the new scheduling. We consider applications with four different priority levels, as Table 2 shows. The highest priority is assigned to the first application type, whereas the lowest priority is assigned to the last application type (type 4). The applications are classified depending on their delivery rate and delay requirements. Since control and data traffic isolation and the search feature [16] improved the network performance, we adopt these concepts in our proposed approach. Moreover, to speed up the network convergence, the control messages are transmitted in all the timeslots during the convergence period. After this period, the data messages start to be transmitted using Sch 0 scheduling, as Figure 2 shows. The first timeslot(s) are always reserved for the control messages. The slotframe size is selected to accommodate the additional applications and to prioritize the applications with harder requirements. In Figure 2b, where two applications are considered, nine timeslots (56.25% of the slotframe size) are assigned \begin{table}
\begin{tabular}{c c c c} \hline \hline \multicolumn{5}{c}{CooS Application’s Requirements} \\ \hline Application & Delivery & Delay & \\ Type & Rate & & \\ \hline Type 1 & ✓ & ✓ & Priority 1 \\ \hline Type 2 & — & ✓ & Priority 2 \\ \hline Type 3 & ✓ & — & Priority 3 \\ \hline Type 4 & — & — & Without priority \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Priority levels of the considered application types. Figure 1: Application-aware (AA) IT-SDN system. to Application 1, compared with six timeslots (37.5% of the slotframe size) assigned to Application 2. The application plane delivery rate and delay metrics are periodically calculated. Each sensor node periodically (according to the MCR value) sends to the controller the tuple (DS, TXt) that represents the number of the data messages sent (DSid) and the timestamp of the data message sent (TXt). Additionally, the sink periodically sends to the controller the tuple (DR, RXt), which similarly represents the number of data messages received (DRid) and the timestamp of the data message received (RXt).