Subject: Re: keepalive support

Re: keepalive support

From: Simon Josefsson <simon_at_josefsson.org>
Date: Thu, 28 Jan 2010 15:51:00 +0100

Simon Josefsson <simon_at_josefsson.org> writes:

> However, for completeness libssh2 should support this variant as well.
> The main practical reason is that I suspect that other SSH servers out
> there just send a GLOBAL_REQUEST instead of CHANNEL_REQUEST. I will
> validate this theory with Bitvise/SSHD if I can get hold of them and
> configure them properly.

I managed to debug what Bitvise SSHD does, and if you set "Keep-alive /
broken session detection (s)" to 1 it will send SSH_MSG_IGNORE fields
with 4 bytes of data every 6 (!) second. The first two bytes appears to
be 00 and the final two appears to be random, see below.

Using MSG_IGNORE for keep-alives appears sensible compared to
MSG_GLOBAL_REQUEST or CHANNEL_REQUEST -- on the other hand, you only
cause traffic to be generated from the server to the client, and not in
the other direction. So the server cannot tell for sure whether the
client is still around. Right now I prefer a GLOBAL_REQUEST.

ignore 4
d[00] = 00
d[01] = 00
d[02] = 85
d[03] = 38
...
ignore 4
d[00] = 00
d[01] = 00
d[02] = 76
d[03] = 8a
...
ignore 4
d[00] = 00
d[01] = 00
d[02] = 81
d[03] = 3b
...
ignore 4
d[00] = 00
d[01] = 00
d[02] = 4c
d[03] = 06
...
ignore 4
d[00] = 00
d[01] = 00
d[02] = 5f
d[03] = 66
...

/Simon
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-01-28