osrg / gobgp

BGP implemented in the Go Programming Language
https://osrg.github.io/gobgp/
Apache License 2.0
3.59k stars 684 forks source link

How to tell at the goBGP-sever that grpc session to client is down #2412

Open bakulkhanna opened 3 years ago

bakulkhanna commented 3 years ago

Hello,

I am monitoring the gRPC/TCP connection from a client to the goBGP-server (on an Ubuntu VM) via netstat.

I noticed that when I force this connection down by configuring an iptables rule at the goBGP-server machine, the gRPC/TCP session stays up. I have tweaked the Ubuntu VM TCP Keepalive and TCP retries2 parameters but I continue to see this session as ESTABLISHED. I also don't see any TCP Keepalive messages sent by the goBGP-server.

Is there any setting at the goBGP-server at socket creation time that I could modify to have it respect the TCP Keepalive setting of the Ubuntu VM?

Thanks.

difficultwork commented 2 years ago

Hello,

I am monitoring the gRPC/TCP connection from a client to the goBGP-server (on an Ubuntu VM) via netstat.

I noticed that when I force this connection down by configuring an iptables rule at the goBGP-server machine, the gRPC/TCP session stays up. I have tweaked the Ubuntu VM TCP Keepalive and TCP retries2 parameters but I continue to see this session as ESTABLISHED. I also don't see any TCP Keepalive messages sent by the goBGP-server.

Is there any setting at the goBGP-server at socket creation time that I could modify to have it respect the TCP Keepalive setting of the Ubuntu VM?

Thanks.

gobgp not enable the grpc server to detect the client by default. we can add grpc.KeepaliveParams opt when call grpc.NewServer if necessary.

bakul-khanna commented 2 years ago

Hello, I am monitoring the gRPC/TCP connection from a client to the goBGP-server (on an Ubuntu VM) via netstat. I noticed that when I force this connection down by configuring an iptables rule at the goBGP-server machine, the gRPC/TCP session stays up. I have tweaked the Ubuntu VM TCP Keepalive and TCP retries2 parameters but I continue to see this session as ESTABLISHED. I also don't see any TCP Keepalive messages sent by the goBGP-server. Is there any setting at the goBGP-server at socket creation time that I could modify to have it respect the TCP Keepalive setting of the Ubuntu VM? Thanks.

gobgp not enable the grpc server to detect the client by default. we can add grpc.KeepaliveParams opt when call grpc.NewServer if necessary.

Thanks for your response. Yes, if you could add the grpc keepalive option to the gobgp-server that would help us detect a client down scenario by the gobgp-server.

Thanks.

bakul-khanna commented 2 years ago

Can you tell me when this feature (add the grpc keepalive option to the gobgp-server) will be available for me to use?

difficultwork commented 2 years ago

Can you tell me when this feature (add the grpc keepalive option to the gobgp-server) will be available for me to use?

I‘ve no idea. cause there is no option in config file for grpc server, it should add command option for this feature. mybe @fujita could answer this question:)

fujita commented 2 years ago

Send a pull request.

bakul-khanna commented 2 years ago

Since Go Library 1.13 introduces 15 sec server TCP keep-alives by default, I was able to use more recent version of the Go library to build my goBGP executable. This has helped me detect gRPC/TCP connection down at the goBGP server.

Please close this ticket.

Thanks.

difficultwork commented 2 years ago

Since Go Library 1.13 introduces 15 sec server TCP keep-alives by default, I was able to use more recent version of the Go library to build my goBGP executable. This has helped me detect gRPC/TCP connection down at the goBGP server.

Please close this ticket.

Thanks.

Cooool