Protocol State Machine Visualizer Workbench

Explore MQTT, CoAP, and AMQP state diagrams as clickable implementation maps

animation
networking
protocols
state-machines
mqtt
coap
amqp
Learner-ready protocol state machine visualizer for MQTT, CoAP, and AMQP, with clickable state graphs, transition lenses, guided path stepping, technical accuracy notes, and primary source links.
Animation Clickable state graph MQTT / CoAP / AMQP

Protocol State Machine Visualizer Workbench

Use this page as the visual map. Select a protocol, filter the graph by normal, timeout, or error paths, then click states and transitions to see what an IoT implementation must remember at each point.

MQTTProtocol model
8 statesVisible graph size
Normal pathTransition lens
DisconnectedSelected state

State

A condition the implementation is currently in, such as waiting for CONNACK, waiting for a CoAP ACK, or holding an AMQP link open.

Transition

A legal move from one state to another, triggered by an event such as a packet, timer, application request, or protocol error.

Guard and action

A guard decides whether the event is valid now. An action records state, sends a frame, starts a timer, or closes/retries safely.

Nested state

Protocols do not all track one flat connection. MQTT, CoAP, and AMQP store different layers of state, so compare the diagrams carefully.

MQTT implementation state graph

Click a node for stored state, or click an arrow label to inspect the event, guard, and action.

Normal transition
Timer or retry path
Error or invalid event

Selected State

Selected Transition

Layer Model

The cards below show what kind of state the selected protocol actually stores.

Quick Reference
Check Your Understanding

MQTT check

If a client sends CONNECT twice on the same network connection, the server should treat that as a protocol error rather than opening a second session.

CoAP check

A Message ID helps detect duplicates at the message layer; the Token matches a response to the request. These are related but not the same identifier.

AMQP check

A transfer happens on a link inside a session inside a connection. A correct diagram must not flatten those layers into one connected/disconnected state.

Technical Accuracy Notes

MQTT

  • MQTT starts after the network connection exists; CONNECT is the first MQTT packet sent by the client.
  • CONNACK success opens the MQTT session. Rejected CONNACK or protocol errors close the network connection.
  • QoS packet state is tracked separately from the connection state because packet identifiers and acknowledgements can be in flight.

CoAP

  • CoAP is modeled here at the message-exchange layer, not as a persistent connection lifecycle.
  • Confirmable messages expect ACK/RST and use retransmission timers; non-confirmable messages do not expect a message-layer ACK.
  • RFC 7252 defaults include ACK_TIMEOUT 2 s, ACK_RANDOM_FACTOR 1.5, and MAX_RETRANSMIT 4.

AMQP 1.0

  • AMQP transport state is layered: connection, session, link, then delivery settlement.
  • Open, Begin, Attach, Transfer, Disposition, Detach, End, and Close frames move different layers of state.
  • Idle timeout and protocol errors can close the connection even when a session or link was previously open.
Primary Sources