Presentation is loading. Please wait.

Presentation is loading. Please wait.

MQTT State transitions

Similar presentations


Presentation on theme: "MQTT State transitions"— Presentation transcript:

1 MQTT State transitions
Andrew Banks

2 MQTT V3.1.1 State transitions
Void Connect Connack returns SessionPresent=false Session Exists (connected) Connect cleanSession = false Connack returns SessionPresent=true Disconnect from cleanSession=false Network break from cleanSession=false Disconnect from cleanSession=true, or Session State is empty. Network break from cleanSession=true or Session State is empty Send Will Session Exists (disconnected) Send Will Connect cleanSession=true (and creates a NEW session) Void

3 MQTT V5 State transitions
Void Connect Connack returns SessionPresent=false Session Exists (connected) Connect cleanStart = false Connack returns SessionPresent=true Disconnect Network break Send Will, if Will on Session expiry NOT set Session Exists (disconnected) Session Timer, from Connect or Disconnect Session State exists, even if empty. Connect cleanStart=true (and creates a NEW session) Void Send Will, if Will on Session expiry IS set

4 Proposal The DISCONNECT packet has an optional Session State Expiry Interval, if present this overrides the value set on CONNECT. Clean Session is renamed to Clean Start, this causes any existing Session State to be deleted on CONNECT but not on DISCONNECT. A new flag SendWillOnSessionStateExpiry, is sent as a CONNECT optional value. If absent or false the will message is sent on network disconnection where no DISCONNECT packet is processed as today. If true the Will message is sent on Session Expiry, regardless of how this occurs. Or A new flag WillDelay, is sent as a CONNECT optional value. If absent the will message is sent on network disconnection where no DISCONNECT packet is processed as today. If present the Will message is sent after the specified interval so long as no new CONNECT is processed first. The Server retains knowledge of the Session for the duration of Session Expiry, even if the Session Contains no Messages or Subscriptions.

5 SendWillOnSessionStateExpiry vs SendWillDelay
WillDelay must be less than SessionStateExpiryInterval, otherwise you get a zombie Will message with no associated Session State. This rule is hard to enforce if the SessionStateExpiryInterval is reset on DISCONNECT.


Download ppt "MQTT State transitions"

Similar presentations


Ads by Google