[Standards] Whitespace "ping"

Thilo Molitor thilo at eightysoft.de
Thu Jun 13 21:27:54 UTC 2019

Dave's suggestions are more or less what I configured on my private server and 
are very sane imho:

On my private server I'm using prosody and configured a TCP read timeout of 10 
minutes and I'm using 0198 stream management (all my clients are gajim, monal, 
chatsecure or conversations).
On TCP read timeout a 0198 ping is sent to the client. If the client doesn't 
answer this in 60 seconds a push is triggered for the pending ack.
And if the push doesn't succeed the session is 0198-hibernated after 10 
New stanzas in the outgoing 0198 queue trigger a push if an ack is pending for 
more than 60 seconds or if the session is in hinbernation state.
Every stanza (or bunch of stanzas following each other directly) triggers an 
0198 <r>, only one ack request is in flight at once, the maximum of 
unacknowledged stanzas is set to zero, thus as long as the queue is not empty 
a new <r> is created.

Compared to Dave's proposal this is:
a) doesn't apply here because all clients support 0198
b) this is the max unacknowledged stanzas of zero
c) this is the read timeout of 600 seconds (dave suggested 300 seconds)

Dave's client side:
a) I don't know if this is even neccessary at all, using 0198 and acking every 
stanza (or bunch of stanzas) should be enough, I think
b) that's roughly what conversations does, sounds perfectly reasonable
c) depends if you want to maintain a pesistent TCP connection and use push for 
situations in which the app or TCP connection got closed (unexpectedly) or if 
you want to use push exclusively and close the TCP connection in backgrund to 
reconnect only on incoming pushes.

- tmolitor

Am Dienstag, 11. Juni 2019, 17:21:58 CEST schrieb Florian Schmaus:
> On 11.06.19 16:25, Dave Cridland wrote:
> > I think the optimal ping, from the server's perspective, radically
> > changes depending on whether there are outstanding messages, and whether
> > there's an outstanding XEP-0198 ack.
> > 
> > From a client's perspective it's really dependent on whether the user is
> > active, and if not, whether there is a push notification scheme in play.
> > 
> > For the server, I think the ideal algorithm is roughly:
> > 
> > a) If the server spoke last, and there is no XEP-0198 in play, then use
> > a XEP-0199 ping after N (where N is in the order of 30 seconds). A
> > successful ping means the client has now spoken last, of course.
> > b) If the server spoke last and there is XEP-0198 in play, then request
> > an acknowledgement after M (where M is anything from 0 to about 5
> > seconds) after sending a stanza.
> > c) If the client spoke last, send a ping (XEP-0199 or XEP-0198 <r/>)
> > after P seconds (where P is in the order of 300). This is purely to
> > clean up old sessions.
> > 
> > For the client:
> > 
> > a) If the user is active, ping every 2 minutes (perhaps).
> > b) Otherwise, if there is no push, ping every 5 minutes.
> > c) Otherwise, don't ping at all.
> Interesting approach. I would love to learn about the anticipated
> advantages of this scheme and how they are accomplished.
> - Florian

More information about the Standards mailing list