|
IoT Protocols
the MQTTWhat are IoT Protocols?
IoT protocols refers to communication protocols which are one of the essential factors
of the IoT. The Internet of Things (IoT) has some unique features compared to other types
of networks, most notably it is a constrained network. This means that it is lacking in
bandwidth to support higher data rates and the requisite overhead burdens that normally
accompany traditional broadband networks.
The IoT needs standard protocols. The two messaging protocols MQTT and CoAP are
emerging as leading lightweight messaging protocols for the booming IoT market.
|
|
CoAP (Constrained Application Protocol)Constrained Application Protocol (CoAP) is an Internet application protocol for constrained devices (defined in RFC 7228). It enables constrained devices to communicate with the wider Internet using similar protocols. CoAP is designed for use between devices on the same constrained network, between devices and general nodes on the Internet, and between devices on different constrained networks joined by the Internet. CoAP is a client/server protocol and provides a one-to-one “request/report” interaction model with accommodations for multicast. CoAP is designed to interoperate with HTTP and the RESTful web through simple proxies, making it natively compatible with the Internet.MQTT (MQ Telemetry Transport)
It was created about 15 years back for monitoring remote sensor nodes and is designed to conserve
both power and memory. It is based on the ‘Publish/Subscribe’ communication model. Using MQTT,
a connected device can subscribe to any number of topics hosted by an MQTT broker.
It is an extremely simple and lightweight messaging protocol, designed for
constrained devices and low-bandwidth, high-latency or unreliable networks. The design principles
are to minimize network bandwidth and device resource requirements whilst also attempting to ensure
reliability and some degree of assurance of delivery. These principles also turn out to make the
protocol ideal of the emerging “machine-to-machine” (M2M) or “Internet of Things” world of connected
devices, and for mobile applications where bandwidth and battery power are at a premium.
|
CoAP versus MQTT
|
Firstly, CoAP is more appropriate to compare to MQTT-SN. It is UDP only, and designed to
emulate a RESTful model over UDP. The biggest concern with CoAP is this: most people don’t
actually understand REST – they understand HTTP.
However, as you can see, MQTT has quickly overtaken CoAP. In terms of traffic, it is a clear
winner: every Facebook mobile app uses MQTT to communicate with the Facebook servers.
The good performance and reliability of MQTT is also demonstrated by Amazon IoT (AWS-IoT),
IBM Node-Red, etc.—organizations that are using it to serve millions of people daily.
|
My IoT Protocol Solution
I have chosen the MQTT Protocol for it's lightweight publish/subscribe messaging
protocol designed for M2M (machine to machine) telemetry in low bandwidth environments
for this project.
Below shows the MQTT protocol trail from the Meshquitto node to the Python Paho client.
|
|
We need to code the Python script that subscribes to the topic: "/Meshnet01/" and all
sub-topics using the Python Paho client.
|
MQTT Network Topology |