改变超时TCP一个Linux网络设备[关闭](Change the TCP timeout for

2019-08-17 17:43发布

我在一个非常缓慢的接口,其平圆时间可长达几分钟编程Linux设备驱动。 当我尝试使用TCP建立两个节点的连接总是超时之间的连接。

是否有设置在驱动程序中的TCP重发或握手超时更长的时间,还是有什么命令来设置它的方法? 谢谢

Answer 1:

您是否尝试过寻找一个回答这个问题? 快速谷歌搜索给了我这个 ,这似乎直接解决这个问题。 该摘要是,的设定net.ipv4.tcp_syn_retries确定可用的TCP连接的最大超时值。

如果该文件回答你的问题,你应该表明你尝试什么,以及如何行为,从您所期望的不同。



Answer 2:

/proc/sys/net/ipv4/tcp_retries1
/proc/sys/net/ipv4/tcp_retries2

tcp_retries1 - INTEGER


 This value influences the time, after which TCP decides, that
    something is wrong due to unacknowledged RTO retransmissions,
    and reports this suspicion to the network layer.
    See tcp_retries2 for more details.

    RFC 1122 recommends at least 3 retransmissions, which is the
    default.


tcp_retries2 - INTEGER

This value influences the timeout of an alive TCP connection,
when RTO retransmissions remain unacknowledged.
Given a value of N, a hypothetical TCP connection following
exponential backoff with an initial RTO of TCP_RTO_MIN would
retransmit N times before killing the connection at the (N+1)th RTO.

The default value of 15 yields a hypothetical timeout of 924.6
seconds and is a lower bound for the effective timeout.
TCP will effectively time out at the first RTO which exceeds the
hypothetical timeout.

RFC 1122 recommends at least 100 seconds for the timeout,
which corresponds to a value of at least 8.


文章来源: Change the TCP timeout for a linux network device [closed]