Please enable JavaScript.
Coggle requires JavaScript to display documents.
Protocole MQTT dans les RS - Coggle Diagram
Protocole MQTT dans les RS
1. What is IoT?
refers to all physical objects that are connected to the internet
can collect, send, and receive data automatically — without human intervention.
objects contain sensors (detect physical data like temperature or movement) / software (process data ) & commun techn (exchange that data via the internet)
3. What is MQTT?
MQTT = Message Queuing Telemetry Transport.
a lightweight messaging protocol based on the Publish / Subscribe model.
Instead of devices talking directly to each other, they all communicate through a central server called the Broker.
It works on top of TCP/IP — the same base as the internet — which ensures reliable data transmission even on weak networks.
2.Why do IoT devices
need a special protocol?
IoT objects are not like computers. They have very limited resources:
Low battery — they cannot afford to send heavy data packets
Low memory — they cannot run complex software or protocols
Slow / unstable connection — Wi-Fi or mobile networks often drop
Classic protocols like HTTP or FTP are designed for powerful computers — they are too heavy, too slow, and too demanding for IoT devices.
a lightweight protocol made specifically for these constraints.
4. How MQTT works
① Publisher : A sensor publishes a message on a topic
② Broker receives : The MQTT broker gets the message
③ Broker routes : It sends to all clients subscribed to that topic
④ Subscribers : They receive and use the message
:red_flag: key idea :
the publisher and subscriber never communicate directly.
broker is always the intermediary
This decoupling means any device can operate independently
no direct link between sender and receiver.
5. Topics
a logical label(like an address) used to classify and route messages.
publishers send messages to a topic.
subscribes choose which topics they want to listen to
written as hierarchical paths :
maison/salon/temperature
Wildcards let you subscribe to multiple topics at once
6. QoS (Quality of Service)
defines how reliably a message is delivered
QoS 0 — At Most Once
The message is sent once and only once, with no confirmation. If the network drops, the message is lost — no retry.
How it works: PUBLISH → Broker → PUBACK (2 steps)
QoS 1 — At Least Once
The message is sent and resent until the broker confirms receipt with a PUBACK acknowledgment. This guarantees arrival, but the message may arrive more than once (duplicates possible).
How it works: PUBLISH → Broker → PUBACK (2 steps)
QoS 2 — Exactly Once
The most reliable level. Uses a 4-step handshake to guarantee the message arrives exactly once
— no loss, no duplicates.
PUBLISH — Publisher sends the message to the broker
PUBREC — Broker confirms it received the message
PUBREL — Publisher says "OK, you can now deliver it"
PUBCOMP — Broker confirms delivery is complete