## 4 Task/Transmission Scheduling and Communication Protocols
### Communication Protocols  
In real-time IoT systems, in addition to the described task scheduling techniques, the use of appropriate types of transmission media and the implementation of proper communication protocols, with particular emphasis on routing protocols, also play important roles. Some well-known routing protocols to consider when designing RTIoT solutions are: RSTP (Real Time Streaming Protocol), WebRTC (Web Real Time Communication), XMPP (Extensible Messaging and Presence Protocol), MQTT (Message Queue Telemetry Transport), CoAP (Constrained Application Protocol), WebSocket, and 6 LoWPAN (IPv6 over Low-Power Wireless Personal Area Networks). The RSTP is an application layer protocol for the control, transmission and delivery of data while maintaining real-time transmission criteria. The most common implementations of this protocol are systems used to transmit voice and video in real time. Data are continuously delivered, even when RTSP requests are not received by the server. A new area in which this protocol is being applied is the technology area of the teaching of language, which includes listening, speaking, reading and writing [97]. Another protocol implemented in real-time IoT systems is WebRTC. Its most common applications are solutions for transmitting video images or streaming data in the broadest sense while achieving the lowest possible levels of latency and data transmission loss, as exemplified by applications for voice transmission and videoconferencing. Research [98] conducted in the area of the WebRTC protocol indicates that it yields better response times and connection stabilization times in web applications compared with other streaming protocols such as the RTSP [99]. In addition, from the point of view of QoS parameters and energy consumption, the implementation of the WebRTC protocol allows one to achieve better values, which translates into meeting the real-time transmission requirements of solutions implemented in IoT systems. The XMPP protocol, on the other hand, is based on XML [100]. The protocol is commonly available and can be freely modified, and many XMPP servers are available [101]. This translates into its main use being implementations in systems and applications for exchanging text-based content such as popular instant messaging applications. The simplest and lightest protocol for real-time data transmission is the MQTT protocol, which is based on the publish/subscribe pattern. It is designed for transmission for devices that do not require a high throughput. By limiting the transmission speed, the protocol provides a greater reliability. The protocol is perfect for IoT machine-to-machine connections, mobile devices, and where throughput and energy savings are required. By using this protocol, one can easily transfer data during a conversation from one device to another and continue the conversation [102]. An example of a protocol that uses the UDP protocol for communication and is also applicable to RTIoT systems is the CoAP protocol. It has been optimized for constrained devices and networks (used in wireless sensor networks) [103]. The CoAP protocol extends the paradigm of ubiquitous web services in mobile applications to IoT and M2M solutions, which can then be developed using shared and reusable RESTful web services. In doing so, this protocol considers IoT constraints and requirements or QoS requirements [104]. A two-way data exchange channel over a single TCP connection is provided by the WebSocket protocol. The protocol is designed to operate on ports 80 and 443, similarly to HTTP, allowing for interactions between a web browser (or other client application) and a web server at a lower load than alternatives while making it much easier to transfer real-time data to and from the server, which is an asset when considering its use in IoT systems [105]. Thanks to the previously mentioned interactions between the web browser and the server, the protocol has found applications in the development of online games, particularly [106].