|
|
发表于 2004-6-27 00:32:08
|
显示全部楼层
这个在配置adsl的时候就可有吧。没有用过RH,应该会有这个选项。
$sudo grep mtu /etc/ppp/peers/dsl-provider
mtu 1492
$
这个我的adsl的设置的值。
下面是我引述别人的一段话:“
为了充分利用链路,最好在发送数据包时让每个包的大小为整个链路中最小的MTU,一般情况下就是以太网的1500字节。但是,如果中间有隧道 VPN或PPPoE等链路,这段的MTU比1500要小一点点。系统工作时找出最小的MTU采用如下过程(Path MTU Discovery):
建立tcp连接的syn 和syn+ack包中,带有一个MSS(Max Segment Size)选项,MSS为本地接口的MTU-IP包头-TCP包头。这样,tcp的client和server端都有一个MSS,以后发送tcp数据包时,按照MSS分段,最终的数据链路层的包包大小正好是MTU,并且这些IP包中都有DF(Dont Fragment)位,如果中间某条链路的MTU比较小,这些数据包如果要正常传输必需要 分片,由于设置了DF位,数据包会被丢弃,而返回一个icmp frag needed数据包给源发送站点,源发送站点接到这个icmp包后会减小MSS,直到能正常通信。
如果有原因导致icmp数据包被丢弃,以上工作过程就不能正常进行,表现出来就是稍微大点的tcp数据包无法传输,直接表现就是能ping通,甚至tcp 能connect,但是访问主页无法工作。这种现象称为Path MTU Discovery blackhole,再google上能查到更详细的描述,RFC2923也讲了这个。
我觉得这个说得清楚,也很有道理。
另外如果楼主用到ipables的话,可以看看man iptables,也有这么一段:
TCPMSS
This target allows to alter the MSS value of TCP SYN packets, to control the maximum size for that connection (usu-
ally limiting it to your outgoing interface's MTU minus 40). Of course, it can only be used in conjunction with -p
tcp.
This target is used to overcome criminally braindead ISPs or servers which block ICMP Fragmentation Needed packets.
The symptoms of this problem are that everything works fine from your Linux firewall/router, but machines behind it
can never exchange large packets:
1) Web browsers connect, then hang with no data received.
2) Small mail works fine, but large emails hang.
3) ssh works fine, but scp hangs after initial handshaking.
Workaround: activate this option and add a rule to your firewall configuration like:
iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN \
-j TCPMSS --clamp-mss-to-pmtu
--set-mss value
Explicitly set MSS option to specified value.
--clamp-mss-to-pmtu
Automatically clamp MSS value to (path_MTU - 40).
These options are mutually exclusive. |
|