首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >更改linux网络设备的TCP超时

问更改linux网络设备的TCP超时
EN

Stack Overflow用户
提问于 2013-03-19 03:09:26
回答 2查看 83.5K关注 0票数 9

我在一个非常慢的界面上编写linux设备驱动程序,它的ping循环时间可能长达几分钟。当我尝试使用TCP在两个节点之间建立连接时,连接总是超时。

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

EN

回答 2

Stack Overflow用户

发布于 2013-03-19 03:28:26

你试过搜索这个问题的答案吗?在谷歌上快速搜索一下,我得到了this,它似乎直接解决了这个问题。总结是,net.ipv4.tcp_syn_retries的设置决定了TCP连接可用的最大超时。

如果该文档没有回答您的问题,您应该指出您尝试了什么,以及行为与您预期的行为有何不同。

票数 8
EN

Stack Overflow用户

发布于 2013-03-19 03:32:30

代码语言:javascript
复制
/proc/sys/net/ipv4/tcp_retries1
/proc/sys/net/ipv4/tcp_retries2

。

代码语言:javascript
复制
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.
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15484906

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档