scribble.rs icon indicating copy to clipboard operation
scribble.rs copied to clipboard

Extend `keep-alive` message to support round trip time measurements

Open BigETI opened this issue 3 years ago • 3 comments

The keep-alive message is being used to keep connections between clients and servers open. It would be great to extend it to measure round trip time between connections, which is known as "ping". "Ping" messages could have data attached to them, so clients or servers can identify to which requests they belong to.

BigETI avatar Feb 21 '21 03:02 BigETI

How would we even properly implement this when server and client have different times? I guess we'd need a time server?

Bios-Marcel avatar Feb 25 '21 15:02 Bios-Marcel

Wait what, no. We do not need a "time" server. The contained message could be anything random, just to identify from which message it was replied from, therefore making it possible to measure round trip time relaibly.

A starts a stopwatch and sends a message which contains "ABC", B receives message and responses with "ABC". A receives response and stops stopwatch. Measured time can be used for example to display ping.

BigETI avatar Feb 26 '21 07:02 BigETI

nvm, i thought of time syncing

Bios-Marcel avatar Feb 26 '21 08:02 Bios-Marcel