Introducing The Qest Broker: Scaling The Iot by Bridging MQTT and Rest
Introducing The Qest Broker: Scaling The Iot by Bridging MQTT and Rest
Introducing the QEST broker: Scaling the IoT by bridging MQTT and REST
Abstract—In the ”Internet of Things” (IoT) vision the 1) Firstly, in a several-billions network, a standard,
physical world blends with virtual one, while machine-to- machine-to-machine protocol is needed, so smart ob-
machine interaction improve our daily life. Clearly, how these ject developers could focus on functionalities, and this
virtual objects are exposed to us is critical, so that their user
interface must be designed to support the easiness of usage that protocol must be tailored to the machines needs.
is driven by the users’ needs, which is different from what 2) Secondly, it should be simple for people to interact
machines requires. These two requirements must be solved, with machines, usually through their handheld device;
and an integrated solution should emerge, if we want to bring the latest years in the mobile industry have shown how
the IoT to the 50 billions network that is predicted to became the communication should be engineered to support
in the next years.
We believe that these requirements cannot be met by the the user experience, and not vice versa.
same communication protocol, and so we propose a new kind In general the requirements of machines and people are
of broker, named QEST that can bridge the two worlds, distinctly different, and it may be hard to define a protocol
represented by their state-of-the-art protocols: MQTT and and the associated best practices to statisfy both of them.
REST. In this paper, we demonstrate that our approach allows
rapid development of user-facing IoT systems, while grating We propose a solution that, through the use of widespread
machines all the performance they need. patterns in two different areas, can solve the dilemma.
Keywords-Internet of Things, Web of Things, REST, MQTT, B. A case for the Web of Things
smart objects, publish subscribe
The ”Web of Things” (WoT) initiative envisions a world
I. I NTRODUCTION where devices are exposed using the lingua franca of
The last 20 years of research in the pervasive computing the Internet technologies: the World Wide Web [3]. The
area have seen very important steps towards the realization WoT architecture builds upon the Representational State
of Mark Weiser’s vision of ubiquitous computing [1]: a Transfer (REST) principles [4]: this paradigm envisions
world were technology vanishes in the background. a world where digitally enhanced objects (smart things)
The advent of the World Wide Web revolutionized the are accessible using Uniform Resource Identifiers (URIs)
way we work, communicate, socialize, and how business that can be exchanged, referenced and bookmarked. Even
is done: the Internet has become one the most pervasive further, Guilard et al. [3] propose a way to enable tech-
technology. Recently, smartphones and mobile broadband savvy end-users to create physical mashups. This approach
enabled us to carry the Internet in our pocket, seamlessy enables application developers to leverage their existings
integrating it in our lives. However, everyday objects remain skills (HTML, JavaScript, PHP, Ruby, Python) to build new
disconnected from the virtual world, while the ”Internet of ways to interact with objects , somewhat serendipitously.
Things” (IoT) movement is exploring how to interconnect Semantic discovery services, such as DiscoWoT [5], for the
them. This technology shift is supposed to be greater than Web of Things have also been proposed: thus enabling both
the advent of mobile phones, and in [2] a 2020 scenario humans and machines to semantically discover, select and
where non-phone interconnected devices will be 10 times use smart things.
the phone devices (50 vs 5 billions) is foreseen. The WoT as presently conceived, is structured as a huge
Service Oriented Architecture (SOA) [6], where each device
A. Scalability issues offers some services to the others. While this approach
Billions of interconnected devices is a challenge for the fits perfectly a business driven use case, it lacks the sup-
whole Internet and for the objects themselves, and in order port needed by the autonomous interaction between smart
to operate at that scale several major issues should be devices. In [3], the authors noted that in most pervasive
resolved. We identified two main scalability issues regarding scenarios, humans and machines are interested in real-time
communication: data, and not in syndication. While the HTTP protocol,
37
published. Obviously this is very far from HTTP syndication HTTP/MQTT Clients
model, so the broker sends the last published value to the
newly connect client. This is an important change because Load Balancer
it deviates from the pub/sub nature of the MQTT protocol.
38
state-of-art QEST-based
approach to IoT apps solution to IoT apps In the first scenario, we crafted a set of Arduino [15]
devices that switches on and off a led based on the state of
a common topic, which is modified by pressing a button on
Web App Web App
one of the devices. This allows us to trigger on and off all
the leds in our ”forest” by pushing the button of one of the
devices, or just from our web interface.
In the second scenario, we built a do-it-yourself temper-
Bridge
QEST ature monitoring for the house, and exposed the value on
a web page. Using this information, we were able to track
IoT and graph the temperature of the house.
Device
3 2 1 0 9 8 7 6 5 4 3 2 1 0
GND
SCL
AREF
SDA
1 1 1 1 DIGITAL
RX
TX
PWM
PWM
PWM
PWM
PWM
PWM
L
TX
Arduino UNO ON
Broker
RX
1
ICSP
RESET
IOREF
3V3
www.arduino.cc
POWER
5V Gnd Vin
ANALOG IN
0 1 2 3 4 5
V. E XPERIMENTAL RESULTS
The main point of evaluation of our solution is the easi-
ness of usage for software developers. Also, in order to show
Device that QEST does not penalize the performance1 we compared
3 2 1 0 9 8 7 6 5 4 3 2 1 0
GND
SCL
AREF
SDA
1 1 1 1 DIGITAL
RX
TX
PWM
PWM
PWM
PWM
PWM
PWM
TX
RX
Arduino UNO ON
1
ICSP
www.arduino.cc
RESET
IOREF
POWER ANALOG IN
3V3
5V Gnd Vin 0 1 2 3 4 5
39
applications, must be designed and developed. Developing
such a solution is out of the scope of our current work, but
we believe a mixed MQTT/REST solution might allow the
user to pair their devices with their data.
R EFERENCES
40
[6] D. Guinard, V. Trifa, S. Karnouskos, P. Spiess, and D. Savio, [13] “Node.js,” Joyent, Inc, April 2012. [Online]. Available:
“Interacting with the soa-based internet of things: Discov- http://nodejs.org
ery, query, selection, and on-demand provisioning of web
services,” IEEE Transactions on Services Computing, vol. 3, [14] A. Rudd, “MQTT.js,” April 2012. [Online]. Available:
no. 3, pp. 223–235, 2010. http://bit.ly/hO9cZP
[7] “MQ Telemetry Transport,” April 2012. [Online]. Available: [15] M. Banzi, D. Cuartielles, T. Igoe, G. Martino, and D. Mellis,
http://mqtt.org “Arduino,” April 2012. [Online]. Available: http://arduino.cc/
[8] S. Loreto, P. Saint-Andre, S. Salsano, and G. Wilkins, [16] “Really Small Message Broker,” April 2012. [Online].
“Known issues and best practices for the use of long polling Available: http://ibm.co/GQ7vwr
and streaming in bidirectional http. internet engineering task
forceprincipled design of the modern web architecture,” RFC [17] “Mosquitto,” April 2012. [Online]. Available: http:
6202, April 2011. //mosquitto.org
[9] “The WebSocket API,” World Wide Web Consortium [18] “EU investigating IoT regulations,” April 2012. [Online].
(W3C), April 2012. [Online]. Available: http://dev.w3.org/ Available: http://bit.ly/HyYSb2
html5/websockets/
[19] D. Giusto, A. Iera, G. Morabito, L. Atzori, C. M. Medaglia,
[10] “Webhooks,” April 2012. [Online]. Available: http://www. and A. Serbanati, “An overview of privacy and security issues
webhooks.org in the internet of things,” in The Internet of Things. Springer
New York, 2010, pp. 389–395.
[11] S. Sanfilippo, “Redis,” April 2012. [Online]. Available:
http://redis.io [20] “The OAuth 2.0 Authorization Protocol,” April
2012. [Online]. Available: http://datatracker.ietf.org/doc/
[12] “HAProxy,” April 2012. [Online]. Available: http://haproxy. draft-ietf-oauth-v2
1wt.eu
41