Lag detection extension

Ideas for ADC may be presented here for others to review and point out flaws or further improve the idea.
Forum rules
If you have an account on the wiki, remember to update the ADC Proposals page for new ideas.

http://dcbase.org/wiki/ADC_Proposals_list
Locked
Ayo
Junior Member
Posts: 27
Joined: 23 Feb 2011, 13:50

Lag detection extension

Post by Ayo » 20 Jul 2011, 10:13

I've been constantly reminded of this in several ways since working with ADC: there is no lag detection. I'm used to using IRC, where irssi nicely tells me the lag between the server and the client. DC does not have something like this in the protocol, and spamming a single-char message in the main chat (what many people seem to do...) isn't exactly a clean solution.

So here I propose an extension similar to the PING command in IRC*. To avoid confusion with pinger extentions, we can call this the 'LAGD' (lag detection) feature. This extention is negotiated with the hub<->client in the SUP command, and adds two commands:

PIN: A ping request.
PON: A ping response.

Neither commands have any parameters - although future extentions might add parameters.

When either the client or the hub receive a PIN, they should immediately reply with a PON. No further actions should be taken.

A PON message does not require any action and can be safely ignored. A client or hub can use the time between sending a PIN and receiving the PON to determine the lag. Clients can regularely send a PIN to detect that the connection is still alive, and possibly to make sure that there is activity on the TCP connection to make sure it stays alive in routers, etc. This is similar to the practice of regularly sending an empty command to keep the connection alive, except that this also allows lag detection. A hub may also use this to poll that the client is still alive and responding.

Currently I'm only interested in this feature for hub<->client lag detection, thus limiting the commands to the 'H' and 'I' types. It could, however, also be extended to ping other clients on a hub, e.g. using DPIN. This, however, requires detection of this feature with the SU parameter in INF to work reliably, and I don't consider this to be very important.

*Disclaimer: At least, what I believe PING in IRC does, I am not very familiar with the actual workings of the IRC protocol.

(Alternatively, it's also possible to implement lag detection in the client by sending a DMSG to oneself, but that's an ugly hack...)

Quicksilver
Member
Posts: 56
Joined: 17 Aug 2009, 21:32

Re: Lag detection extension

Post by Quicksilver » 20 Jul 2011, 13:47

Wouldn't a DSTA with yourself as target work without change to hubs?

Locked