PGDCA, BCA, B-Tech, MCA, M-Tech, B.Sc computer science राजस्थान सूचना सहायक व कंप्यूटर शिक्षक विशेष नोट्स: इस अध्याय में हम MQTT Quality of Service (QoS) Levels: QoS 0, QoS 1, QoS 2 (MQTT QoS लेवल्स: QoS 0 (अट मोस्ट वंस), QoS 1, QoS 2 (एक्जेक्टली वंस)) की संपूर्ण थ्योरी, मुख्य तकनीकी बिंदु, तुलनात्मक तालिका और विगत परीक्षाओं के पैटर्न पर आधारित 20 अति-महत्वपूर्ण बहुविकल्पीय प्रश्न (MCQs) विस्तृत हिंदी व अंग्रेजी व्याख्या सहित पढ़ेंगे।
Overview: MQTT defines three Quality of Service (QoS) levels—QoS 0 (At most once), QoS 1 (At least once), and QoS 2 (Exactly once)—to balance delivery reliability against bandwidth and latency. QoS is negotiated separately on the Publisher-to-Broker leg and the Broker-to-Subscriber leg using 2 bits in the Fixed Header.
अध्याय सार: MQTT डेटा डिलीवरी की विश्वसनीयता और नेटवर्क ओवरहेड के बीच संतुलन बनाने के लिए तीन Quality of Service (QoS) स्तर प्रदान करता है: QoS 0 (अट मोस्ट वंस), QoS 1 (अट लीस्ट वंस) और QoS 2 (एक्जेक्टली वंस)। फिक्स्ड हेडर के 2 बिट्स द्वारा नियंत्रित यह QoS पब्लिशर-से-ब्रोकर और ब्रोकर-से-सब्सक्राइबर के बीच अलग-अलग तय होता है।
MQTT Quality of Service (QoS) Levels: QoS 0, QoS 1, QoS 2: Detailed Notes & Architecture (MQTT QoS लेवल्स: QoS 0 (अट मोस्ट वंस), QoS 1, QoS 2 (एक्जेक्टली वंस))
1. QoS 0: At Most Once Delivery (Fire and Forget) (QoS 0: अट मोस्ट वंस (फायर एंड फॉरगेट))
[EN] QoS 0 provides best-effort delivery with zero MQTT application-layer acknowledgments or retransmissions, often termed 'Fire and Forget'. The publisher transmits a single `PUBLISH` packet without a Packet Identifier and immediately discards it from memory. Delivery relies entirely on the underlying TCP connection; if the TCP link drops mid-flight, the message is lost permanently without duplication. QoS 0 incurs minimal CPU, memory, and bandwidth overhead, making it ideal for frequent environmental readings (such as temperature every second) where losing an occasional sample is acceptable.
[HI] QoS 0 बिना किसी एप्लिकेशन-लेयर पावती (ACK) या पुनः प्रसारण के 'फायर एंड फॉरगेट' तरीके से काम करता है। पब्लिशर बिना Packet Identifier के केवल एक `PUBLISH` पैकेट भेजता है और उसे मेमोरी से हटा देता है। यदि बीच में नेटवर्क टूट जाए तो संदेश खो सकता है, लेकिन कभी डुप्लीकेट नहीं होता। कम संसाधन और कम लेटेंसी के कारण यह लगातार आने वाले सेंसर डेटा (जैसे हर सेकंड का तापमान) के लिए उपयुक्त है।
2. QoS 1: At Least Once Delivery (PUBLISH - PUBACK) (QoS 1: अट लीस्ट वंस (PUBLISH - PUBACK))
[EN] QoS 1 guarantees that every message reaches the receiver at least one time using a two-step handshake (`PUBLISH` followed by `PUBACK`) carrying a 16-bit `Packet Identifier`. The sender retains the message in an outbound buffer until `PUBACK` arrives. If the `PUBACK` packet is lost or times out due to network congestion, the sender retransmits the `PUBLISH` packet with the `DUP` (Duplicate) flag set to `1`. Consequently, the receiver may process duplicate copies of the same message unless application logic handles idempotency. QoS 1 is the industry workhorse for alarms and telemetry.
[HI] QoS 1 सुनिश्चित करता है कि संदेश प्राप्तकर्ता तक कम से कम एक बार अवश्य पहुंचे। इसमें 16-बिट `Packet Identifier` के साथ दो-चरणीय हैंडशेक (`PUBLISH` -> `PUBACK`) होता है। जब तक `PUBACK` न मिले, प्रेषक संदेश को स्टोर रखता है; टाइमआउट होने पर `DUP=1` फ्लैग के साथ `PUBLISH` दोबारा भेजा जाता है। यदि मूल संदेश पहले ही पहुंच चुका हो और केवल `PUBACK` खोया हो, तो प्राप्तकर्ता को डुप्लीकेट संदेश मिल सकता है।
3. QoS 2: Exactly Once Delivery (Four-Way Handshake) (QoS 2: एक्जेक्टली वंस (चार-चरणीय हैंडशेक))
[EN] QoS 2 provides the strongest delivery guarantee—messages arrive neither lost nor duplicated—via a four-step, two-round-trip handshake: `PUBLISH` -> `PUBREC` (Publish Received) -> `PUBREL` (Publish Release) -> `PUBCOMP` (Publish Complete). Upon receiving `PUBLISH`, the receiver stores the Packet ID to reject duplicates and replies with `PUBREC`. The sender then discards the payload, stores the Packet ID, and sends `PUBREL`; once `PUBCOMP` returns, both sides release the Packet ID. Although QoS 2 doubles round-trip latency and state memory, it is vital for billing events, industrial valve commands, and financial meters.
[HI] QoS 2 सबसे उच्च गारंटी देता है—संदेश न तो खोता है और न ही डुप्लीकेट होता है। इसमें चार-चरणीय हैंडशेक चलता है: `PUBLISH` -> `PUBREC` -> `PUBREL` -> `PUBCOMP`। प्राप्तकर्ता `PUBLISH` मिलने पर `Packet ID` सुरक्षित कर `PUBREC` भेजता है; प्रेषक पेलोड हटाकर `PUBREL` भेजता है और अंत में `PUBCOMP` मिलने पर दोनों ओर से लेनदेन पूरा होता है। यद्यपि इसमें नेटवर्क ट्रैफिक और मेमोरी खपत अधिक होती है, पर बिलिंग या क्रिटिकल कमांड में यह अनिवार्य है।
4. Header Bit Encoding and End-to-End Downgrading Rules (हेडर बिट एन्कोडिंग और एंड-टू-एंड डाउनग्रेडिंग नियम)
[EN] Inside Byte 1 of the MQTT Fixed Header, bits 2 and 1 encode QoS (`00` = QoS 0, `01` = QoS 1, `10` = QoS 2), while `11` is strictly forbidden and triggers immediate disconnection as a malformed packet. Bit 3 is the `DUP` flag (must be `0` for QoS 0) and bit 0 is `RETAIN`. Crucially, MQTT QoS is not end-to-end by default: it is decoupled into Publisher-Broker and Broker-Subscriber segments. The effective QoS received by a subscriber is the minimum of the publisher's QoS and the subscriber's `SUBSCRIBE` maximum QoS (for example, publishing at QoS 2 to a subscriber requesting max QoS 1 delivers at QoS 1).
[HI] MQTT फिक्स्ड हेडर के पहले बाइट में बिट 2 और 1 QoS को दर्शाते हैं (`00`=QoS 0, `01`=QoS 1, `10`=QoS 2), जबकि `11` अवैध मान है जो प्रोटोकॉल त्रुटि का कारण बनता है। बिट 3 `DUP` फ्लैग (QoS 0 में हमेशा 0) और बिट 0 `RETAIN` फ्लैग होता है। महत्वपूर्ण बात यह है कि सब्सक्राइबर को मिलने वाला प्रभावी QoS, पब्लिशर के QoS और सब्सक्राइबर द्वारा मांगे गए अधिकतम QoS का न्यूनतम (`min`) होता है।
Syntax, Formula & Technical Example (MQTT Quality of Service (QoS) Levels: QoS 0, QoS 1, QoS 2)
# MQTT QoS Packet Handshake Flows & Header Encoding
# Fixed Header Byte 1: [PacketType(4b) | DUP(1b) | QoS(2b) | RETAIN(1b)]
# QoS Bits: 00 = QoS 0, 01 = QoS 1, 10 = QoS 2, 11 = Reserved (Invalid)
# QoS 0 (1 packet): Publisher --PUBLISH(no ID)--> Receiver
# QoS 1 (2 packets): Publisher --PUBLISH(ID=42)--> Receiver --PUBACK(ID=42)--> Publisher
# QoS 2 (4 packets): Publisher --PUBLISH(ID=7)--> Receiver --PUBREC(7)-->
# Publisher --PUBREL(ID=7)--> Receiver --PUBCOMP(7)--> Publisher
MQTT Quality of Service (QoS) Levels: QoS 0, QoS 1, QoS 2 Quick Reference & Comparison Table
| QoS Level | Control Packet Handshake | Delivery Guarantee & Trade-off |
|---|---|---|
| QoS 0 (00) | PUBLISH only (No Packet ID) | At most once; fast, loss possible, zero duplicates |
| QoS 1 (01) | PUBLISH -> PUBACK (2-way) | At least once; guaranteed arrival, duplicates possible |
| QoS 2 (10) | PUBLISH -> PUBREC -> PUBREL -> PUBCOMP | Exactly once; no loss/duplicates, highest latency |
| QoS 3 (11) | Invalid / Protocol Violation | Forbidden bit pattern; forces immediate disconnect |
MQTT Quality of Service (QoS) Levels: QoS 0, QoS 1, QoS 2 Top 20 Bilingual MCQs with Answers
Q1. Which MQTT QoS level is also known as 'Fire and Forget' and guarantees 'At most once' delivery?
(किस MQTT QoS स्तर को 'फायर एंड फॉरगेट' कहा जाता है और यह 'अट मोस्ट वंस' डिलीवरी देता है?)
(A) QoS 3
(B) QoS 1
(C) QoS 0
(D) QoS 2
Correct Answer: (C)
[EN] QoS 0 transmits a single PUBLISH frame with no application-level acknowledgment, meaning messages arrive zero or one time.
[HI] QoS 0 बिना किसी पावती के एक बार PUBLISH पैकेट भेजता है, जिसे 'फायर एंड फॉरगेट' या 'अट मोस्ट वंस' कहते हैं।
Q2. Which two packets make up the MQTT QoS 1 acknowledgment handshake?
(MQTT QoS 1 पावती (acknowledgment) हैंडशेक में कौन-से दो पैकेट शामिल होते हैं?)
(A) `PINGREQ` and `PINGRESP`
(B) `PUBREC` and `PUBREL`
(C) `PUBLISH` and `PUBACK`
(D) `PUBLISH` and `PUBCOMP`
Correct Answer: (C)
[EN] QoS 1 uses a single acknowledgment packet `PUBACK` carrying the matching 16-bit Packet Identifier from `PUBLISH`.
[HI] QoS 1 में दो-चरणीय हैंडशेक होता है जिसमें `PUBLISH` के जवाब में `PUBACK` भेजा जाता है।
Q3. What is the correct sequence of control packets in an MQTT QoS 2 ('Exactly once') message flow?
(MQTT QoS 2 ('एक्जेक्टली वंस') संदेश प्रवाह में कंट्रोल पैकेट्स का सही क्रम क्या है?)
(A) `SYN` -> `PUBLISH` -> `ACK` -> `FIN`
(B) `PUBLISH` -> `PUBACK` -> `PUBREL` -> `PUBFIN`
(C) `PUBLISH` -> `PUBREC` -> `PUBREL` -> `PUBCOMP`
(D) `PUBLISH` -> `PUBREL` -> `PUBREC` -> `PUBCOMP`
Correct Answer: (C)
[EN] QoS 2 uses the four-step flow: PUBLISH (sender), PUBREC (receiver), PUBREL (sender), and PUBCOMP (receiver).
[HI] QoS 2 में सही चार-चरणीय क्रम है: `PUBLISH` -> `PUBREC` -> `PUBREL` -> `PUBCOMP`।
Q4. Under which MQTT QoS level can a subscriber receive duplicate copies of the same message?
(किस MQTT QoS स्तर के अंतर्गत सब्सक्राइबर को एक ही संदेश की डुप्लीकेट प्रतियाँ प्राप्त हो सकती हैं?)
(A) QoS 0 (At most once)
(B) None of the QoS levels ever duplicate packets
(C) QoS 2 (Exactly once)
(D) QoS 1 (At least once)
Correct Answer: (D)
[EN] In QoS 1, if `PUBACK` is lost, the sender resends `PUBLISH` with `DUP=1`, causing the receiver to receive duplicates.
[HI] QoS 1 में यदि `PUBACK` पैकेट रास्ते में खो जाए, तो प्रेषक `PUBLISH` दोबारा भेजता है जिससे डुप्लीकेट संदेश आ सकते हैं।
Q5. What happens if an MQTT client sets the 2-bit QoS field in the Fixed Header to binary `11`?
(यदि कोई MQTT क्लाइंट फिक्स्ड हेडर के 2-बिट QoS फील्ड को बाइनरी `11` सेट कर दे तो क्या होता है?)
(A) It broadcasts the message to every broker worldwide
(B) It automatically upgrades TCP to SCTP
(C) It is a malformed packet error and the receiver must close the network connection
(D) It activates QoS 3 encrypted streaming
Correct Answer: (C)
[EN] The MQTT specification reserves QoS bits `11` as invalid; receiving `11` requires closing the connection immediately.
[HI] MQTT मानक के अनुसार QoS बिट्स `11` अवैध हैं और ऐसा पैकेट मिलने पर कनेक्शन तुरंत बंद कर दिया जाता है।
Q6. When is the 16-bit `Packet Identifier` field omitted from an MQTT `PUBLISH` packet?
(MQTT `PUBLISH` पैकेट से 16-बिट `Packet Identifier` फील्ड कब हटाया (omit) जाता है?)
(A) When QoS is 2
(B) When the payload exceeds 128 bytes
(C) Whenever the RETAIN flag is 1
(D) When QoS is 0
Correct Answer: (D)
[EN] A Packet Identifier is present ONLY in PUBLISH packets with QoS 1 or QoS 2; QoS 0 PUBLISH packets omit it to save 2 bytes.
[HI] Packet Identifier केवल QoS 1 और QoS 2 के PUBLISH पैकेट में होता है; QoS 0 में 2 बाइट बचाने के लिए यह नहीं होता।
Q7. A publisher sends a message with QoS 2, while a subscriber subscribed to that topic with maximum QoS 1. At what QoS does the broker deliver the message to that subscriber?
(एक पब्लिशर QoS 2 पर संदेश भेजता है, जबकि सब्सक्राइबर ने अधिकतम QoS 1 पर सब्सक्राइब किया है। ब्रोकर उस सब्सक्राइबर को किस QoS पर संदेश देगा?)
(A) QoS 2
(B) QoS 1
(C) QoS 0
(D) Message is rejected by the broker
Correct Answer: (B)
[EN] The broker downgrades delivery to `min(published_QoS, subscribed_max_QoS)` = `min(2, 1)` = QoS 1.
[HI] ब्रोकर पब्लिश किए गए QoS (2) और सब्सक्राइबर के अधिकतम QoS (1) में से न्यूनतम अर्थात QoS 1 पर संदेश डिलीवर करता है।
Q8. Conversely, if a publisher sends a message at QoS 0 and a subscriber subscribes with max QoS 2, which QoS is used on the Broker-to-Subscriber leg?
(यदि कोई पब्लिशर QoS 0 पर संदेश भेजता है और सब्सक्राइबर अधिकतम QoS 2 पर सब्सक्राइब करता है, तो ब्रोकर-से-सब्सक्राइबर के बीच कौन-सा QoS लागू होगा?)
(A) QoS 0
(B) QoS 2
(C) QoS 1
(D) QoS 1.5
Correct Answer: (A)
[EN] The subscriber's requested QoS is only an upper bound; since `min(0, 2) = 0`, the message arrives at QoS 0.
[HI] सब्सक्राइबर का QoS केवल अधिकतम सीमा है; `min(0, 2) = 0` होने के कारण संदेश QoS 0 पर ही प्राप्त होगा।
Q9. What does the `DUP` flag (bit 3) inside the MQTT Fixed Header indicate?
(MQTT फिक्स्ड हेडर के अंदर `DUP` फ्लैग (बिट 3) क्या दर्शाता है?)
(A) That the subscriber must double the sensor value
(B) That the message should be stored permanently in SQL
(C) That the payload is compressed with GZIP
(D) That this QoS 1 or QoS 2 packet is a retransmission of an earlier unacknowledged attempt
Correct Answer: (D)
[EN] `DUP = 1` warns the receiver that the message might have been sent before during QoS 1/2 retry; `DUP` must always be `0` for QoS 0.
[HI] `DUP = 1` बताता है कि यह QoS 1 या QoS 2 पैकेट पहले भेजे गए बिना-पावती वाले पैकेट का पुनः प्रसारण है।
Q10. How many network round-trips are required to complete one QoS 2 publication between sender and broker?
(प्रेषक और ब्रोकर के बीच एक QoS 2 पब्लिकेशन को पूरा करने में कितने नेटवर्क राउंड-ट्रिप लगते हैं?)
(A) 1 round-trip (2 packets)
(B) 0.5 round-trip (1 packet)
(C) 4 round-trips (8 packets)
(D) 2 round-trips (4 packets)
Correct Answer: (D)
[EN] QoS 2 involves two request-response round trips: (1) PUBLISH/PUBREC and (2) PUBREL/PUBCOMP.
[HI] QoS 2 में दो राउंड-ट्रिप (कुल 4 पैकेट: PUBLISH/PUBREC और PUBREL/PUBCOMP) लगते हैं।
Q11. For which IoT scenario is MQTT QoS 0 the most appropriate design choice?
(किस IoT परिदृश्य के लिए MQTT QoS 0 सबसे उपयुक्त विकल्प है?)
(A) Billing pulse counters on prepaid smart electricity meters
(B) Automated bank ATM cash dispensing commands
(C) High-frequency telemetry (e.g., room temperature logged every 1 second) where minor packet loss is tolerable
(D) Over-the-air cryptographic key revocation alerts
Correct Answer: (C)
[EN] Continuous high-rate sensor streams recover naturally on the next sample, making QoS 0's minimal latency and battery cost ideal.
[HI] हर सेकंड आने वाले तापमान जैसे उच्च-आवृत्ति डेटा के लिए QoS 0 सर्वोत्तम है, जहाँ एक आध पैकेट खोने से फर्क नहीं पड़ता।
Q12. Which QoS level is typically recommended for smart billing meters or safety-critical actuator triggers where duplicate execution causes harm?
(स्मार्ट बिलिंग मीटर या क्रिटिकल एक्चुएटर कमांड जहाँ डुप्लीकेट निष्पादन हानिकारक हो, के लिए कौन-सा QoS स्तर अनुशंसित है?)
(A) QoS 0 (Fire and forget)
(B) QoS 1 without deduplication
(C) Broadcast UDP without ACK
(D) QoS 2 (Exactly once)
Correct Answer: (D)
[EN] QoS 2 prevents both dropped commands and double-counting/double-triggering caused by retransmissions.
[HI] QoS 2 यह सुनिश्चित करता है कि बिलिंग या क्रिटिकल कमांड न तो छूटे और न ही दो बार निष्पादित हो।
Q13. Why does a persistent session (`Clean Session = 0` in MQTT 3.1.1) matter for QoS 1 and QoS 2 subscribers?
(QoS 1 और QoS 2 सब्सक्राइबर के लिए पर्सिस्टेंट सेशन (`Clean Session = 0`) क्यों महत्वपूर्ण है?)
(A) It converts QoS 2 packets into HTTP GET requests
(B) It wipes all retained messages from the broker
(C) It disables TLS authentication on reconnect
(D) The broker queues missed QoS 1 and QoS 2 messages while the subscriber is offline and delivers them upon reconnect
Correct Answer: (D)
[EN] With Clean Session = 0, the broker retains subscriptions and buffers QoS 1/2 messages (not QoS 0) for disconnected clients.
[HI] Clean Session = 0 होने पर क्लाइंट के ऑफलाइन रहने के दौरान ब्रोकर QoS 1 व QoS 2 संदेशों को क्यू में सहेजता है और पुनः जुड़ने पर भेजता है।
Q14. In an MQTT QoS 2 exchange, what is the role of the `PUBREL` packet?
(MQTT QoS 2 एक्सचेंज में `PUBREL` पैकेट की क्या भूमिका होती है?)
(A) The broker closes the TCP connection gracefully
(B) The publisher updates its Keep-Alive timeout
(C) The sender tells the receiver it received `PUBREC` and that the receiver may now discard the stored Packet ID
(D) The receiver requests the sender to repeat the payload
Correct Answer: (C)
[EN] After storing `PUBREC`, the sender frees the message payload and transmits `PUBREL` so the receiver deletes its duplicate-guard state and replies `PUBCOMP`.
[HI] `PUBREC` मिलने के बाद प्रेषक `PUBREL` भेजकर प्राप्तकर्ता को बताता है कि वह सुरक्षित `Packet ID` को हटा सकता है और अंत में `PUBCOMP` भेज सकता है।
Q15. Examine Byte 1 of an incoming MQTT PUBLISH packet: `0x32` (`0011 0010` in binary). Which QoS level is encoded?
(आने वाले MQTT PUBLISH पैकेट के पहले बाइट `0x32` (बाइनरी `0011 0010`) में कौन-सा QoS स्तर एन्कोड है?)
(A) QoS 1
(B) QoS 2
(C) Invalid QoS 3
(D) QoS 0
Correct Answer: (A)
[EN] In `0011 0010`, upper nibble `0011` (3) is PUBLISH, bit 3 (`0`) is DUP, bits 2-1 (`01`) equal QoS 1, and bit 0 (`0`) is RETAIN.
[HI] `0011 0010` में ऊपरी निबल `0011` PUBLISH है, तथा बिट 2 और 1 (`01`) QoS 1 को दर्शाते हैं।
Q16. Which statement is NOT true regarding MQTT QoS levels?
(MQTT QoS स्तरों के संबंध में निम्नलिखित में से कौन-सा कथन सत्य नहीं है?)
(A) QoS 1 guarantees delivery at least once using PUBACK
(B) QoS 2 avoids duplicate message delivery through a 4-part handshake
(C) QoS 0 requires the least bandwidth and memory
(D) Setting QoS 2 guarantees end-to-end delivery directly between publisher and subscriber without broker involvement
Correct Answer: (D)
[EN] MQTT QoS strictly governs two independent hops (Publisher<->Broker and Broker<->Subscriber); the broker always mediates.
[HI] MQTT में QoS पब्लिशर-ब्रोकर और ब्रोकर-सब्सक्राइबर के बीच अलग-अलग लागू होता है, न कि बिना ब्रोकर के सीधे एंड-टू-एंड।
Q17. Within MQTT Quality of Service (QoS) Levels: QoS 0, QoS 1, QoS 2, which qos level directly maps to: "PUBLISH only (No Packet ID)"?
(MQTT Quality of Service (QoS) Levels: QoS 0, QoS 1, QoS 2 में कौन सा QoS Level सीधे "PUBLISH only (No Packet ID)" से संबंधित है?)
(A) QoS 3 (11)
(B) QoS 2 (10)
(C) QoS 0 (00)
(D) QoS 1 (01)
Correct Answer: (C)
[EN] In MQTT Quality of Service (QoS) Levels: QoS 0, QoS 1, QoS 2, 'QoS 0 (00)' handles 'PUBLISH only (No Packet ID)' (At most once; fast, loss possible, zero duplicates).
[HI] MQTT Quality of Service (QoS) Levels: QoS 0, QoS 1, QoS 2 में 'QoS 0 (00)' का कार्य/विवरण 'PUBLISH only (No Packet ID)' (At most once; fast, loss possible, zero duplicates) है।
Q18. Which option accurately describes 'QoS 1 (01)' in MQTT Quality of Service (QoS) Levels: QoS 0, QoS 1, QoS 2?
(MQTT Quality of Service (QoS) Levels: QoS 0, QoS 1, QoS 2 के संदर्भ में 'QoS 1 (01)' की सही विशेषता कौन सी है?)
(A) PUBLISH -> PUBREC -> PUBREL -> PUBCOMP
(B) PUBLISH only (No Packet ID)
(C) PUBLISH -> PUBACK (2-way)
(D) Invalid / Protocol Violation
Correct Answer: (C)
[EN] 'QoS 1 (01)' provides 'PUBLISH -> PUBACK (2-way)' — key point: At least once; guaranteed arrival, duplicates possible.
[HI] 'QoS 1 (01)' का मुख्य विवरण 'PUBLISH -> PUBACK (2-way)' है (At least once; guaranteed arrival, duplicates possible)।
Q19. In MQTT Quality of Service (QoS) Levels: QoS 0, QoS 1, QoS 2, identify the correct parameter for the specification: "PUBLISH -> PUBREC -> PUBREL -> PUBCOMP".
(MQTT Quality of Service (QoS) Levels: QoS 0, QoS 1, QoS 2 में "PUBLISH -> PUBREC -> PUBREL -> PUBCOMP" विवरण किस विकल्प के लिए सही है?)
(A) QoS 1 (01)
(B) QoS 3 (11)
(C) QoS 0 (00)
(D) QoS 2 (10)
Correct Answer: (D)
[EN] 'QoS 2 (10)' corresponds to 'PUBLISH -> PUBREC -> PUBREL -> PUBCOMP' (Exactly once; no loss/duplicates, highest latency).
[HI] 'QoS 2 (10)' का संबंध 'PUBLISH -> PUBREC -> PUBREL -> PUBCOMP' (Exactly once; no loss/duplicates, highest latency) से है।
Q20. Considering MQTT Quality of Service (QoS) Levels: QoS 0, QoS 1, QoS 2, what key behavior defines 'QoS 3 (11)'?
(MQTT Quality of Service (QoS) Levels: QoS 0, QoS 1, QoS 2 में 'QoS 3 (11)' की मुख्य भूमिका या मान क्या है?)
(A) Invalid / Protocol Violation
(B) PUBLISH -> PUBACK (2-way)
(C) PUBLISH only (No Packet ID)
(D) PUBLISH -> PUBREC -> PUBREL -> PUBCOMP
Correct Answer: (A)
[EN] 'QoS 3 (11)' represents 'Invalid / Protocol Violation' (Forbidden bit pattern; forces immediate disconnect).
[HI] 'QoS 3 (11)' का अर्थ/मान 'Invalid / Protocol Violation' है (Forbidden bit pattern; forces immediate disconnect)।
MQTT Quality of Service (QoS) Levels: QoS 0, QoS 1, QoS 2 — Exam FAQs
Q1: If TCP already guarantees reliable delivery, why does MQTT need QoS 1 and QoS 2?
जब TCP पहले से विश्वसनीय डिलीवरी देता है, तो MQTT को QoS 1 और QoS 2 की आवश्यकता क्यों होती है?
[EN] TCP guarantees delivery only on an intact socket; if a wireless link breaks abruptly, TCP buffers can be lost without confirming whether the remote MQTT application processed the message.
[HI] TCP केवल सक्रिय सॉकेट पर गारंटी देता है; वायरलेस नेटवर्क अचानक टूटने पर TCP बफ़र का डेटा खो सकता है और एप्लिकेशन-लेयर पावती के लिए QoS 1/2 जरूरी होता है।
Q2: Why is QoS 1 often used instead of QoS 2 in cloud platforms like AWS IoT Core?
AWS IoT Core जैसे क्लाउड प्लेटफॉर्म अक्सर QoS 2 के बजाय QoS 1 का उपयोग क्यों करते हैं?
[EN] QoS 2 halves throughput and doubles state synchronization overhead across distributed brokers; cloud platforms prefer QoS 1 paired with idempotent consumers.
[HI] QoS 2 वितरित क्लाउड ब्रोकर पर लेटेंसी और मेमोरी स्टेट को दोगुना कर देता है, इसलिए क्लाउड सिस्टम QoS 1 और इडेम्पोटेंट प्रोसेसिंग को प्राथमिकता देते हैं।
Q3: What happens to QoS 0 messages when a subscriber is offline in a persistent session?
पर्सिस्टेंट सेशन में यदि सब्सक्राइबर ऑफलाइन हो तो QoS 0 संदेशों का क्या होता है?
[EN] By MQTT specification, QoS 0 messages are NOT queued for offline clients in persistent sessions and are immediately dropped (unless configured with non-standard broker extensions).
[HI] MQTT मानक के अनुसार, पर्सिस्टेंट सेशन में भी ऑफलाइन क्लाइंट्स के लिए QoS 0 संदेश क्यू में नहीं रखे जाते बल्कि छोड़ दिए जाते हैं।
Post a Comment
Post a Comment