# Empirical Evaluation of TLS-Enhanced MQTT on IoT Devices for V2X Use Cases
## 3 MQTT and V2X Use Cases  
MQTT is a lightweight publish/subscribe application-layer protocol widely adopted in vehicular networks and the broader IoT landscape, due to its efficiency in wireless environments with limited bandwidth, high latency, or unreliable links. Operating over TCP/IP (Transmission Control Protocol/Internet Protocol) and supporting TLS and MQTT ensures secure, connection-oriented message delivery. Its support for encryption, authentication, and configurable QoS levels makes it well suited for V2X scenarios, where data integrity, confidentiality, and reliability are essential. In this context, MQTT messages can include vehicle status updates (e.g., location, speed, and direction), hazard alerts (e.g., accident or obstacle warnings), or traffic light states broadcast by infrastructure units. Designed for machine-to-machine (M2M) communication, the protocol defines three core roles, as shown in Figure 2: the publisher, the subscriber and the broker. The publisher generates messages tagged with specific topics and transmits them to the broker. For example, an ambulance serving as a publisher can transmit real-time data such as speed, location, or emergency alerts. Subscribers express their interest in one or more topics and receive messages matching their subscription criteria. There is no direct communication between subscribers and publishers, but instead they rely on the broker to forward relevant messages. For example, nearby vehicles or pedestrians may subscribe to receive hazard notifications. The broker acts as the central coordinator, receiving messages from publishers, filtering them by topic, and forwarding them to matching subscribers. In smart V2X environments, the publisher and subscriber roles can be adopted by vehicles, infrastructure components (e.g., traffic lights), or other IoT devices, while the broker is typically but not exclusively an RSU. Vehicle to Everything encompasses subdomains such as Vehicle to Infrastructure (V2I), Vehicle to Vehicle (V2V), Vehicle to Network (V2N), and Vehicle to Pedestrian (V2P). In V2I use cases, MQTT enables low-latency, topic-based publish/subscribe communication between vehicles and infrastructure nodes. Infrastructure elements, such as traffic lights and RSUs, typically act as publishers, broadcasting data such as Signal Phase and Timing (SPaT), while vehicles operate as subscribers, receiving this information via an MQTT broker that orchestrates message dissemination and topic filtering. Conversely, vehicles may operate as publishers, transmitting real-time telemetry such as speed and GPS (Global Positioning System) coordinates. In this case, RSUs or traffic control centers are subscribed to these streams for adaptive control or analytics via an MQTT broker. Only authenticated entities publish or subscribe, and all message payloads must be protected against tampering and eavesdropping to preserve data integrity and confidentiality [33]. MQTT also supports event-driven use cases, such as hazard alerting and vehicle prioritization, in V2I contexts. For example, when an RSU or On-Board Unit detects a hazardous road condition (e.g., icy surface and construction zones), it acts as a publisher, transmitting alerts to specific MQTT topics. The RSU, serving as the broker, regulates message dissemination and enforces topic-based access control. Nearby vehicles subscribe to these topics and receive real-time alerts that enhance driver awareness and road safety [27]. Similarly, emergency vehicle priority systems demonstrate the suitability of MQTT for time-critical applications. The approach described by [PERSON] et al. [34] presents a case study in which C-V2X (Cellular V2X) is used to transmit emergency alerts. In this scenario, vehicles near an incident (e.g., accident) act as publishers, sending alerts to a central authority (such as police, ambulance, and fire department), serving as the broker, which then relays the message to nearby vehicles potentially affected by the incident and functioning as subscribers.