A, MQTT

1 Overview:

MQTT (Message Queuing Telemetry Transport, Message Queue Telemetry Transport) is an instant messaging protocol developed by IBM, it could become an important part of things. The protocol supports all platforms, almost all articles and external network are connected, are used as sensors and actuators (such as home networking via Twitter so) communication protocol.

2, the main features:

MQTT protocol for large computing capacity is limited, and operates at a low bandwidth protocol for remote sensors and control devices designed for communication unreliable network, which has the following several major characteristics:

Using the publish / subscribe messaging model, providing many message distribution, coupling release applications;

Load the content of the message transmission mask;

Using TCP / IP provides a network connection;

There are three Quality of Service news release:

"At most once", the news release completely dependent on the underlying TCP / IP network. Occur missing or duplicate messages. This level can be used in the following cases, the environmental sensor data, loss of a read record does not matter, because there will be sent a second time soon after.

"At least once" to ensure that the message reaches, but the message is repeated may occur.

"Only once" to ensure that the message reaches once. This level may be used in the following case, the charging system, the message is repeated or missing leads to incorrect results.

Small transmission overhead is small (fixed-length header is 2 bytes), a protocol exchange minimized to reduce network traffic;

3, network resources

Official website

http://public.dhe.ibm.com/software/dw/webservices/ws-mqtt/mqtt-v3r1.html

Chinese translation

https://www.gitbook.com/book/mcxiaoke/mqtt-cn

Agent Software

Mosquitto - This is one of the oldest news agency is available in a production environment, written in C, to provide a variety of configurations lightweight and high performance.

Mosca - to write Node.js, Node can be embedded in applications or run as a stand-alone executable file. Since the configuration is simple and scalable, it is also our favorite news agency, high-performance advantages.

RSMB - IBM MQTT to achieve agreement, not one of the most common options, but it is a mature system with C language.

HiveMQ - HiveMQ is a relatively new message broker, business-oriented environment, there are a lot of good information about MQTT on the blog.

Two, CoAP

Since many devices are resource constrained in things, that only a small amount of memory space and limited computing power, so the traditional HTTP protocol used in the Internet of Things becomes too large and not suitable. CoRE the IETF working group proposed the CoAP based on REST architecture. CoAP 6LowPAN protocol stack is the application layer protocol.

1, network resources

Official website: https: //en.wikipedia.org/wiki/Constrained_Application_Protocol

Three, Lightweight M2M

OMA is an international organization, originally defined a set of OMA-DM protocol for remote management of mobile devices, such as mobile phone accounts, version upgrades, and so on. OMA-DM has a very wide range of applications, many operators such as raw Verizon Wireless, Sprint has its own OMA-DM service and require that the phone / network module when the OMA-DM network through self-defined test. Since the rise of the Internet of Things, OMA in the traditional OMA-DM protocol basis, the proposed LWM2M agreement. By the end of 2013, OMA released LWM2M specification.

OMA Lightweight M2M main motivation is to define a set of lightweight protocol for a variety of things device, since the M2M device is usually very limited resources embedded terminal, without the UI, the network computing and communications capabilities are limited. But also because of the huge number of things terminal, saving network resources becomes very important.

LWM2M defines three logical entities:

LWM2M Server server

Command LWM2M client server client is responsible for the implementation and reporting of the results

LWM2M boot server Bootstrap server is responsible for configuring LWM2M client.

Between these three logical interfaces four logical entities:

Device Discovery and Registration

This interface allows clients registered to the server and the server's ability to notify clients supported (it simply is and what resources Resource Object Object Support

Bootstrap

Bootstrap server to configure Clinet through this interface - for example LWM2M server's URL address

Device Management and Service Enablement

This is the most important business interface. LWM2M Server sends commands to the Client and by the response.

Information Reporting

This interface is LWM2M Client to report their resource information, such as temperature sensors. Reporting mode can be a trigger event may be periodic.

Lightweight M2M protocol stack

LWM2M Objects: Each object corresponds to a particular functional entity client LWM2M specification defines a standard bit Objects, for example.

urn:oma:lwm2m:oma:2; (LWM2M Server Object)

urn:oma:lwm2m:oma:3; (LWM2M Access Control Object)

There can be many resource under each object. For example Firmware object may have Firmware version number, size and other resource.

Vendor can define their own object

LWM2M Protocol: defines some logical operation, such as Read, Write, Execute, Create or Delete.

CoAP: Constrained Application Protocol IETF is used for defined LWM2M transport layer, the lower layer may be a UDP or SMS .UDP must be supported, the SMS is optional. CoAP have their own message header, retransmission mechanism.

DTLS: is used to ensure security between the client and the server.

Four, MQTT CoAP compared with

MQTT and CoAP things are very useful agreement, but the two are fundamentally different, both protocols have their own characteristics, which is the correct choice depends on your application.

1, MQTT a plurality of clients through a central proxy-many transmission protocol messages. It announced by allowing clients, message routing and replication agent decides to decouple producers and consumers. Although MQTT persistence have some support, but it is the best real-time communication bus.

2, CoAP substantially a single protocol for a single transmission state information between Client and Server. While it supports the observation of resources, but CoAP most suitable state transition model, rather than simply based on the event.

3, MQTT Clients remain long TCP connection between the Broker and this will not be a problem in NAT environment. CoAP Clients and Server UDP packet to be received and sent. Used in the CoAP NAT environment, you require the use of "tunneling" or forward (within the network through) port, or like LWM2M (the M2M lightweight), initialize the device is first connected to the 'head-end' (head-end) of.

4, MQTT tag message or other type of help with understanding Clients not supported. MQTT message can be used for any purpose, provided that all Clients must know the message format. The CoAP on the contrary, it found support and built-in content negotiation, which allows devices to exchange data with each other to find a glimpse into the way.

  • Original link: http:? //Kuaibao.qq.com/s/20180112G0RSMB00 refer = cp_1026