PDA

View Full Version : [SOLUTION] Improve Performance of the connection - Adjusting the MTU size



RatzaTM
06-11-2008, 12:44
! IMPORTANT NOTICE ! - I do not encourage you to do the below , you can try and improve the connection at your own pleasure and will. You can at any time revert to the default value by reinstalling WindowsXP or setting the default value associated to your connection :


Network MTU (bytes)
-----------------------------------
16 Mbps Token Ring 17914
4 Mbps Token Ring 4464
FDDI 4352
Ethernet 1500
IEEE 802.3/802.2 1492
PPPoE (WAN Miniport) 1480
X.25 576


This tweak only works as described for WindowsXP.

WHY would you do these steps ? Some users that could not access the ITEM SHOP and received the "ERROR" message, were able to access it after setting the correct MTU size (because the network packets did not fragment).

Hello dear readers,

As i have noticed in the last few days, more and more people are complaining about lagging , disconnections , etc. Most of these issues appear due to connectivity performance which by default is not optimized for WindowsXP.

Terms used :

MTU = Maximum Transmission Unit
PPPoE = Point to Point Protocol over Ethernet - a client<=>server connection over the already existent ethernet connection
NIC = Network Interface Card (the network adapter , network card in your PC)


We will talk here about how you can maximize the output of your network card.


THE MAXIMUM TRANSMISSION UNIT


In networking, the term : Maximum Transmission Unit (MTU) refers to the size (in bytes) of the largest packet that a given layer of a communications protocolNIC, serial port, etc.). The MTU may be fixed by standards (as is the case with Ethernet) or decided at connect time (as is usually the case with point-to-point serial links). A higher MTU brings higher bandwidth efficiency. However, large packets can block up a slow interface for some time, increasing the lag for further packets.

MTU problems may result in degraded network service, but may not affect some users' abilities to access the required applications, so sometimes MTU problems go unreported. Other times, MTU problems cause severe lags in network logon times, cause email attachments and other functions within Outlook to fail, and cause applications to stop functioning entirely. Note that, by default, the MTU on Windows operating systems is 1500 (Ethernet) and that a change to 1492 may resolve some, but not all, problems.

The MTU must be set to the same setting on all your PC NICs (network adapters) and router. When using can pass onwards. MTU parameters usually appear in association with a communications interface (VPN, there is additional overhead and you may need to reduce the MTU to 1400 if you experience difficulties accessing email, web, or DSL connectivity problems.


HOW TO DETERMINE THE MAXIMUM MTU THAT YOU CAN USE


A series of ping tests using the command,
ping www.dslreport.net -f -l xxxx, where xxxx is the packet size, can be used to determine the optimal MTU for your connection. (the l is a small L , and not a vertical bar)
To do so , go to Start , Run , type CMD , at the prompt that appears type :

ping www.dslreport.net -f -l 1500http://img407.imageshack.us/img407/512/snap2fi6.jpg

As you can see , the package is too large to be sent in one piece so it has to be fragmented.
Lower the size the packet in increments of +/-10 (e.g. 1500 > 1490 > 1480 > ...) until you have a packet size that does not fragment.

In the below example , i lowered it to 1490 , and it still fragmented. I lowered it to 1480 and it still fragmented, so i lowered it to 1470 and i got a reply on my pinig.

http://img186.imageshack.us/img186/754/snap4ok7.jpg

Now , after finding the value at which you get a reply , it's time to start increasing it in increments of 1 .. (e.g. 1470 > 1471 > 1472 > 1473 ..... > 1479 - because we know 1480 will fragment the packet for sure).

Your goal is to find the maximum value between 1470 and 1480 at which the package does not fragment (in my case).

In your case , instead of 1470 and 1480 you can have other values ..

1470 replies
1471 replies
1472 replies
1473 needs fragmentation ..

And we stop .. The value we were looking for was 1472 . That's the highest value that allows no fragmentation.


HOW TO EDIT THE VALUE WHICH YOU HAVE FOUND BY USING THE PING COMMAND


The Windows built-in PPPoE client has a default MTU of 1480.
! NEVER ! set a MTU size smaller than 1,400.

To change this value to the one you found , do this :
Click Start, click Run, type regedit, and then click OK.
Locate and then click the following key in the registry:HKEY_LOCAL_MACHINE \ System \ CurrentControlSet \ Services \ Ndiswan \ Parameters
On the Edit menu, point to New, and then click Key
Type Protocols, and then press ENTER
On the Edit menu, point to New, and then click Key.
Type 0, and then press ENTER.
On the Edit menu, point to New, and then click DWORD Value.
Type ProtocolType, and then press ENTER.
On the Edit menu, click Modify.
Type 800, and then click OK.
On the Edit menu, point to New, and then click DWORD Value.
Type PPPProtocolType, and then press ENTER.
On the Edit menu, click Modify.
Type 21, and then click OK.
On the Edit menu, point to New, and then click DWORD Value.
Type ProtocolMTU, and then press ENTER.
On the Edit menu, click Modify.
Type the appropriate MTU size (decimal value), and then click OK.
Quit Registry Editor and reboot.!! NOTE !!

When you find a value (for example 1472 as i found) remember to add 28 bytes before entering the value in the registry.

The 28 bytes represent the header for ICMP pinging which are substracted. This means that if i found 1472 , the value that i will enter in the registry is 1472+28 = 1500 (the default for ethernet).

If the value i find via pinging is 1464 , then the value i will enter in the registry is 1464 + 28 = 1492 (default for IEEE 802.3/802.2 connections)

hi_babe_
06-11-2008, 14:11
oh sry nvm my post o typed sth wrong xD

hm 1464 for me

but got an average of 221 ms xD

pratici1
06-11-2008, 14:20
the " -1 " thing doesn't work for me :(

i get " option incorrect -1 " which mean not correct option -1 ...:(

here is how it looks :


is -l (L) and not 1

RatzaTM
06-11-2008, 14:22
I wrote it :P

(the l is a small L , and not a vertical bar)

pratici1
06-11-2008, 14:27
Zaraki;783662']I wrote it :P

(the l is a small L , and not a vertical bar)

Maximum for me is 1472 so i must write 1450 (1472 + 28).
I must do in all the pc of my network ? (2 Lan and 1 Wifi).

Remember my problem with low upload ? This can help ?

Ty Regards

RatzaTM
06-11-2008, 14:32
Maximum for me is 1472 so i must write 1450 (1472 + 28).
I must do in all the pc of my network ? (2 Lan and 1 Wifi).

Remember my problem with low upload ? This can help ?

Ty Regards

If the value detected via ping is 1472 , you must write 1472 + 28 = 1500 (the default value for Ethernet 10/100 cards) in the registry .. So enter 1500 ..

And do this for all the PCs that are connected.

Also remember that the router + all network cards must have the same MTU.

If you have a wi-fi , be sure to read the specifications , but for PCs connected to the router , yes , they both have to have the same MTU as the router => share the same network characteristics.

hi_babe_
06-11-2008, 14:55
did i make good ? xD

but i didn't get where i must type 1464+28 (= 1492), must i type "1492 " and where to type 1464 and 28 then ? i'm a bit confused :s

may u provide a screenshot of were we have to type 1464,28 and 1492 ?

pratici1
06-11-2008, 15:00
# Type ProtocolMTU, and then press ENTER.
# On the Edit menu, click Modify.
# Type the appropriate MTU size (decimal value), and then click OK.
# Quit Registry Editor and reboot.

Read this.

RatzaTM
06-11-2008, 15:02
did i make good ? xD

but i didn't get where i must type 1464+28 (= 1492), i typed only 1464 in the last thing but couldn't type "+" ?

may u provide a screenshot of were we have to type it ?

Yes, ProtocolMTU has to be set to that value ..

But what value did you get ?

Wait a second , now i know !

1492 is IEEE , and you had 1500 which was Ethernet and this might have caused your packages to fragment, because they were too large *8 bytes larger* and the network was getting clogged.

Maybe that's why you had issues ... You must put 1492 , not 1464 , since the 28 have to be added before entering the value.

If you have a router of some sort , make sure to set it to 1492 too .. If not , then it's all good.

WarriorAtWar
06-11-2008, 15:16
Great Tutorial Zaraki! :congrats:

I'm gonna test this when I get home, I really hope it improves my ping (although my Internet connection is a 6 Mb/s ADSL, sometimes it's even slower than a GPRS (mobile) connection, with pings bigger than 900ms :wacko:).

EDIT: Actually I thing that my ping got even worse, but I'm not sure, I'll further test it this weekend (I need some time at night when I know for sure that my ping should be low).

EDIT_2: Yup for some reason the MTU defined on the registry was already 1492, but the max packet size sent via "ping" was only 1452 and by setting it to 1480 (1452 + 28) in the registry made the ping even worse.
My ISP (sapo.pt) and their "hardware" (Sagem F@st E840) really sucks :wacko:.
I hope it help others.

RatzaTM
07-11-2008, 20:11
Yes, a good observation .. This is because usually the ISP does not modify the MTU of it's hardware .. but on certain hardware , it is required .

This goes to show how professional they are , by not fully utilizing their bandwidth.

mn1302
09-11-2008, 16:27
do i need to do this on vista too?

edit: how can i defragment disks on vista? (the defragmentation on vista takes ages, and u cant see the progress it makes,... (and i cant doublepost on the "tweaking your computer for maximal performance (though the last post in that topic, was two months ago,...) )

orochikage
13-11-2008, 18:42
i dont know much about this stuff but is it posible that this is why my skype (program like ventrilo) and internet browser keeps disconnecting when i go trough a warp portal or do premium warping please i need to know before i start doing wierd stuff to my pc i am not an expert