Re: [ovs-discuss] OVSDB connection keep-alive vs. echo RPC

2017-12-09 Thread Matt Layher via discuss
Thank you both for the information.  I've implemented an optional 
client-initiated echo option, and the ability to echo when prompted by 
the server.


- Matt


On 12/07/2017 03:43 PM, Ben Pfaff wrote:

On Thu, Dec 07, 2017 at 01:59:45PM -0500, Matt Layher via discuss wrote:

But that leads me to another question: does ovsdb-server send echo RPCs to
its clients at all?  If so, I can implement something to reply in my receive
loop.  If not, I won't bother.

Yes, it does (unless configured not to do that).


___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


Re: [ovs-discuss] OVSDB connection keep-alive vs. echo RPC

2017-12-07 Thread Ben Pfaff
On Thu, Dec 07, 2017 at 01:59:45PM -0500, Matt Layher via discuss wrote:
> But that leads me to another question: does ovsdb-server send echo RPCs to
> its clients at all?  If so, I can implement something to reply in my receive
> loop.  If not, I won't bother.

Yes, it does (unless configured not to do that).
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


Re: [ovs-discuss] OVSDB connection keep-alive vs. echo RPC

2017-12-07 Thread Roman Bolshakov
It definitely sends for TCP. You can telnet to ovsdb socket and see the the
requests.
чт, 7 дек. 2017 г. в 21:59, Matt Layher :

> I've already got something like that set up anyway so that I can listen
> for notifications for things like "locked", "steal", "update", etc.  I
> think I've got it nailed down pretty well at the moment.
>
> But that leads me to another question: does ovsdb-server send echo RPCs to
> its clients at all?  If so, I can implement something to reply in my
> receive loop.  If not, I won't bother.
>
>
>
> - Matt
>
> On 12/07/2017 01:38 PM, Roman Bolshakov wrote:
>
> Couple years ago I implemented my own lib for OVSDB. It had one
> communication thread that replied on the echoes as well as sent management
> commands from the application. Something very similar of what you're
> thinking to implement but based on python coroutines.
>
> Built-in Python lib is different and talks to wire in the application
> thread. It replies to probes over TCP but doesn't send them over Unix
> socket. OVSDB drops a client that doesn't reply a probe. So in case of TCP,
> it reconnects after a user send a request to process a Transaction.
>
> As far as I understand echo request/replies work better for a local/remote
> OVS controller that needs full awareness of database state and all changes
> within it. Indeed, OVN Southbound (as OVS controller) uses it like that.
>
> IMO, for management operations outside of an OVS controller, It's simpler
> to avoid separate thread with probe replies as additional IPC is needed
> between threads.
>
> чт, 7 дек. 2017 г. в 20:25, Matt Layher via discuss <
> ovs-discuss@openvswitch.org>:
>
>> Hi all,
>>
>> I'm working on implementing an OVSDB client in Go
>> (https://godoc.org/github.com/digitalocean/go-openvswitch/ovsdb) and
>> recently implemented the Echo RPC.
>>
>> https://tools.ietf.org/html/rfc7047#section-4.1.11
>>
>> According to the RFC, the purpose of Echo is "to verify the liveness of
>> a database connection".  Does this mean that Echo should be used as a
>> keep-alive of sorts for long-running connections?  I'm thinking about
>> adding a background loop to my client that sends Echo RPCs at a regular
>> interval for this purpose.
>>
>> Next, if I were to connect to ovsdb-server via TCP instead of UNIX
>> socket, would enabling TCP keep-alives serve the same purpose?
>>
>> If neither of these approaches are necessary, it'd avoid adding some
>> additional complexity to the code.  I'd be very curious to hear what
>> folks have done.
>>
>> Thanks for your time,
>>
>> Matt Layher
>>
>> ___
>> discuss mailing list
>> disc...@openvswitch.org
>> https://mail.openvswitch.org/mailman/listinfo/ovs-discuss
>>
>
>
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


Re: [ovs-discuss] OVSDB connection keep-alive vs. echo RPC

2017-12-07 Thread Matt Layher via discuss
I've already got something like that set up anyway so that I can listen 
for notifications for things like "locked", "steal", "update", etc.  I 
think I've got it nailed down pretty well at the moment.


But that leads me to another question: does ovsdb-server send echo RPCs 
to its clients at all?  If so, I can implement something to reply in my 
receive loop.  If not, I won't bother.


- Matt


On 12/07/2017 01:38 PM, Roman Bolshakov wrote:
Couple years ago I implemented my own lib for OVSDB. It had one 
communication thread that replied on the echoes as well as sent 
management commands from the application. Something very similar of 
what you're thinking to implement but based on python coroutines.


Built-in Python lib is different and talks to wire in the application 
thread. It replies to probes over TCP but doesn't send them over Unix 
socket. OVSDB drops a client that doesn't reply a probe. So in case of 
TCP, it reconnects after a user send a request to process a Transaction.


As far as I understand echo request/replies work better for a 
local/remote OVS controller that needs full awareness of database 
state and all changes within it. Indeed, OVN Southbound (as OVS 
controller) uses it like that.


IMO, for management operations outside of an OVS controller, It's 
simpler to avoid separate thread with probe replies as additional IPC 
is needed between threads.


чт, 7 дек. 2017 г. в 20:25, Matt Layher via discuss 
mailto:ovs-discuss@openvswitch.org>>:


Hi all,

I'm working on implementing an OVSDB client in Go
(https://godoc.org/github.com/digitalocean/go-openvswitch/ovsdb) and
recently implemented the Echo RPC.

https://tools.ietf.org/html/rfc7047#section-4.1.11

According to the RFC, the purpose of Echo is "to verify the
liveness of
a database connection".  Does this mean that Echo should be used as a
keep-alive of sorts for long-running connections?  I'm thinking about
adding a background loop to my client that sends Echo RPCs at a
regular
interval for this purpose.

Next, if I were to connect to ovsdb-server via TCP instead of UNIX
socket, would enabling TCP keep-alives serve the same purpose?

If neither of these approaches are necessary, it'd avoid adding some
additional complexity to the code.  I'd be very curious to hear what
folks have done.

Thanks for your time,

Matt Layher

___
discuss mailing list
disc...@openvswitch.org 
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss



___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


Re: [ovs-discuss] OVSDB connection keep-alive vs. echo RPC

2017-12-07 Thread Roman Bolshakov
Couple years ago I implemented my own lib for OVSDB. It had one
communication thread that replied on the echoes as well as sent management
commands from the application. Something very similar of what you're
thinking to implement but based on python coroutines.

Built-in Python lib is different and talks to wire in the application
thread. It replies to probes over TCP but doesn't send them over Unix
socket. OVSDB drops a client that doesn't reply a probe. So in case of TCP,
it reconnects after a user send a request to process a Transaction.

As far as I understand echo request/replies work better for a local/remote
OVS controller that needs full awareness of database state and all changes
within it. Indeed, OVN Southbound (as OVS controller) uses it like that.

IMO, for management operations outside of an OVS controller, It's simpler
to avoid separate thread with probe replies as additional IPC is needed
between threads.

чт, 7 дек. 2017 г. в 20:25, Matt Layher via discuss <
ovs-discuss@openvswitch.org>:

> Hi all,
>
> I'm working on implementing an OVSDB client in Go
> (https://godoc.org/github.com/digitalocean/go-openvswitch/ovsdb) and
> recently implemented the Echo RPC.
>
> https://tools.ietf.org/html/rfc7047#section-4.1.11
>
> According to the RFC, the purpose of Echo is "to verify the liveness of
> a database connection".  Does this mean that Echo should be used as a
> keep-alive of sorts for long-running connections?  I'm thinking about
> adding a background loop to my client that sends Echo RPCs at a regular
> interval for this purpose.
>
> Next, if I were to connect to ovsdb-server via TCP instead of UNIX
> socket, would enabling TCP keep-alives serve the same purpose?
>
> If neither of these approaches are necessary, it'd avoid adding some
> additional complexity to the code.  I'd be very curious to hear what
> folks have done.
>
> Thanks for your time,
>
> Matt Layher
>
> ___
> discuss mailing list
> disc...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-discuss
>
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


Re: [ovs-discuss] OVSDB connection keep-alive vs. echo RPC

2017-12-07 Thread Ben Pfaff
On Thu, Dec 07, 2017 at 12:24:51PM -0500, Matt Layher via discuss wrote:
> I'm working on implementing an OVSDB client in Go
> (https://godoc.org/github.com/digitalocean/go-openvswitch/ovsdb) and
> recently implemented the Echo RPC.
> 
> https://tools.ietf.org/html/rfc7047#section-4.1.11
> 
> According to the RFC, the purpose of Echo is "to verify the liveness of a
> database connection".  Does this mean that Echo should be used as a
> keep-alive of sorts for long-running connections?  I'm thinking about adding
> a background loop to my client that sends Echo RPCs at a regular interval
> for this purpose.

Yes, echo requests can be used for this purpose and that's their normal
use.

The C and Python libraries suppress this functionality by default when
they connect over a unix domain socket, because the kernel reliably
ensures that unix domain sockets stay connected.

> Next, if I were to connect to ovsdb-server via TCP instead of UNIX socket,
> would enabling TCP keep-alives serve the same purpose?

I believe that TCP keepalives only affect otherwise idle connections.
TCP keepalives normally operate very slowly, on the order of several
minutes to hours.  I also understand that they are not necessarily
end-to-end if the connection passes through some kinds of proxies etc.


> If neither of these approaches are necessary, it'd avoid adding some
> additional complexity to the code.  I'd be very curious to hear what folks
> have done.

The kernel does monitor TCP connections that have outstanding data to
make sure that they are still operational, but it takes minutes (up to
20 minutes in some situation if I recall correctly) to detect and
disconnect in that case.  We have found that echo requests and replies
are valuable in situations where we just can't wait that long.
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


[ovs-discuss] OVSDB connection keep-alive vs. echo RPC

2017-12-07 Thread Matt Layher via discuss

Hi all,

I'm working on implementing an OVSDB client in Go 
(https://godoc.org/github.com/digitalocean/go-openvswitch/ovsdb) and 
recently implemented the Echo RPC.


https://tools.ietf.org/html/rfc7047#section-4.1.11

According to the RFC, the purpose of Echo is "to verify the liveness of 
a database connection".  Does this mean that Echo should be used as a 
keep-alive of sorts for long-running connections?  I'm thinking about 
adding a background loop to my client that sends Echo RPCs at a regular 
interval for this purpose.


Next, if I were to connect to ovsdb-server via TCP instead of UNIX 
socket, would enabling TCP keep-alives serve the same purpose?


If neither of these approaches are necessary, it'd avoid adding some 
additional complexity to the code.  I'd be very curious to hear what 
folks have done.


Thanks for your time,

Matt Layher

___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss