首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >哪个是Windows中的默认TCP连接超时?

哪个是Windows中的默认TCP连接超时?
EN

Server Fault用户
提问于 2010-10-20 21:34:52
回答 4查看 247K关注 0票数 36

哪个是Windows中的默认TCP连接超时?有一个注册表项来配置它,还是动态设置它?

EN

回答 4

Server Fault用户

回答已采纳

发布于 2010-10-20 22:47:15

在Windows中,对于已建立的连接,该值是动态的,尽管初始连接的缺省值是72秒。本文定义了注册表设置:

http://technet.microsoft.com/en-us/library/cc739819(WS.10).aspx

HKEY_LOCAL_MACHINE \SYSTEM \CurrentControlSet \Services:\Tcpip \参数

TcpInitialRTT:定义新连接的初始超时设置。这个数在秒内每重传一倍,然后再给连接计时。默认为3。

TcpMaxConnectRetransmissions:定义连接超时前建立连接时的重传次数。默认为2。

票数 28
EN

Server Fault用户

发布于 2015-02-25 23:10:32

通常,“连接超时”是指创建与主机的初始连接的超时。在许多系统(包括Windows 7)中,此值是在建立连接后使用与正在进行的通信的超时单独设置配置的。这个答案解决了Windows 7的“初始连接”场景,这与XP不同。

对于Windows 7,需要两个修补程序来支持调整连接超时设置。可以使用“netsh”命令配置新设置。

来自2786464篇热门文章:

注在Windows7和Windows 2008 R2中,TCP最大SYN重传(JH: MaxSynRetransmissions)值被设置为2,并且是不可配置的。由于初始超时值(JH: InitialRTO)的3秒限制,TCP三路握手限制为21秒时间框架(3秒+2*3秒+4*3秒=21秒)。

第一个修复程序添加了一个“MaxSynRetransmissions”设置,该设置允许将重试设置从默认值2更改为“InitialRto”设置,该设置允许将初始RTO值从默认的3000 be (是的,毫秒)更改为小于3000 be的值;它不能增加。根据您的情况,您可能只需要“MaxSynRetransmissions”修补程序。

安装两个修补程序,重新启动,然后以管理员身份打开命令窗口。以后的netsh命令调用不需要进一步的重新引导。

代码语言:javascript
运行
复制
C:\Windows\system32>NET SESSION >nul 2>&1

C:\Windows\system32>IF %ERRORLEVEL% EQU 0 (ECHO Administrator PRIVILEGES Detected!) ELSE ( ECHO NOT AN ADMIN! )
Administrator PRIVILEGES Detected!

C:\Windows\system32>netsh interface tcp show global
Querying active state...

TCP Global Parameters
----------------------------------------------
Receive-Side Scaling State          : enabled
Chimney Offload State               : automatic
NetDMA State                        : enabled
Direct Cache Acess (DCA)            : disabled
Receive Window Auto-Tuning Level    : normal
Add-On Congestion Control Provider  : none
ECN Capability                      : disabled
RFC 1323 Timestamps                 : disabled
Initial RTO                         : 3000
Non Sack Rtt Resiliency             : disabled
Max SYN Retransmissions             : 2
** The above autotuninglevel setting is the result of Windows Scaling heuristics

overriding any local/policy configuration on at least one profile.

C:\Windows\system32>cmd /v:on /c "echo !TIME! & telnet 192.168.1.254 & echo !TIME!"
14:10:30.53
Connecting To 192.168.1.254...Could not open connection to the host, on port 23: Connect failed
14:10:51.60


C:\Windows\system32>netsh interface tcp set global MaxSynRetransmissions=3
Ok.


C:\Windows\system32>netsh interface tcp show global
Querying active state...

TCP Global Parameters
----------------------------------------------
Receive-Side Scaling State          : enabled
Chimney Offload State               : automatic
NetDMA State                        : enabled
Direct Cache Acess (DCA)            : disabled
Receive Window Auto-Tuning Level    : normal
Add-On Congestion Control Provider  : none
ECN Capability                      : disabled
RFC 1323 Timestamps                 : disabled
Initial RTO                         : 3000
Non Sack Rtt Resiliency             : disabled
Max SYN Retransmissions             : 3
** The above autotuninglevel setting is the result of Windows Scaling heuristics

overriding any local/policy configuration on at least one profile.

C:\Windows\system32>cmd /v:on /c "echo !TIME! & telnet 192.168.1.254 & echo !TIME!"
14:27:02.33
Connecting To 192.168.1.254...Could not open connection to the host, on port 23:
 Connect failed
14:27:47.41

C:\Windows\system32>netsh interface tcp set global MaxSynRetransmissions=2
Ok.


C:\Windows\system32>netsh interface tcp set global InitialRto=1000
Ok.


C:\Windows\system32>netsh interface tcp show global
Querying active state...

TCP Global Parameters
----------------------------------------------
Receive-Side Scaling State          : enabled
Chimney Offload State               : automatic
NetDMA State                        : enabled
Direct Cache Acess (DCA)            : disabled
Receive Window Auto-Tuning Level    : normal
Add-On Congestion Control Provider  : none
ECN Capability                      : disabled
RFC 1323 Timestamps                 : disabled
Initial RTO                         : 1000
Non Sack Rtt Resiliency             : disabled
Max SYN Retransmissions             : 2
** The above autotuninglevel setting is the result of Windows Scaling heuristics

overriding any local/policy configuration on at least one profile.


C:\Windows\system32>cmd /v:on /c "echo !TIME! & telnet 192.168.1.254 & echo !TIME!"
14:29:06.13
Connecting To 192.168.1.254...Could not open connection to the host, on port 23:
 Connect failed
14:29:13.20

注意: Windows用于实际连接超时的引用。它需要单独安装,但很容易做到。

其他链接/荣誉:

票数 12
EN

Server Fault用户

发布于 2011-03-28 16:54:17

TcpInitialRTT和TcpMaxConnectRetransmissions可能不在Vista和Windows2008中。此Microsoft文档不包括它们。http://download.microsoft.com/download/c/2/6/c26893a6-46c7-4b5c-b287-830216597340/TCPIP_Reg.doc

这表明至少TcpInitialRTT已经消失了,尽管我不知道它有多可靠。http://pul.se/Blog-Post-TCP-IP-Stack-hardening-in-Operating-Systems-starting-with-Windows-Vista_SharePoint-kHPTTCP0WJ5,7 zq00hH0wINE

票数 2
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/193160

复制
相关文章

相似问题

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