|
放寒假时发现的问题
原帖子在http://www.linuxsir.cn/bbs/showthread.php?t=264158
tingXX兄弟似乎也遇到了
http://www.linuxsir.cn/bbs/showthread.php?t=269867
主要表现就是能ping到对方机器,但就是连接不上.windows下可以连接.
2.6.17内核.
解决方法,在
/etc/sysctl.conf添加- net.ipv4.tcp_window_scaling = 0
复制代码
即可
具体参见maillist
Message: 2
Date: Fri, 8 Sep 2006 23:11:18 +0200
From: "Jose M. Prieto" <jmprieto@gmx.net>
Subject: [arch] Kernel 2.6.17 and TCP window scaling
To: arch@archlinux.org
Message-ID: <200609082311.18715.jmprieto@gmx.net>
Content-Type: text/plain; charset="us-ascii"
Hi, after some time running a custom 2.6.15 kernel, yesterday, I decided to
upgrade to stock kernel26-2.6.17.11-1.
I rebooted and all seemed to work fine until I opened a browser and noticed I
couldn't connect to the internet. Nothing in the system logs nor in dmesg
catched my attention and, according to ifconfig, the network interface was
up. So, at first, I thought my crappy DSL router had died. I tried to connect
to its web interface with no luck... but I could ping it and I could ping
internet sites, even using DNS names. In some moment I realized that there is
one fundamental difference between ping, dns and http or ftp: ping uses ICMP
and dns uses UDP, while http and ftp use TCP.
After booting with an older kernel and doing some googling (without any
network issue) I found the source of the problem [1]. A change in the way the
kernel calculates TCP buffer sizes has caused it to use TCP window scaling by
default under some circumstances. Window scaling is an old standard, but
anyway it seems some modern equipment (such as my router) still can't handle
it. There are several posts in the mailing list [2] and in the forums which
seem to be related to this [3,4,5,6] (some regarding kernel 2.6.8, as that
version introduced a similar change that was reverted or somehow fixed
later).
TCP window scaling can be disabled by setting the kernel parameter
net.ipv4.tcp_window_scaling to 0 (I am sending this email from a 2.6.17,
after adding that setting to /etc/sysctl.conf). Disabling window scaling will
only slightly affect performance over high speed, long distance network
links, while having it enabled will greatly affect performance much more
often. So I think it would be wise to disable it in the default sysctl.conf.
If someone wants window scaling (s)he can comment out the line.
[1] http://kerneltrap.org/node/6723
[2] http://www.archlinux.org/pipermail/arch/2006-June/011250.html
[3] http://bbs.archlinux.org/viewtopic.php?t=24248
[4] http://bbs.archlinux.org/viewtopic.php?t=22818
[5] http://bbs.archlinux.org/viewtopic.php?t=22743
[6] http://bbs.archlinux.org/viewtopic.php?t=6188 |
|