## 4 On-Board Unit Implementation
### V2X Communication Protocols  
The OBU exchanges two types of ETSI ITS compliant messages with the backend: periodic CAMs and event-triggered DENMs. Towards this, our OBU supports two types of V2X protocols to be compatible with commercial OBUs of vehicles of OEM A and OEM B, respectively, as defined in the ACCA architecture in Section 3. The first V2X protocol consists of a combination of HTTP and UDP. The HTTP protocol is used for authentication and subscription of the vehicles with the backend, primarily employing POST messages towards the REST API provided by the Edge Geoserver. CAMs and DENMs are encoded according to their respective ASN.1 format [26; 27], and they are transmitted as ETSI ITS compliant GeoNetworking messages encapsulated in a UDP packet. The second V2X protocol is based on MQTT with CAMs and DENMs being encoded in JSON format. MQTT is a lightweight simple messaging protocol that is based on a publish-subscribe mechanism that runs over TCP/IP. MQTT is designed for memory-constrained and low-bandwidth devices and it is extensively used in Internet-of-Things applications. A server named MQTT broker is responsible for the distribution of messages between multiple clients connected to the broker. The information is organized in topics. When a client has a new message to distribute, it publishes the message on a certain topic and the MQTT broker then transmits the message to any clients that are subscribed to that topic. Topics are hierarchical in nature and resemble a file path. A client may subscribe to topics specifying part of such path as well as using wildcards. In the ACCA service architecture that is depicted in Figure 1, the messages exchanged between different clients are belonging to either inQueue topic or outQueue topic roots. The inQueue topics (e.g., in-Queue/v2x/denm/source_id/roi) are used to publish messages from OBUs towards the  
Figure 4: Basic hardware components of the OBU. Edge Geoservers, and from the Edge Geoservers towards the TMS. The outQueue topics (e.g., outQueue/v2x/denm/source_id/roi) are used to publish messages from the TMS towards the Edge Geoservers and from the Edge Geoservers towards the OBUs. We leverage the Quadkeys [34] based approach to represent ROIs as hierarchical topics, commonly referred to as hierarchical binning. In a nutshell, each key is represented a unique tile in the QuadTree geo-tiling grid, in which the grid can recursively be divided into four equal parts until it reaches the threshold number of events in a tile. It is worth noting that the information distributed over MQTT is ETSI ITS fully compliant CAM and DENM messages, which include the same information as the ASN.1 encoding but in JSON format. A CAM message in JSON format encompasses a header with metadata about the message, including protocol version, station and message identifiers and a basic container object with station type, geographic coordinates (longitude, latitude, altitude) values and confidences. A high frequency container includes information regarding the heading, speed, driving direction, and dimensions of the vehicle. A low frequency container may include additional information like lights or path history and trajectories. A DENM message in JSON format contains a management container with an originating station id, and data about a given event (location and information about the event, such as its geographic location, validity duration, and transmission interval). Optional containers (situation, location) provide information regarding the speed and heading and a trace history. Listing 1 shows an extract of a such JSON encoded ETSI ITS fully compliant ASN.1 DENM message.