GeoBroker: A pub/sub broker considering geo-context information

Abstract The majority of today’s pub/sub brokers only focus on data content when deciding where to distribute data. In this paper, we introduce the GeoBroker pub/sub broker software that additionally considers the geo-context associated with data producers and consumers. As a result, data consumers only receive relevant messages which preserves bandwidth and compute power while data producers can use the geo-context of clients to control data distribution, e.g., for enhanced privacy or as an alternative to credential-based authentication.


Introduction
Most data generated by IoT devices are only relevant to data consumers in a particular physical area [1]. Yet, the majority of pub/sub brokers available today only focus on data content when deciding where to distribute data. As a result, data consumers have to locally process and filter vast amounts of irrelevant messages. in its immediate vicinity. Data producers, on the other hand, can specify that their data should only be delivered to consumers within a specified geofence, e.g., to prevent data misuse or as an alternative to credential-based authentication.

GeoBroker software
The GeoBroker software offers a similar functionality and operational behavior as other software systems used to distribute IoT data. A general requirement for such a system is that it supports loosely coupled communication between clients that do not have to know each other [4]. Furthermore, the software should be lightweight, payload agnostic, and usable by devices that operate in a constrained environment. For these reasons, GeoBroker as well as other popular software solutions such as AWS IoT 1 or Google Cloud IoT 2 rely on the topic-based pub/sub messaging paradigm.
On a very high level, the GeoBroker architecture comprises two components (see Fig. 1): a communication manager and a subscription manager. The former is responsible for maintaining communication links with the clients that use GeoBroker for distributing and receiving messages (see also Section 2.1). The latter is responsible for message matching, i.e., it determines which clients should receive a given message (see also Section 2.2). All GeoBroker components, as well as the example clients provided along the GeoBroker software, are implemented in a mixture of Java 8 and Kotlin 1.3.

Interacting with GeoBroker
To ease integration into existing IoT applications, GeoBroker's operational behavior is very similar to other MQTT-v5.0-compliant [5] pub/sub brokers, i.e., which follow a widely used pub/sub protocol. Thus, GeoBroker's message types are very similar to the ones of vanilla MQTT, but we piggyback the information needed for the geo-context based data distribution on top of existing messages. 3 Clients can connect and ping GeoBroker (on top of these messages, we piggyback client locations), subscribe/unsubscribe to MQTT compliant topics (on top of subscribe messages, we piggyback information on where data producers have to be located), and publish messages to MQTT compliant topics (on top of publish messages, we piggyback information on where data consumers have to be located). When disconnecting from GeoBroker, all active client subscriptions are removed. 1 https://aws.amazon.com/iot/. 2 https://cloud.google.com/solutions/iot/. 3 Note, that while the message types are similar, we use a more human readable message encoding scheme (JSON) than defined by the MQTT protocol.

Message matching process
The GeoBroker subscription manager component uses content and geo-context information to match incoming messages and active client subscription. This message matching process comprises three checks: Content Check, Consumer GeoCheck, and Producer GeoCheck (Fig. 2). When all three checks are successful for any of a client's subscriptions, GeoBroker delivers the incoming message to that client. The Content Check validates that the subscription topic matches the message topic as defined by the MQTT-v5.0 protocol [5]. The Consumer GeoCheck validates that the data producer, i.e., the client that published the incoming message, is inside an area defined by the data consumer, i.e., the client that created the respective subscription. The Producer GeoCheck validates that the data consumer is inside an area defined by the data producer.

Impact overview
GeoBroker is the first open source pub/sub broker that considers content and geo-context information of data producers and consumers when distributing messages. We have used the GeoBroker software and its underlying principles for two scientific publications [2,3]. By making it available as open source, however, GeoBroker can also become the basis for a new branch of pub/sub research that aims to make use of geo-contexts for additional purposes. For example, in [6], we describe a preliminary approach on how to use geo-context information for efficient rendezvous-based message routing between geo-distributed pub/sub broker instances. This approach builds upon the original Geo-Broker Software and is still under active development. The GeoBroker software can also be used to quickly prototype applications for dataintensive scenarios, especially in the Internet of Things, as our approach reduces the amount of irrelevant messages that are distributed and received by clients [3]. Because GeoBroker considers more geo-context dimensions than related approaches, e.g., [7][8][9], it can be used for a wider-range of application scenarios which require fine-grained control of data distribution, i.e., it can be used to control data distribution based on client locations, areas defined by clients, or both.
Furthermore, GeoBroker comprises a novel indexing structure that allows us to quickly retrieve all areas that contain a given location (needed for the Consumer GeoCheck). Beyond its use inside a pub/sub system, this index data structure has been proven useful for other purposes: it is part of the data analysis pipeline of the SimRa project [10] where near miss incidents in bicycle traffic -recorded with the usual GPS accuracy -need to be mapped to the corresponding street segment or intersections.

Conclusion
In this paper, we introduced the pub/sub broker software GeoBroker. GeoBroker considers the geo-context associated with data producers and consumers when distributing messages. As a result, data consumers receive only relevant messages which preserves bandwidth and compute power. Data producers, on the other can, can use additional ways to control data distribution for enhanced privacy or as an alternative to credential-based authentication.

Declaration of competing interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper. Only if an incoming messages passes all three checks for a given subscription, GeoBroker delivers the message to the subscription's client.