Mailing List Archive

relp protocol enhancement support wanted
Hello,

I've helped to emerge java libraries for relp
client https://github.com/teragrep/rlp_01 (Apache License)
server https://github.com/teragrep/rlp_03 (AGPL link-freely license, may change)

However after writing the libraries I found out following draft on the
protocol itself:
https://github.com/rsyslog/librelp/blob/master/doc/relp.html

This states that Hint Commands start with 0 transaction number.

I would like to add keepalive hint command to the protocol which is
just to keep otherwise idle connection open. Of course there are
consequences for having too many connections open, but server can do
something about those if really needed.

However I stumpled upon problems when interacting with librelp. I
wanted to prototype these by hand instead of implementing something
incompatible:

rsyslog is listening with imrelp on localhost 601. Please ignore lines
starting with # because they are just to make it easier to read:

proof of normal session working
[root@hostname ~]# nc localhost 601
# send client offer
1 open 48 relp_version=0
relp_software=xyz
commands=syslog
# server replies
1 rsp 93 200 OK
relp_version=0
relp_software=librelp,1.10.0,http://librelp.adiscon.com
commands=syslog
# client sends syslog command (not rfc5424 but it's okish)
2 syslog 3 abc
# server acknowledges that it has been received
2 rsp 6 200 OK
# client indicates close
3 close 0
# server acknowledges again
3 rsp 0
# server hints that it will tear the connection down
0 serverclose 0

everything is fine and dandy as seen from above.

[root@hostname ~]# nc localhost 601
# send client offer
1 open 58 relp_version=0
relp_software=xyz
commands=syslog,keepalive
# server responds
1 rsp 93 200 OK
relp_version=0
relp_software=librelp,1.10.0,http://librelp.adiscon.com
commands=syslog
2 close 0
# server acknowledges closure
2 rsp 0

this is fine and according to the specification which is cool. it does
not support keepalive as expected, so it can not be used as a command.

i wouldn't even like it to be as a such as it's not a "ping" which
would cause server to act on it i.e. wait for client to process the
pong response. so i rather try:

# send client offer (without keepalive)
1 open 48 relp_version=0
relp_software=xyz
commands=syslog
# server responds as usual
1 rsp 93 200 OK
relp_version=0
relp_software=librelp,1.10.0,http://librelp.adiscon.com
commands=syslog
# client sends keepalive as hint
0 keepalive 0
# server does not like it and closes the connection
0 serverclose 0

this was kind of expected as it was not listed as a command.

the specification does not mention that serverclose is part of the
offers, neither it states that it must not be part of the offers as a
built-in as open rsp and close are.
client offer and server response neither contain indication that it
exists. it is however on the documentation and works only when server
sends it.

if client tries to use 0 serverclose 0 the server closes the
connection which is expected as it is said on the documentation that
server can only send. (no working around keepalives with this on the
current version).

i am willing to go with the keepalive as a command and use it with 0
keepalive 0 and it would not be responded. would this be the correct
approach? i wonder if the serverclose should be part of the protocol
built-ins or should it be a command too?

i would like to use keepalives together with librelp/rsyslog so in
case there is interest for adding support for this please let me know.

during this i found interesting feature from both, librelp and rlp_03 servers:
java server:
# client sends syslog as hint (currently it's not interested about open)
0 syslog 0
# server responds with 200 OK (was sent to processing)
0 rsp 6 200 OK

rsyslog
# client sends open (required)
1 open 48 relp_version=0
relp_software=xyz
commands=syslog
# server respons as normal
1 rsp 93 200 OK
relp_version=0
relp_software=librelp,1.10.0,http://librelp.adiscon.com
commands=syslog
# cleint sends syslog as hint
0 syslog 0
# server responds just fine
0 rsp 6 200 OK

spec says 0 is hint and "Hints are commands that are not being
responded". however both them seem to send it to processing.

please let me know how do you see the keepalive and the serverclose.

Kind regards,
Mikko
_______________________________________________
rsyslog mailing list
https://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE THAT.