Book Image

Learning Internet of Things

By : Peter Waher
Book Image

Learning Internet of Things

By: Peter Waher

Overview of this book

<p>This book starts by exploring the popular HTTP, UPnP, CoAP, MQTT, and XMPP protocols. You will learn how protocols and patterns can put limitations on network topology and how they affect the direction of communication and the use of firewalls. Thing registries and delegation of trust are introduced as important tools to secure the life cycle of Things on the Internet. Once the fundamentals have been mastered, your focus will move to the Internet of Things architecture. A secure architecture is proposed that will take full advantage of the power of Internet of Things and at the same time protect end user integrity and private personal data without losing flexibility and interoperability.</p> <p>This book provides you with a practical overview of the existing protocols, communication patterns, architectures, and security issues important to Internet of Things.</p>
Table of Contents (16 chapters)
Learning Internet of Things
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 5. The MQTT Protocol

One of the major problems we encountered when we looked at the HTTP, UPnP, and CoAP protocols is how to cross firewall boundaries. Firewalls not only block incoming connection attempts, but they also hide a home or office network behind a single IP address. Unless the firewall blocks outgoing connections, which it does only if explicitly configured to do so, we can cross firewall boundaries if all the endpoints in a conversation act as clients to a common message broker that lies outside of the firewall and is therefore accessible to everybody. The message broker acts as a server, but all it does is relay messages between clients. One protocol that uses message brokers is the Message Queue Telemetry Transport (MQTT) protocol.

In this chapter, you will learn the following concepts:

  • The basic operations available in MQTT

  • How to publish data using MQTT topics

  • How to subscribe to MQTT topics

  • How to implement MQTT in the sensor, actuator, and controller

    Tip

    All of the source...