## 4 Task/Transmission Scheduling and Communication Protocols
### Static and Dynamic Task Scheduling Methods in Real-Time Systems  
Static task scheduling algorithms assume that before the target scheduling process, a set of input tasks is processed according to one of the specified sorting rules. These rules define how the input task array is sorted. With this approach, it is possible to determine which packages, criteria, or parameters in the IoT architecture will have the highest priority at the outset. Static task scheduling algorithms include LS (List Scheduling) mechanisms. In this group, we can distinguish the following sorting rules: LPT (Longest Processing Time), SPT (Shortest Processing Time), and RPT (Reverse Processing Time). In this case, the drawback of using list scheduling in real-time solutions is the additional overhead of executing the processes implemented in the sorting rules before the data packet is forwarded to the next network layers. This adversely affects packet delivery times, so meeting the goals of RTIoT solutions is difficult to implement [92]. Another popular static task scheduling algorithm is the Rate Monotonic Scheduling (RMS) method. This algorithm assigns priorities to individual tasks before they begin execution that do not change during the algorithm's run time. Priorities are assigned to each task by taking the frequency of their appearance into account (the task with the shortest period will have the highest priority). RMS is typically used to schedule single-processor tasks [93], which is a major limitation of it for the design of extended RTIoT solutions. On the other hand, its expropriation feature (the highest priority task is performed) is decent in terms of maintaining the best possible QoS performance and meeting real-time conditions.  
For dynamic scheduling in the context of the research presented in this article, it is worth considering the EDF (Earliest Deadline First) and LLF (Least Laxity First) algorithms. Real-time systems distinguish between two types of input data. The first type comprises data generated over certain fixed periods of time (e.g., traffic resulting from the functionality of the communication protocols used), and the second type comprises data generated as a result of actual events (e.g., data from various types of sensors). In IoT systems, which deal with data generated as a result of interactions taking place, the EDF algorithm [46] may find application in scheduling processes. In this solution, the value referred to as the deadline for each task is taken as the priority value, so the lower it is, the closer the deadline for a given task is. An additional advantage of the EDF algorithm over others is its good utilization of CPU resources and fairly fast response times, which, from the point of view of designing real-time IoT systems, can have key roles in ensuring adequate QoS parameters and other real-time requirements. Another example of a dynamic scheduling algorithm that can find application in a real-time IoT system is the LLF algorithm. It uses the deadline value, which, along with the time left to complete a given task, is used to calculate the laxity parameter used to prioritize the execution of individual tasks. In this case, the lower the value of laxity, the higher priority the task will be and the faster it should be completed [94]. A certain disadvantage of this algorithm is when there are many tasks with the same or similar laxity value simultaneously, the demand for computing power increases [95]. This represents a kind of limitation from the point of view of applications for RTIoT systems, since one of the priorities of IoT systems is to optimize their energy intensity [96]. On the other hand, however, the advantages of this algorithm include resistance to overloading, to which systems using the EDF algorithm are prone, which translates into the possibility of using it in the design and implementation of real-time systems [83]. Considering the above, it can be concluded that both EDF and LLF can be used for certain tasks in the design and implementation of RTIoT solutions.