# Empirical Evaluation of TLS-Enhanced MQTT on IoT Devices for V2X Use Cases
## 1 Introduction  
The Internet of Things (IoT) has grown rapidly in various sectors, including smart healthcare, precision agriculture, and Vehicle-to-Everything (V2X) communication, resulting in a sharp increase in the number of interconnected devices. A 2023 study estimated that IoT systems would have transmitted approximately 79.4 ZB of sensitive data over the following five years [1]. However, this scale also expands the potential attack surface, introducing new vulnerabilities that must be addressed. The need for security in IoT-based systems is particularly essential in smart vehicular ecosystems, where vehicles continuously exchange sensitive data with other vehicles, infrastructure elements such as Road-Side Units (RSUs), pedestrians, and cloud services. In such a context, the establishment of well-defined security specifications and the satisfaction of authentication, integrity, and confidentiality are critical to the development ofreal-world applications. For example, in scenarios involving hazard alerts notifications, synchronized (platooned) driving, and dissemination of information, security mechanisms and cryptographic primitives can ensure that only authorized entities can transmit messages (authentication) and that messages remain unmodified (integrity) while sensitive information stays shielded from unauthorized entities (confidentiality). These requirements highlight the need for security solutions that can be deployed in resource-constrained IoT environments, particularly within V2X communications. At the application layer of the IoT, lightweight messaging protocols such as MQTT (Message Queuing Telemetry Transport), CoAP (Constrained Application Protocol), and MQTT-SN (MQTT for Sensor Networks) have gained significant adoption in resource-constrained environments. Among these, MQTT is particularly favored for its efficiency, scalability, and minimal footprint [2]. Unlike CoAP, which operates over UDP (User Datagram Protocol) in a request-response model, MQTT leverages TCP (Transmission Control Protocol) and allows for asynchronous, decoupled interactions between publishers, brokers, and subscribers [3], a design that is particularly well suited to dynamic V2X environments, where network stability varies over time. A notable advantage of MQTT is its support for three levels of Quality of Service (QoS): QoS 0 (at most once delivery), QoS 1 (at least once delivery), and QoS 2 (exactly once delivery) [4; 5]. These QoS levels offer tunable trade-offs among latency, bandwidth usage, and delivery reliability, allowing applications to tailor their communication strategy based on message criticality. For example, routine telemetry or sensor data may use QoS 0 to minimize overhead, while mission-critical messages related to safety or coordination between vehicles may require the higher guarantees provided by QoS 1 or QoS 2. This flexibility is essential in V2X systems, where communication reliability requirements vary across message types. Several empirical studies further support the suitability of MQTT for secure and constrained deployment. [PERSON] et al. [5] compared MQTT and CoAP and observed that MQTT messages experience lower delays compared with CoAP messages when the packet loss rate is low, while when the message size is large and the packet loss rate is high, MQTT generates less overhead compared with CoAP, as TCP retransmits only the lost segments rather than the entire message. Moreover, [PERSON] et al. [4] examined both protocols under secure configurations (TLS for MQTT and DTLS for CoAP) and concluded that MQTT achieves lower message latency and more reliable delivery under wireless conditions. According to [PERSON] et al. [6], MQTT creates packets faster, and its transmission time is shorter compared with CoAP. Building on this foundation and considering the computational limitations of IoT platforms, our work focuses on the secure deployment of MQTT using Transport Layer Security (TLS). In the bibliography, [PERSON] et al.