MQTT (Message Queuing Telemetry Transport) is a "lightweight" communication protocol based on the publish/subscribe model. The protocol is built on the TCP/IP protocol and was released by IBM in 1999. It is now an OASIS standard messaging protocol for the Internet of Things (IoT). The biggest advantage of MQTT is that it provides real-time and reliable messaging services for connecting remote devices with very little code and limited bandwidth. The MQTT protocol is lightweight, simple, open, and easy to implement. These features make it widely used in the Internet of Things, small devices, mobile applications, etc. The MQTT protocol runs on the Transmission Control Protocol/Internet Protocol (TCP/IP) stack and provides an ordered, lossless, bidirectional connection. The MQTT protocol has strong adaptability in dealing with environments with unstable network connections and limited bandwidth, and is often used in scenarios such as smart homes, medical equipment, and satellite communications. Why MQTT?The MQTT protocol has the following characteristics:
Explanation of common terms1.MQTT BrokerMQTT Broker is a message middleware that receives messages from publishers and forwards messages to subscribers based on the topics they subscribe to. It manages client connections, handles subscriptions and unsubscriptions, and ensures that messages are sent at a specified Quality of Service (QoS) level. MQTT is an open, lightweight machine-to-machine protocol designed for IoT interactions. In an MQTT network, MQTT Broker is a server that coordinates interactions between all MQTT brokers. An MQTT client can be a publisher, a subscriber, or both. The MQTT architecture can be centralized or distributed to accommodate different application scenarios. 2. BridgeBridge in the MQTT protocol refers to bridging, which means connecting two MQTT brokers (Brokers) so that they can communicate with each other to achieve message intercommunication. When two Brokers are bridged, they can provide services as access nodes and can be configured with a virtual IP or domain name for external access. This bridging method can achieve load balancing and failover, improving system availability and stability. When configuring the Bridge, you need to specify the topic for message synchronization, rather than synchronizing all topics to avoid the problem of traffic amplification. It is recommended to divert traffic through a vertical split solution. The Bridge in the MQTT protocol has the following main features:
3.MQTT ClientMQTT Client refers to a device that runs the MQTT library and connects to the MQTT broker over the network. These devices can be microcontrollers or full-fledged servers, which implement the client side of the MQTT protocol. In the MQTT protocol, a typical client has the following main operations: publish messages to a topic, subscribe to messages from a topic, process received messages, and confirm received QoS 1 or QoS 2 messages. The client side of the MQTT protocol is very simple and straightforward. 4. RSMBRSMB (Very Small Message Broker) is a lightweight message broker developed by IBM, mainly used for message transmission services in the C/S (client/server) architecture of the MQTT protocol. Later, the Eclipse Foundation accepted RSMB as one of its projects and named it Eclipse Mosquitto. Eclipse Mosquitto is an open source message broker that implements versions 3.1 and 3.1.1 of the MQTT protocol and is designed for use in devices ranging from low-power single-board computers to full servers. The MQTT protocol uses a publish/subscribe model for messaging, which has proven to be very effective in many scenarios, especially in Internet of Things (IoT) applications. 5.LWTLast Will and Testament (LWT) is a mechanism in the MQTT protocol for handling abnormal disconnections. LWT can be understood as the will mentioned when connecting to the MQTT Broker. When the Broker detects that the Client disconnects abnormally, it will publish a message to the will topic. The will-related settings are specified in the Variable header and Payload in the CONNECT packet when the connection is established. 6.M2MMachine to machine (M2M) refers to the transmission of data from one terminal to another, that is, the dialogue between machines. The M2M application system consists of intelligent machines, M2M hardware, communication networks, and middleware. M2M application areas include home application areas, industrial application areas, retail and payment areas, logistics and transportation industries, and medical industries. 7. IoTThe Internet of Things (IoT) refers to the use of various information sensors, radio frequency identification technology, global positioning system, infrared sensors, laser scanners and other devices and technologies to collect any objects or processes that need to be monitored, connected, and interacted in real time, and to collect various required information such as sound, light, heat, electricity, mechanics, chemistry, biology, and location. Through various possible network accesses, it realizes ubiquitous connection between objects and objects and between objects and people, and realizes intelligent perception, identification and management of objects and processes. The Internet of Things is an information carrier based on the Internet, traditional telecommunications networks, etc. It allows all ordinary physical objects that can be independently addressed to form an interconnected network. 8.QoSMQTT (Message Queuing Telemetry Transport) has designed a mechanism to ensure stable message transmission, including message response, storage and retransmission. Under this mechanism, three different levels of quality of service (QoS) are provided:
Different QoS levels provide different choices and flexibility for MQTT applications. You can choose the most appropriate QoS level based on actual needs and network environment. It should be noted that QoS is a protocol between Sender and Receiver, not between Publisher and Subscriber. Frequently asked questions1. What is MQTT?MQTT is the OASIS standard for IoT connectivity. It is a publish/subscribe, radically 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 while trying to ensure reliability and a degree of delivery assurance. These principles also make the protocol ideal for the "Internet of Things" world of connected devices and for mobile applications where bandwidth and battery power are at a premium. 2.Who invented MQTT?MQTT was invented in 1999 by Dr. Andy Stanley-Clark of IBM and Arlen Nipper of Arcom (now Eurotech). 3. Where is MQTT used?MQTT has been widely implemented across industries since 1999. 4.Is MQTT a standard?v5.0 and v3.1.1 are now OASIS standards (v3.1.1 has also been approved by ISO). 5. Is there a standard port for MQTT to use?Yes. TCP/IP port 1883 has been reserved by IANA for use with MQTT. TCP/IP port 8883 has also been registered for use with MQTT over SSL. 6.Does MQTT support security?In protocol V3.1, you can pass usernames and passwords with MQTT packets. Encryption on the network can be handled using SSL, independent of the MQTT protocol itself (it is worth noting that SSL is not the lightest protocol and does add a significant amount of network overhead). Additional security can be added by applications encrypting the data they send and receive, but this is not something built into the protocol in order to keep it simple and lightweight. |
<<: Master traffic suppression and storm control to take your business to the next level
>>: Port security technology: Where is your network defense line?
LOCVPS (Global Cloud) has launched this year'...
[51CTO.com Beijing report] In order to implement ...
Kuroit is offering a special promotion for VPS in...
RAKsmart also offers substantial discounts on var...
[51CTO.com original article] At 9:30 am on March ...
According to CCTV reports, at the 2018 5G Summit ...
At the Huawei media communication meeting held du...
The standards currently implemented for PVC threa...
Hello, everyone, I am amazing. Today I saw an int...
[[188588]] The intensive construction of "In...
If you've ever had the chance to look at the ...
DediPath offers promotional discounts for all its...
Technological innovation remains the most appropr...
The 5G waves are rising higher and higher. In ear...
I saw a friend looking for a 1Gbps unlimited traf...