The transport layer in the standard Internet ISO/OSI stack is between the Media and Application layers. Sometimes, it is a part of the so-called host layer protocols, composed of the top 4 layers: transport, session, presentation, and application.
In IoT protocols, it is commonly a part of the other layers, commonly networking. Besides pure IoT protocols, this book also contains regular internet ones (such as WiFi), so we briefly introduce the transport layer focused on the IP.
The transport layer is responsible for end-to-end communication and provides segmentation and aggregation mechanisms, error detection and correction, flow control, port-based addressing and quality of services. IP-based protocols use two kinds of connections:
TCP: connection-oriented mode, where the connection between endpoints is kept open for the whole transmission time, and it is possible to detect connection breaks and interferences. TCP ensures delivery, and this mechanism is built into the Transportation layer.
One can imagine a TCP connection as making a phone call: while connected, you can hear the other side's speech, breathing, and background noises to tell the connection is not dropped. A dropped phone connection can be sensed, e.g., by the termination signal or simply when there is silence and no replies from the other party. Similarly, in TCP, when there is no acknowledgement for a specific timeout or after some retries, the connection is considered dropped. This way, both endpoints will be aware of the state of the connection and can ensure the quality of service.\\Examples of services using this connection on the regular Internet are Web (HTTP), FTP, and SSH.
TCP is more complex than UDP in terms of both transmission and implementation.
UDP: connectionless mode, where the sender sends the data and “hopes” to let it be delivered to the receiver. There is no warranty for the message to have been delivered. Moreover, because of the routed nature of the connections, consecutively sent messages may be delivered partially, unordered, duplicated or not delivered at all. For this reason, error checking and correction and quality of service in UDP are implemented in higher layers (if any).
UDP is lightweight and, therefore, is typical for video streaming, e.g. video conferencing, in Internet applications. It is suitable when it is acceptable to lose some messages, e.g. in the multimedia transmission.
One can imagine UDP protocol as sending an SMS message: you simply “send and forget”, and your friend may reply to it, to acknowledge, or may not. Delivery time is not precisely known and can only be estimated.
UDP's implementation and use require fewer resources than TCP, so it is a better choice for constrained IoT devices and common in the networks connecting end node (edge class) devices.
A choice between UDP and TCP is driven by other network layers, e.g. some IoT network stacks do not provide TCP-like connections. Higher-level protocols also drive the selection of the transport layer connection standards, e.g. MQTT generally requires TCP while CoAP uses UDP; see the following chapters for details.
Popular IoT protocols may have a transportation layer embedded and merged with other layers, e.g. Zigbee protocol. In contrast, others follow regular ISO/OSI stack division into the 7 layers, as presented in figure 1.
Most IoT protocols use UDP, as it is easier to implement and more energy efficient regarding communication energy consumption, which is the primary factor to consider, e.g., in sensor networks.
en/iot-open/networking2/transport.txt · Last modified: 2024/11/03 14:21 by pczekalski