Application Protocols · Study deck

XMPP: Protocol Fit and Operations

XMPP is useful when an IoT system needs addressed conversations, presence, discovery, or federation rather than just another telemetry pipe.

Broker Bex is your guide for this deck.

xmpp-protocol-fit
Broker Bex, the module guide, in a scene from this chapter.
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • Explain: A client can open a TCP connection to its server, commonly on client-to-server port 5222, negotiate TLS, authenticate with SASL, bind a resource, and exchange XML stanzas until the stream closes.
  • Explain: DDS is a data-centric publish/subscribe standard with implementations commonly using the RTPS wire protocol over UDP, including discovery and multicast where supported; transports are implementation/profile choices.
  • Explain: XMPP has no native MQTT-style QoS 0/1/2 delivery contract, so reliability evidence must come from stanza acknowledgments, stream management, application state, or the chosen extension.
  • Explain: The cost is verbosity.
iotclass.org

Major section

Protocol Fit

XMPP is one candidate in a protocol portfolio.

  • The important correction to a common shorthand is that DDS is not simply a TCP device protocol.
  • DDS is a data-centric publish/subscribe standard with implementations commonly using the RTPS wire protocol over UDP, including discovery and multicast where supported; transports are implementation/profile choices.

Key terms

AMQP
AMQP is oriented to reliable brokered or routed messaging between applications and services.
MQTT
MQTT is compact topic-based brokered telemetry.

Why it matters

XMPP fits when its semantics justify that evidence and operating cost; otherwise the record should make the simpler alternative visible.

XMPP protocol fit record comparing semantics, identity, discovery, transport, security, operations, field validation, and alternatives.
XMPP protocol fit record comparing semantics, identity, discovery, transport, security, operations, field validation, and alternatives.
iotclass.org

Major section

Protocol Fit (continued)

AMQP is oriented to reliable brokered or routed messaging between applications and services.

  • MQTT is compact topic-based brokered telemetry.
  • XMPP is addressed, extensible XML streaming with identity, presence, discovery, and federation semantics.
  • where BtxB_{tx}Btx​ includes application payload, protocol framing, TCP/UDP/IP, link headers, acknowledgements, and security records.
iotclass.org

Major section

Protocol Fit (continued)

A two-byte minimum MQTT fixed header does not make a TLS reconnect cheap.

  • Conversely, a long-lived connection saves handshakes only if keepalives and receive windows do not keep a battery device awake.
  • DDS can avoid a central broker on a suitable local network, but discovery and reliability repair add traffic.
  • AMQP can deliberately queue through receiver outages, trading freshness for durable delivery.
iotclass.org

Major section

Protocol Fit (continued)

XMPP fits when its semantics justify that evidence and operating cost; otherwise the record should make the simpler alternative visible.

  • MQTT fan-out is operationally simple, but every path depends on broker availability and topic authorization.
  • XMPP can route to an addressed identity and advertise availability, but XML and server/extension behavior must justify their cost.
  • For deterministic robot state exchanged among several real-time processes, DDS QoS and typed keyed data may justify its discovery and implementation cost.
iotclass.org

Major section

Core Technologies, Limits, and Uses

XMPP is a family of XML-stream technologies, not a single "chat" feature.

  • Core XMPP provides the stream, stanza, addressing, authentication, and routing base.
  • Jingle adds session negotiation for voice, video, and file-transfer style media workflows.
  • Multi-user chat supports group conversation rooms.
  • PubSub provides nodes, subscriptions, publications, and notifications.
XMPP core streams, three stanza roles, extension protocols, and application-fit trade-offs form one technology map.
XMPP core streams, three stanza roles, extension protocols, and application-fit trade-offs form one technology map.
iotclass.org

Major section

Core Technologies, Limits, and Uses (continued)

BOSH carries XMPP over HTTP request pairs when a WebSocket or native TCP stream is not available.

  • Those capabilities have costs that matter in IoT reviews.
  • XMPP has no native MQTT-style QoS 0/1/2 delivery contract, so reliability evidence must come from stanza acknowledgments, stream management, application state, or the chosen extension.
  • If the application only needs simple telemetry fan-out, MQTT or AMQP is usually easier to prove.
iotclass.org

Major section

Scenario

The system also needs a controlled way to discover device capabilities after maintenance replacement.

  • Presence is part of the user workflow.
  • Service discovery can expose capabilities without a separate registry.
  • WebSocket transport may help browser-based operator tools.
  • Server support for client streams, resource binding, TLS, SASL, roster or presence policy, and selected extensions.

Key terms

XMPP
XMPP is a reasonable shortlist candidate for the interactive, presence-aware layer.
iotclass.org

Major section

Concept Relationships

JID plus stanza defines the route: The JID identifies the entity and resource; the stanza family defines the type of interaction.

  • Presence is semantics, not telemetry: Presence can show availability and status transitions, but health monitoring still needs logs, alerts, retries, and lifecycle records.
  • Discovery needs authorization: Service discovery is useful for capability review, but exposing entity identities and features can create privacy and security risk.
  • It should be chosen only when those semantics matter.

Key terms

Presence
Presence is semantics, not telemetry. Presence can show availability and status transitions, but health monitoring still needs logs, alerts, retries, and lifecycle records.
iotclass.org

Major section

Deep Dive: How XMPP Moves, and Why It Is Heavy

Everything XMPP does is carried by one of three stanza types, each addressed with a JID of the form localpart@domain/resource.

  • HTTP request semantics are stateless, although HTTP connections can be reused and streams can stay open.
  • The cost is verbosity.
  • MQTT-SN or CoAP typically fit the constrained edge better.

Key terms

If XMPP
If XMPP is justified, document reconnect behavior, keepalive interval, TLS certificate policy, offline queue limits, and who may subscribe to presence.
iotclass.org

Major section

Deep Dive: How XMPP Moves, and Why It Is Heavy (continued)

A client can open a TCP connection to its server, commonly on client-to-server port 5222, negotiate TLS, authenticate with SASL, bind a resource, and exchange XML stanzas until the stream closes.

  • That maintained session makes presence and pushed messages natural, and can cost energy on a tiny sleeping device.
  • A sleeping sensor that reports every hour usually wants a cheaper store-and-forward protocol.
  • If XMPP is justified, document reconnect behavior, keepalive interval, TLS certificate policy, offline queue limits, and who may subscribe to presence.
  • Federation is a separate operations commitment.
iotclass.org

Major section

Deep Dive: How XMPP Moves, and Why It Is Heavy (continued)

The from JID names both the account, sensor7@gw.example, and the specific connected resource, /field. <show> gives availability and <status> carries free text.

  • The request/response nature of <iq> is especially important for configuration and discovery.
  • A controller can correlate the returned result or error with the original request, apply a timeout, and decide whether to retry or surface a failed capability check.
  • A pushed <message> may be useful, but it does not prove that a queried field exists.
iotclass.org

Deck summary

Key takeaways

XMPP is one candidate in a protocol portfolio.

  • AMQP is oriented to reliable brokered or routed messaging between applications and services.
  • A two-byte minimum MQTT fixed header does not make a TLS reconnect cheap.
  • XMPP fits when its semantics justify that evidence and operating cost; otherwise the record should make the simpler alternative visible.
  • XMPP is a family of XML-stream technologies, not a single "chat" feature.
iotclass.org

Retrieval practice

Recall check 1 of 3

Broker Bex says: answer from memory, then check your reasoning.

Q1According to this chapter's 'Core Technologies, Limits, and Uses' section, why is XMPP a poor fit for high-rate binary telemetry from constrained devices?

AXMPP lacks TLS entirely, so binary telemetry must cross the network without encryption or stream security.
BXMPP's XML and base64 framing burden the link, with no native MQTT-style QoS 0/1/2 levels.
CXMPP supports only one stanza type, leaving binary telemetry with no message container or valid route.
DXMPP pads every reading to a mandatory 1 KB message size, overwhelming a constrained radio link.
Show answer

Answer: B a poor fit for high-rate binary telemetry from constrained devices unless the gateway or server layer is doing the XMPP work.

iotclass.org

Retrieval practice

Recall check 2 of 3

Broker Bex says: answer from memory, then check your reasoning.

Q2A controller needs to ask a device for its supported control fields and receive either a structured result or an error. Which XMPP stanza family is the best fit?

AIQ stanzas for structured get, set, result and error exchanges
BPresence stanzas for the device's availability rather than a correlated reply
CMessage stanzas as the sole family for every XMPP payload and query
DJID addresses as the store for a device's structured response
Show answer

Answer: A IQ is the XMPP request-response primitive.

iotclass.org

Retrieval practice

Recall check 3 of 3

Broker Bex says: answer from memory, then check your reasoning.

Q3This chapter's Deep Dive explains why XMPP usually sits at gateways and servers rather than on constrained edge devices. What two costs does it name?

AAbsent authentication makes each XMPP stanza require manual verification on the constrained edge device.
BFrequent server polling instead of one persistent stream drains the constrained device's battery.
CVerbose XML tags, namespaces and full JIDs plus a persistent TCP stream burden a coin-cell sensor.
DMandatory UDP transport adds radio retransmissions that constrained devices cannot support.
Show answer

Answer: C see answers page

iotclass.org

Print reference

Answers 1 of 2

Answer key.

  1. B · a poor fit for high-rate binary telemetry from constrained devices unless the gateway or server layer is doing the XMPP work.
  2. A · IQ is the XMPP request-response primitive.
iotclass.org

Print reference

Answers 2 of 2

Answer key.

  1. C · The Deep Dive section's verbosity paragraph names the two costs directly: XML framing overhead (tags, namespaces, full JIDs) versus MQTT's compact header or CoAP's compact UDP framing, plus the always-open TCP stream -- together explaining why XMPP fits gateways/servers better than a coin-cell sensor.
iotclass.org