[jdev] XEP-0199 (XMPP Ping) to test reliability

Dave Cridland dave at cridland.net
Mon Jan 21 13:59:14 CST 2008

On Mon Jan 21 18:52:54 2008, Yann Leboulanger wrote:
> In gajim we send whitespace ping if we haven't received or sent  
> anything in the past 55 seconds (cause some nat server close  
> connection if nothing happen in a minute)
> But whitespace ping are not enough, so replacing it with xmpp-ping  
> with the same time would be nice.
Mhh. Okay. Whitespace pings aren't enough to tell if the connection  
is actively able to send and receive packets. XEP-0199 tells you not  
only that, but it also tells you whether the thing you're pinging is  
willing and able to respond.

Both have a use, although for c2s links, XEP-0198 is rather more  

Don't confuse those use-cases, because whether or not you use  
XEP-0199 to test c2s connectivity, whitespace pings are still  
lighter, and perfect for keeping recalcitrant NATs in line.

XEP-0199 is particularly useful when you're expecting a response, but  
don't seem to be getting anything.

> about the time for answer, are some network connection or server so  
> slow that it can reply only 20 seconds later? I have no feedback on  
> that, but isn't 5 or 10 seconds enough?

HF radio links would need much more, whereas a DSL link would need  

A good rule of thumb might be 10 times the normal RTT. (Which you can  
detirmine by the usual response to XEP-0199 pings).

IMHO, a nice UI would simply note that the latency seemed  
tremendously high, and offer to reconnect, rather than kill the  
session - as Michal pointed out, the user often knows what the  
situation is.

Dave Cridland - mailto:dave at cridland.net - xmpp:dwd at jabber.org
  - acap://acap.dave.cridland.net/byowner/user/dwd/bookmarks/
  - http://dave.cridland.net/
Infotrope Polymer - ACAP, IMAP, ESMTP, and Lemonade

More information about the JDev mailing list