Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server: disable tcpkeepalive #2635

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ChenYahui2019
Copy link

@ChenYahui2019 ChenYahui2019 commented Mar 8, 2023

The default value for tcpkeepalive in the golang net package is 15 seconds, while the default value for BGP keepalive is 30 seconds. If the network is not good, the TCP connection is disconnected before BGP can send keepalive messages.

Therefore, BGP keepalive is effectively invalid.

The solution is that since we have BGP keepalive, we don't need to open tcp keepalive.

The default value for tcpkeepalive in the standard net
package is 15 seconds, while the default value for BGP
keepalive is 30 seconds. If the network is not good,
the TCP connection is disconnected before BGP can send
keepalive messages.

Therefore, BGP keepalive is effectively invalid.

The solution is that since we have BGP keepalive, we
don't need to open tcp keepalive.

Signed-off-by: Chen Yahui <[email protected]>
@fujita
Copy link
Member

fujita commented Mar 8, 2023

looks like frr supports tcp keepliave. bird doesn't use. Not sure what is appropriate. I tend to keep this alone because nobody hasn't complained about this until now.

@ChenYahui2019
Copy link
Author

looks like frr supports tcp keepliave. bird doesn't use. Not sure what is appropriate. I tend to keep this alone because nobody hasn't complained about this until now.

Unfortunately, we've had this problem for over a year.

The network of our cloud IAAS is complex. When there is heavy traffic, the BGP connection may be disconnected.

We tried to adjust the BGP keepalive interval, but this didn't work.

Finally, we locate the root cause of the problem is the TCP keepalive problem. This is OK to verify in our environment.

@fujita
Copy link
Member

fujita commented Mar 9, 2023

@ChenYahui2019
Copy link
Author

ChenYahui2019 commented Mar 9, 2023

By default, the socket created by syscall does not enable tcpkeepalive.

However, golang's net package enables the socket tcpkeepalive and sets the keepalive period to 15 seconds by setsockopt. Please have a look at source code of link below:
https://github.com/golang/go/blob/71c84d4b4149bebc2abcc495ef744e1a010a18e7/src/net/dial.go#L17

Therefore, modifying the tcpkeepalive configuration of the OS does not affect this bug.

https://tldp.org/HOWTO/TCP-Keepalive-HOWTO/usingkeepalive.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants