Next in thread → Next in month →

Re: [mqtt] CONNECT Will Msg in context of KeepAlive timeout

From
Peter Niblett <>
Date
2013-03-27T16:56:50+00:00
ID
Thread
Re: [mqtt] CONNECT Will Msg in context of KeepAlive timeout
Dave is right to point out that there was
a small error in Allan's sequence, as the server never sends PINGREQs.
It just observes that it hasn't received a PINGREQ (or anything else from
the client) within the expected time period (keep alive + grace interval)
and then performs the disconnect.

However I think Allan's main point in
that there is an inconsistency in the input spec. 

The second paragraph that he references
(Keep Alive) clearly says 

(1) "If the
server does not receive a message from the client within one and a half
times the Keep Alive time period (the client is allowed "grace"
of half a time period), it disconnects the client as if the client had
sent a DISCONNECT
message. "

The first paragraph that he references (Will flag) contains
the following sentence:

(2) "Sending a Will message is not triggered by the
server receiving a DISCONNECT message from the client. "

Taken in combination (1) and (2) imply that a Will message
is NOT sent.   However immediately preceding (2) there is another
sentence

(3) "The Will message defines that a message is published
on behalf of the client by the server when ...  the client fails to
communicate within the Keep Alive timer schedule".

So (3) says that a Will message MUST
be sent in this case.

Like Dave, I think that (3) overrides
(1)+(2) and an implementation ought to send a Will Message at that point
(provided one had been requested on the Connect). However we should tighten
the wording here to make that clearer.

Peter Niblett

IBM Senior Technical Staff Member

Member of the IBM Academy of Technology

From:      
 Dave Locke/UK/IBM@IBMGB

To:      
 "Mr. Allan Cornish"
<>, 

Cc:      
 

Date:      
 03/27/2013 11:52 AM

Subject:    
   Re: [mqtt] CONNECT
Will Msg in context of KeepAlive timeout

Sent by:    
   <>

For the server to detect a Keepalive
timeout  it must not have seen a PINGREQ (or other MQTT activity from
the client) for a minimum of the keepalive interval.  Once the server
has detected a keepalive timeout  the MQTT connection is deemed to
be broken and the server will initiate a shutdown of the connection including
sending the LWAT if one was requested. 

The PINGREQ is always initiated from the client.  If the client does
not receive a PINGRESP within the keepalive interval it deems the connection
to be broken and should shutdown the connection.   

All the best 

Dave 

  

From:        "Mr.
Allan Cornish" <> 

To:        ,

Date:        27/03/2013
00:26 

Subject:        [mqtt]
CONNECT Will Msg in context of KeepAlive timeout 

Sent by:        <>

This is probably a dumb question, but i would like to clarify the following
sequence:

Client sends MQTT CONNECT + 'Will' msg, +ve KeepAlive

Server sends MQTT CONNACK

Keep Alive timeout occurs

Server sends MQTT PINGREQ, no response from client.

Server drops TCP connection.

Section 2.2 Will flag specifies 'Sending a Will message is not triggered
by the server receiving a DISCONNECT message from the client.'

Section 2.2 Keep Alive timer specifies 'If the server does not receive
... it disconnects the client as if the client had sent a DISCONNECT message.'

Does this mean that if a client fails to respond and the server drops the
TCP connection, the Will message is not published?

Unless stated otherwise above:

IBM United Kingdom Limited - Registered in England and Wales with number
741598. 

Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU

Unless stated otherwise above:

IBM United Kingdom Limited - Registered in England and Wales with number
741598. 

Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU
Next in thread → Next in month →