Quality of Service (QoS) (EN)

Concept

Three levels (0, 1, 2) that define message transmission reliability

Quality of Service (QoS)

Quality of Service (QoS) defines three levels (0, 1, 2) that control the reliability of message transmission in MQTT. QoS 0 provides 'at most once' delivery where messages are sent without acknowledgment and may be lost. QoS 1 guarantees 'at least once' through acknowledgment with possible duplicate delivery. QoS 2 ensures 'exactly once' with increased overhead using a four-stage handshake that prevents duplicates. The choice of QoS level depends on requirements for reliability, latency, and network load.

QoS Message Flow

sequenceDiagram     participant P as Publisher     participant B as Broker     participant S as Subscriber      Note over P,B,S: QoS 0 - At most once     P->>B: Nachricht senden (ohne Bestätigung)     B->>S: Nachricht weiterleiten      Note over P,B,S: QoS 1 - At least once     P->>B: Nachricht senden     B->>P: PUBACK     B->>S: Nachricht weiterleiten     Note over B,S: Mögliche Duplikatlieferung      Note over P,B,S: QoS 2 - Exactly once     P->>B: PUBLISH (QoS 2)     B->>P: PUBREC     P->>B: PUBREL     B->>P: PUBCOMP     B->>S: PUBLISH (QoS 2)     S->>B: PUBREC     B->>S: PUBREL     S->>B: PUBCOMP 

Im Kontext

  • Wird typischerweise zusammen mit MQTT, TCP/IP und Netzwerkprotokollen verwendet
  • Verwandt zu
Quelle: AI Generated