Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change the TCP timeout for a linux network device [closed]

I am programming linux device driver over a very slow interface, whose ping round time can be as long as several minutes. When I try to use TCP to establish connection between two nodes the connection always times out.

Is there a method to set the TCP retransmission or handshaking timeout longer in the driver, or are there any commands to set it with? Thanks

like image 452
Yifan Sun Avatar asked Mar 18 '13 19:03

Yifan Sun


People also ask

How do I keep my TCP connection alive in Linux?

Linux has built-in support for keepalive. You need to enable TCP/IP networking in order to use it. You also need procfs support and sysctl support to be able to configure the kernel parameters at runtime.

How do I increase socket timeout in Linux?

You can increase or decrease timeouts on TCP sockets using the file tcp_keepalive_time found on the directory /proc/sys/net/ipv4/ . The default timeout value is 7200 (2 hours).


1 Answers

Have you tried searching for an answer to this question? A quick Google search gave me this, which appears to directly address this issue. The summary is that the setting of the net.ipv4.tcp_syn_retries determines that maximum timeout available to TCP connections.

If that document doesn't answer your question, you should indicate what you tried and how the behavior differed from what you expected.

like image 143
larsks Avatar answered Oct 27 '22 11:10

larsks