Skip to content
AD-604 (A) · Internet of Things/Quick Revision Short Notes

Internet of Things (AD-604 (A)) - Unit 4 Short Notes

How unit 4 is examined

This unit covers the three IoT application-layer messaging protocols; XMPP and AMQP carry the marks (AMQP vs HTTP, AMQP features), CoAP message types follow, and MQTT was not asked recently.

MQTT, MQTT methods and components, MQTT communication, topics and applications, SMQTT

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>

Definition. <mark>MQTT (Message Queuing Telemetry Transport) is a lightweight publish-subscribe protocol that runs over TCP, in which clients publish messages to named topics on a broker and the broker forwards them to every client subscribed to that topic.</mark>

Key points.

  1. The components are publishers, subscribers and a central broker, so publishers and subscribers never know each other.
  2. The methods (packets) are CONNECT, PUBLISH, SUBSCRIBE, UNSUBSCRIBE and DISCONNECT.
  3. Topics are hierarchical strings such as home/room1/temp, with wildcards + (one level) and # (all levels below).
  4. Three QoS levels exist: 0 at most once, 1 at least once, 2 exactly once; typical uses are sensor telemetry, smart homes and remote monitoring.
  5. SMQTT (Secure MQTT) adds lightweight attribute-based encryption on top of MQTT to protect the data.

CoAP, CoAP message types, CoAP Request-Response model

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Low weight</span>

Definition. <mark>CoAP (Constrained Application Protocol) is a lightweight RESTful protocol over UDP for constrained IoT devices, using GET, POST, PUT and DELETE like HTTP.</mark>

Key points.

  1. CoAP suits low-power, low-memory nodes because it uses UDP and a tiny 4-byte header.
  2. Confirmable (CON) messages need an Acknowledgement (ACK) and are retransmitted until one arrives, which gives reliability over UDP.
  3. Non-confirmable (NON) messages are sent once with no acknowledgement, suitable for repeated sensor readings.
  4. Acknowledgement (ACK) confirms a CON message and may carry the response piggybacked; Reset (RST) tells the sender a message could not be processed.
  5. In the request-response model a client sends a CON or NON request and the server replies with a response code such as 2.05 Content.

Asked: [7 marks] (May 2023) What are the different types of messages in CoAP?

XMPP, AMQP features and components, AMQP frame types

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">High weight</span>

Definition. <mark>AMQP (Advanced Message Queuing Protocol) is an open, binary, wire-level application protocol for reliable, queue-based message-oriented middleware that runs over TCP.</mark> XMPP (Extensible Messaging and Presence Protocol) is an XML-based protocol for real-time messaging and presence.

Diagram. <figure class="ds-fig" style="margin:1.4rem 0;overflow-x:auto"><svg xmlns="http://www.w3.org/2000/svg" id="dsfig-u4-01" viewBox="0 0 510 80" width="510" height="80" role="img" aria-label="AMQP flow: Publisher to Exchange to Queue to Consumer (routing by binding)"><style>#dsfig-u4-01 .e{stroke:#454C5A;stroke-width:1.4;fill:none}#dsfig-u4-01 .e.hi{stroke:#2340B8;stroke-width:2.6}#dsfig-u4-01 .n{fill:#FFFFFF;stroke:#16181D;stroke-width:1.4}#dsfig-u4-01 .n.hi{fill:#E3E9FC;stroke:#2340B8;stroke-width:2.2}#dsfig-u4-01 .n.rb-b{fill:#16181D;stroke:#16181D}#dsfig-u4-01 .n.rb-r{fill:#BD3227;stroke:#BD3227}#dsfig-u4-01 text{font-family:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace;font-size:13px}#dsfig-u4-01 .t{fill:#16181D;font-weight:500}#dsfig-u4-01 .t.inv{fill:#FFFFFF;font-weight:700}#dsfig-u4-01 .kd{stroke:#16181D;stroke-width:1.2}#dsfig-u4-01 .dot{fill:#16181D}#dsfig-u4-01 .ann{fill:#2340B8;font-size:11px;font-weight:700}#dsfig-u4-01 .lbl{fill:#6F7787;font-family:system-ui,-apple-system,sans-serif;font-size:12px;font-weight:700}#dsfig-u4-01 .ptr{fill:#2340B8;font-size:12px;font-weight:700}#dsfig-u4-01 .ah{fill:#454C5A}#dsfig-u4-01 .ah.hi{fill:#2340B8}#dsfig-u4-01 .wl rect{fill:#FFFFFF;stroke:#DCE0E7}#dsfig-u4-01 .wl .t{font-size:12px;font-weight:700}#dsfig-u4-01 .wl.hi rect{fill:#2340B8;stroke:#2340B8}#dsfig-u4-01 .wl.hi .t{fill:#FFFFFF}html.dark #dsfig-u4-01 .e{stroke:#B1B7C3}html.dark #dsfig-u4-01 .e.hi{stroke:#8FA3FF}html.dark #dsfig-u4-01 .n{fill:#161920;stroke:#E6E8ED}html.dark #dsfig-u4-01 .n.hi{fill:#1E2748;stroke:#8FA3FF}html.dark #dsfig-u4-01 .n.rb-b{fill:#E6E8ED;stroke:#E6E8ED}html.dark #dsfig-u4-01 .n.rb-r{fill:#FF7E71;stroke:#FF7E71}html.dark #dsfig-u4-01 .t{fill:#E6E8ED}html.dark #dsfig-u4-01 .t.inv{fill:#0F1115}html.dark #dsfig-u4-01 .kd{stroke:#E6E8ED}html.dark #dsfig-u4-01 .dot{fill:#E6E8ED}html.dark #dsfig-u4-01 .ann{fill:#8FA3FF}html.dark #dsfig-u4-01 .lbl{fill:#858D9C}html.dark #dsfig-u4-01 .ptr{fill:#8FA3FF}html.dark #dsfig-u4-01 .ah{fill:#B1B7C3}html.dark #dsfig-u4-01 .ah.hi{fill:#8FA3FF}html.dark #dsfig-u4-01 .wl rect{fill:#161920;stroke:#2A2E37}html.dark #dsfig-u4-01 .wl.hi rect{fill:#8FA3FF;stroke:#8FA3FF}html.dark #dsfig-u4-01 .wl.hi .t{fill:#0F1115}</style><defs><marker id="ah4" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah" d="M0,1 L9,5 L0,9 z"/></marker><marker id="ahh4" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah hi" d="M0,1 L9,5 L0,9 z"/></marker></defs><path class="e" d="M59,40 L165.2,40" marker-end="url(#ah4)"/><path class="e" d="M205.2,40 L311.4,40" marker-end="url(#ah4)"/><path class="e" d="M351.4,40 L449,40" marker-end="url(#ah4)"/><g class="wl"><rect x="96.3" y="31" width="33.6" height="18" rx="9"/><text class="t" x="113.1" y="40" dy=".35em" text-anchor="middle">msg</text></g><g class="wl"><rect x="228.5" y="31" width="61.5" height="18" rx="9"/><text class="t" x="259.3" y="40" dy=".35em" text-anchor="middle">binding</text></g><g class="wl"><rect x="370.5" y="31" width="61.5" height="18" rx="9"/><text class="t" x="401.2" y="40" dy=".35em" text-anchor="middle">deliver</text></g><circle class="n" cx="40" cy="40" r="18"/><text class="t" x="40" y="40" dy=".35em" text-anchor="middle">Pub</text><circle class="n" cx="186.2" cy="40" r="18"/><text class="t" x="186.2" y="40" dy=".35em" text-anchor="middle">Exc</text><circle class="n" cx="332.4" cy="40" r="18"/><text class="t" x="332.4" y="40" dy=".35em" text-anchor="middle">Que</text><circle class="n" cx="470" cy="40" r="18"/><text class="t" x="470" y="40" dy=".35em" text-anchor="middle">Con</text></svg><figcaption style="font-size:.82em;opacity:.72;margin-top:.45rem">AMQP flow: Publisher to Exchange to Queue to Consumer (routing by binding)</figcaption></figure>

Key points.

  1. AMQP is message-oriented and binary, so its messages are compact, portable and interoperable across vendors.
  2. Components: a publisher sends messages to an exchange on the broker, the exchange routes them by bindings to queues, and consumers read from the queues.
  3. Exchange types are direct, fanout, topic and headers, which decide how a message is routed.
  4. It offers reliable delivery through acknowledgements, persistence and transactions, plus security via TLS/SASL.
  5. Frame types include open, begin, attach, transfer, flow, disposition, detach, end and close.
  6. XMPP carries XML stanzas (message, presence, iq) and is used for chat, presence and device control.

AMQP vs HTTP.

Basis AMQP HTTP
Model Asynchronous publish, queue, consume Synchronous request-response
Format Binary, compact Text, verbose headers
Reliability Acknowledgements, persistent queues, transactions None built in; client retries
Overhead Low per message, long-lived connection High, a new request each time
Use case Enterprise and IoT messaging Web browsing, REST APIs

Answer frame. Open with the definition of AMQP; draw the exchange-queue diagram; develop points 1-5 (features then components); add the table for HTTP; close that AMQP suits constrained IoT while HTTP suits web.

Asked: [14 marks] (May 2023) Write short notes on (any two): a) AMQP features and components, b) Cloud storage models, c) Attacks in IoT system Asked: [7 marks] (May 2023) What is the difference between AMQP and HTTP protocols?

Last-minute revision

  • MQTT is publish-subscribe over TCP through a broker.
  • MQTT QoS 0, 1 and 2 mean at most once, at least once and exactly once.
  • MQTT wildcards are + for one level and # for many levels.
  • CoAP runs over UDP with a 4-byte header and RESTful methods.
  • CoAP message types are CON, NON, ACK and RST.
  • AMQP is a binary, queue-based, reliable protocol over TCP.
  • AMQP routes through exchanges (direct, fanout, topic, headers) to queues.
  • XMPP is XML-based, with message, presence and iq stanzas.
  • HTTP is synchronous request-response; AMQP is asynchronous.

Memory hooks

  • MQTT: "Broker in the middle, topics on the label."
  • CoAP: CON-NON-ACK-RST, "confirm, none, acknowledge, reset".
  • AMQP path: Publisher, Exchange, Queue, Consumer (PEQC).
  • Exchange types: DFTH, "Direct, Fanout, Topic, Headers".

Coverage checklist

  • MQTT, MQTT methods and components, MQTT communication, topics and applications, SMQTT: no past questions.
  • CoAP, CoAP message types, CoAP Request-Response model: CoAP message types (7 marks, May 2023).
  • XMPP, AMQP features and components, AMQP frame types: AMQP vs HTTP (7 marks), AMQP features and components (14 marks short note, May 2023).
Go to where you left off?

Quick Add to Notes

Save questions, your own notes and screenshots into notes filed by unit. It takes a free account.

Create free account

Have an account? Log in