Application Protocols · Study deck

XMPP: Messaging Foundations

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 the core XMPP roles: client, server, stream, stanza, JID, and federation.
  • Distinguish message, presence, and IQ stanzas by their system role.
  • Describe how service discovery and PubSub extensions fit into an IoT architecture.
  • Identify what evidence is needed before using XMPP IoT extensions in a real design.
iotclass.org

Major section

In 60 Seconds

Under the Hood examines session state, message extensions, trust between services, and the cases where a chat-shaped exchange is a poor fit for device work.

  • Presence may help one service.
  • Group exchange may help another.
  • Extra rules add support work.
  • Recheck after server, policy, or message changes.

Key terms

XMPP
XMPP is a standards-based XML messaging protocol built around persistent streams, global addresses called JIDs, three core stanza types, and optional federation between domains.
iotclass.org

Major section

In 60 Seconds (continued)

These features are useful only when both ends agree on their meaning and security duties.

  • The worker may be offline.
  • The message may cross company boundaries.
  • The service also needs a clear rule for delayed or repeated delivery.
  • The exchange uses named identities and structured messages.
iotclass.org

Major section

In 60 Seconds (continued)

XMPP is a standards-based XML messaging protocol built around persistent streams, global addresses called JIDs, three core stanza types, and optional federation between domains.

  • A long-lived session can carry a series of small exchanges.
  • Extra rules can add group chat, presence, or device control.
  • A device may lose its path.
  • A service may restart.
iotclass.org

Major section

Architecture Roles

XMPP architecture separates local clients, local servers, optional server-to-server federation, and extension services.

  • The local server authenticates the entity, binds its resource, and routes local stanzas.
  • This architecture explains why XMPP can federate and why the operating surface grows with that choice.

Key terms

Federation
Federation is clearer when one full JID crosses two administrative domains.
An XMPP pump-alert stanza moves from a sensor client through two federated domain servers to a contractor mobile resource.
An XMPP pump-alert stanza moves from a sensor client through two federated domain servers to a contractor mobile resource.
iotclass.org

Major section

Authentication and Channel Security

SASL and TLS are named in the Architecture Roles federation checklist above, but "we use TLS" is not evidence by itself.

  • SASL password exposure: Plain SASL mechanisms commonly encode credentials with Base64, which is an encoding, not encryption, and carries no confidentiality check of its own.
  • A Base64-encoded password is trivially decodable, so the exchange stays exposed to man-in-the-middle, address-spoofing, and unauthorized-access attacks unless the surrounding channel is protected end to end.
  • Multipath stream gaps: XML stanzas can travel across multiple stream paths and federation hops.
iotclass.org

Major section

Stanza Roles

XMPP traffic is built around three core stanza families.

  • Keeping those roles distinct makes the examples below design evidence rather than three interchangeable XML envelopes.
  • A message is not the same as a correlated request-response transaction.
  • Service discovery, roster operations, many extension queries, and device control patterns use IQ-like get, set, result, and error flows.
XMPP stanza roles showing message for event delivery, presence for availability state, and IQ for request-response operations.
XMPP stanza roles showing message for event delivery, presence for availability state, and IQ for request-response operations.
iotclass.org

Major section

Addressing and Discovery

Service discovery lets a requester ask what an entity is and which features or items it exposes.

  • That combination is useful for device capability review, but it can also leak information if access control is weak.
  • Finish at version evidence and deprovisioning: a retired or compromised resource must stop advertising and accepting work.
XMPP addressing and discovery record connecting JID policy, resource binding, discovery queries, authorization, privacy boundary, feature evidence, and deprovisioning.
XMPP addressing and discovery record connecting JID policy, resource binding, discovery queries, authorization, privacy boundary, feature evidence, and deprovisioning.
iotclass.org

Major section

Presence and PubSub

Presence and PubSub are the most common reasons to consider XMPP in an IoT workflow.

  • They should be reviewed as application semantics, not as a shortcut around telemetry architecture.
  • Presence answers whether an entity is reachable or in a named state; PubSub distributes items under node policy and may retain them.
XMPP presence and PubSub flow
XMPP presence and PubSub flow
iotclass.org

Deck summary

Key takeaways

Under the Hood examines session state, message extensions, trust between services, and the cases where a chat-shaped exchange is a poor fit for device work.

  • These features are useful only when both ends agree on their meaning and security duties.
  • XMPP is a standards-based XML messaging protocol built around persistent streams, global addresses called JIDs, three core stanza types, and optional federation between domains.
  • XMPP architecture separates local clients, local servers, optional server-to-server federation, and extension services.
  • SASL and TLS are named in the Architecture Roles federation checklist above, but "we use TLS" is not evidence by itself.
iotclass.org

Retrieval practice

Recall check

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

Q1Per this chapter's Architecture Roles section, what must be reviewed for the optional federation path between XMPP servers?

ADNS, TLS, trust, policy, abuse controls, and monitoring
BOnly the local roster and presence policy, since federation reuses local server settings
CBattery life and duty-cycle budget for the connected devices
DThe XML schema version negotiated during resource binding
Show answer

Answer: A The Architecture Roles section lists the federation path's review checklist explicitly: DNS, TLS, trust, policy, abuse controls, and monitoring -- distinct from the client entity, local server, and extension service roles listed alongside it.

iotclass.org

Print reference

Answers

Answer key.

  1. A · The Architecture Roles section lists the federation path's review checklist explicitly: DNS, TLS, trust, policy, abuse controls, and monitoring -- distinct from the client entity, local server, and extension service roles listed alongside it.
iotclass.org