注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

gmd20的个人空间

// 编程和生活

 
 
 

日志

 
 

tcp window scaling特性,某些NAT路由器或者防火墙支持不好,会导致随机性的tcp连接不能建立问题?(windows 7和linux 禁用 TCP auto-tuning/tcp window scaling办法)  

2014-08-08 17:02:20|  分类: 电脑常识 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

生产机上面http  client 连接远程的http server时, 很多tcp连接建立失败, syn 包发送出去,没有收到服务器的响应。
但同一时刻,有的连接又可以建立成功,有大概30%的概率会失败,两台虚拟机,随机的某一台出现问题,过段时间又自己恢复了。
网上很多人也记录到类似的问题, 说是可能由于 tcp window scaling选项导致的,  我们自己wireshark抓的syn包的头部是有WS标志的,不知道是不是真的这个原因导致的。


说是某些NAT路由器或者firewall可能对 tcp window scaling 支持的不是很好,
可能会产生随机性的连接问题,然后过几分钟又恢复了。 (Because some routers and firewalls do not properly implement TCP Window Scaling, it can cause a user's Internet connection to malfunction intermittently for a few minutes, then appear to start working again for no reason. There is also an issue if a firewall doesn't support the TCP extensions. [1]    http://support.microsoft.com/kb/934430 )
微软的文档提到了很多已经发现问题的设备。


http://serverfault.com/questions/235965/why-would-a-server-not-send-a-syn-ack-packet-in-response-to-a-syn-packet


windows 7 上面禁用 TCP auto-tuning
===================================
说是用这个命令可以修改
netsh interface tcp show global
netsh interface tcp set global autotuning=disabled
netsh interface tcp set global autotuning=normal


The default auto-tuning level is "normal", and the possible settings for the above command are:
disabled: uses a fixed value for the tcp receive window. Limits it to 64KB (limited at 65535).
highlyrestricted: allows the receive window to grow beyond its default value, very conservatively
restricted: somewhat restricted growth of the tcp receive window beyond its default value
normal: default value, allows the receive window to grow to accommodate most conditions
experimental: allows the receive window to grow to accommodate extreme scenarios (not recommended, it can degrade performance in common scenarios, only intended for research purposes. It enables RWIN values of over 16 MB)



Linux上面禁用 tcp window scaling
==============================

Linux[edit]
Linux kernels (from 2.6.8, August 2004) have enabled TCP Window Scaling by default. The configuration parameters are found in the /proc filesystem, see pseudo-file /proc/sys/net/ipv4/tcp_window_scaling and its companions /proc/sys/net/ipv4/tcp_rmem and /proc/sys/net/ipv4/tcp_wmem (more information: man tcp, section sysctl).[5]
Scaling can be turned off by issuing the command sysctl -w "net.ipv4.tcp_window_scaling=0" as root. To maintain the changes after a restart, include the line "net.ipv4.tcp_window_scaling=0" in /etc/sysctl.conf.



参考
http://en.wikipedia.org/wiki/TCP_window_scale_option

  评论这张
 
阅读(580)| 评论(1)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017