2011/02/22 2835 Views
MTU,即Maximum Transmission Unit(最大传输单元),MTU值设定TCP/IP协议传输数据报时的最大传输单元。设置合适的MTU值还可以解决“部分网站打不开”、“上网速度慢”等问题,并且可以适当提升上网速度。所以,MTU值不是随便指定的,不同的上网方式支持不同的MTU:EtherNet(一般上网方式,默认值):1500,PPPoE/ADSL为1492,Dial Up/Modem为576。
那么如果我不知道自己的上网方式,如何确定MTU值呢?方法很简单:点击“开始”--“运行”--“输入CMD后回车”,然后再命令提示符里面输入:ping -f -l 1500 127.0.0.1,如果出现下面的结果:
C:\WINDOWS>ping -f -l 1500 www.qq.com
Pinging 127.0.0.1 with 1500 bytes of data:
Packet needs to be fragmented but DF set.
Packet needs to be fragmented but DF set.
Packet needs to be fragmented but DF set.
Packet needs to be fragmented but DF set.
Ping statistics for 127.0.0.1:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss), Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
Pinging 127.0.0.1 with 1500 bytes of data:
Packet needs to be fragmented but DF set.
Packet needs to be fragmented but DF set.
Packet needs to be fragmented but DF set.
Packet needs to be fragmented but DF set.
Ping statistics for 127.0.0.1:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss), Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
则说明不合适,然后将1500改成1492,1440等其他数值,只要比1500小,当出现可以PING通了,就说明这个值可以,当然,你可以选很多数值,找出能够ping通的最大值,此最大值即为MTU最合适的值。ping通的大至提示为:
C:\WINDOWS>ping -f -l 1464 www.qq.com
Pinging 127.0.0.1 with 1464 bytes of data:
Reply from 222.73.78.166: bytes=1464 time=10ms TTL=128
Reply from 222.73.78.166: bytes=1464 time<10ms TTL=128
Reply from 222.73.78.166: bytes=1464 time<10ms TTL=128
Reply from 222.73.78.166: bytes=1464 time<10ms TTL=128
Ping statistics for 127.0.0.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 10ms, Average = 2ms
Pinging 127.0.0.1 with 1464 bytes of data:
Reply from 222.73.78.166: bytes=1464 time=10ms TTL=128
Reply from 222.73.78.166: bytes=1464 time<10ms TTL=128
Reply from 222.73.78.166: bytes=1464 time<10ms TTL=128
Reply from 222.73.78.166: bytes=1464 time<10ms TTL=128
Ping statistics for 127.0.0.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 10ms, Average = 2ms
一般来讲,设计好本机的MTU值,可以解决部分网站打不开的情况,但是如果你的共享主机或路由器的MTU设置有问题,有时问题仍然存或,或者出现网速过慢的情况。合理的设置路由器与本机的MTU值,就可以完全解决上述问题,使上网速度达到最大化。
Leave a comment