The Broadband Guide
SG
search advanced

Windows 2k/XP - More Tweaks

2001-03-31 (updated: 2022-11-03) by
Tags: , , , , ,

You can find our main Windows 2000/XP tweaks and patches here: Windows 2k/XP Registry Tweaks
On this page, you will find additional tips and tweaks for improving your network performance and broadband experience with Windows 2k/XP.


Tweak DNS Errors Caching in Windows

All current Windows versions starting with Windows 2000 have built-in DNS (Domain Name System) caching, which basically caches resolved hostnames for faster access and reduced DNS lookups. This is generally a great feature, with the only downside that failed DNS lookups get cached by default as well... When a DNS lookup fails (due to temporary DNS problems), Windows still caches the unsuccessful DNS query, and in turn fails to connect to a host regardless of the fact that the DNS server might be able to handle your lookup seconds later.

There are a couple of different ways to tweak Windows not to cache failed DNS lookups:

1. You can flush the DNS cache manually, by going to Command Prompt and typing: ipconfig /flushdns
2. You can wait for the cached lookup to expire or reboot the system...

Or you can permanently solve this issue by tweaking a few Registry entries. You can simply use the patch below to modify your Registry:

winxp_dnscache.zip - patches for Windows 2000 and Windows XP not to cache failed DNS entries. To install, save to your HD and double-click the filename for your OS. Use the XP patch for Windows 2003 server.
winxp_dnscache_undo.inf - patch to reverse all changes made by both the Windows 2000 and XP/2003 patches above. To install, save to your HD, then right-click on the filename and chose "install" from the pull-down menu.

If you'd rather do the changes manually, and assuming you feel comfortable editing the Windows Registry, here are the related Registry entries (recommended values are highlighted in red):

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters]

MaxNegativeCacheTtl=0 (DWORD, default value: 0x12C (300 seconds), range: 0x0-0xFFFFFFFF seconds) Description: Determines how long an entry recording a negative answer to a query remains in the DNS cache. When the time specified in the value of this entry expires, the DNS client deletes the answer record from cache. This is a Windows XP and 2003 Server setting only, the Windows 2000 equivalent is NegativeCacheTime.

NegativeCacheTime=0 (DWORD, default value: 0x12C (300 seconds), range: 0x0-0xFFFFFFFF seconds) Description: Determines how long an entry recording a negative answer to a query remains in the DNS cache. When the time specified in the value of this entry expires, the DNS client deletes the answer record from cache. This is a Windows 2000/2008/Vista/Windows 7 setting, for Windows XP/2003 please use MaxNegativeCacheTtl instead.

NetFailureCacheTime=0 (DWORD, default value: 0x1E (30 seconds), range: 0x0-0xFFFFFFFF seconds) Description: Determines for how long the DNS client stops sending queries when it suspects that the network is down. When the DNS client does not receive responses to repeated queries sent to any network adapter, the DNS client stops sending queries for the time specified in the value of this entry. During that time, the DNS client returns a timeout response to all queries. If the value of this entry is 0x0, this optimizing feature is disabled. DNS continues to send queries to an unresponsive network.

NegativeSOACacheTime=0 (DWORD. default value: 0x78 (120 secnds), range: 0x0-0xFFFFFFFF seconds) Description: Determines how long an entry recording a negative answer to a query for an SOA (Start of Authority) record remains in the Domain Name System (DNS) cache. When the time specified in the value expires, the DNS client deletes the answer record from the cache.

Note: As always when editing the Registry, a backup is a good idea, and reboot might be required for changes to take effect.

Related Articles:

MS TechNet - DNS Caching, Network Prioritization and Security
TechTV - Kill DNS Errors for Faster Broadband
Microsoft - DNS Resolver Cache Service


Increase bandwidth by tweaking QoS

The following tweak applies only to Windows XP Professional edition (and other Windows versions that may have QoS Policy installed). The default system behavior is that all 100% bandwidth is available, however, if there is a running application that indicates to the OS it needs to send high priority/real time data, then as long as it has the socket open, Windows XP will restrict "best effort" traffic to 80% of the bandwidth so that high priority traffic can be accommodated. Basically, applications can make this request to the operating system for QoS support using the QoS application programming interfaces (APIs) in Windows and this only applies if a specific app is requesting QoS. If you'd like to change how much bandwidth is reserved for QoS (the default is 20% of the total bandwidth), do the following:

1. Make sure you're logged in as "Administrator" (not just any account with admin privileges).
2. Navigate to START>Run and type: gpedit.msc
3. Navigate to Local Computer Policy > Administrative Templates > Network > QOS Packet Scheduler
4. In the right window, double-click the limit reservable bandwidth setting
5. On the setting tab, check the enabled setting.
6. Where it says "Bandwidth limit %", change it to read 0 (or whatever percentage you want to reserve for high priority QoS data)
7. Click OK, close gpedit.msc

Under START > My Computer > My Network Connections > View Network Connections, right-click on your connection and under Properties (where it lists your protocols), make sure QOS Packet Scheduler is enabled.

Alternate Method (Windows Registry)

Instead of editing the group policy, one can edit the Windows Registry directly:

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Psched
NonBestEffortLimit=0 (DWORD, not present in the registry by default. Recommended: 0 , possible values between 0 and 100) - indicates the percentage value of reserved bandwidth for QoS applications. Set to 0 to disable.

Notes: This tweak applies only to Windows versions that have Qos Packet Scheduler enabled.
You need to reboot for changes to take effect.
The Windows Vista registry location is the same as Windows XP

To read more about QoS and ToS/Diffserv, check the TCP Optimizer documentation, or refer to Technet/MSDN.
References:
Technet: QoS Tools and Settings


Gaming Tweak - Disable Nagle's algorithm

The tweak below allows for tweaking or disabling Nagle's alogrithm. Disabling "nagling" allows for very small packets to be transferred immediately without delay. Note that is only recommended for some games, and it may have negative impact on file transfers/throughput. The default state (Nagling enabled) improves performance by allowing several small packets to be combined together into a single, larger packet for more efficient transmission. While this improves overall performance and reduces TCP/IP overhead, it may briefly delay transmission of smaller packets. Keep in mind that disabling Nagle's algorithm may have some negative effect on file transfers, and can only help reduce delay in some games. To implement this tweak, in the registry editor (Start>Run>regedit) find:

This setting configures the maximum number of outstanding ACKs in Windows XP/2003/Vista/2008:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{NIC-id}
There will be multiple NIC interfaces listed there, for example: {1660430C-B14A-4AC2-8F83-B653E83E8297}. Find the correct one with your IP address listed. Under this {NIC-id} key, create a new DWORD value:
TcpAckFrequency=1 (DWORD value, 1=disable, 2=default, 2-n=send ACKs if outstanding ACKs before timed interval. Setting not present by default).

For gaming performance, recommended is 1 (disable). For pure throughput and data streaming, you can experiment with values over 2. If you try larger values, just make sure TcpAckFrequency*MTU is less than RWIN, since the sender may stop sending data if RWIN fills without an acknowledgement.

Also, find the following key (if present):
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSMQ\Parameters
Add a new DWORD value:
TCPNoDelay=1 (DWORD value, 0 to enable Nagle's algorithm, 1 to disable, not present by default)

To configure the ACK interval timeout (only has effect if nagling is enabled), find the following key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{NIC-id}
TcpDelAckTicks=0  (DWORD value, default=2, 0=disable nagling, 1-6=100-600 ms). Note you can also set this to 1 to reduce the nagle effect from the default of 200ms without disabling it.

For Windows NT SP4, the TcpDelAckTicks path is:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\{NIC-id}\Parameters\Tcpip
TcpDelAckTicks=0 (Default=2, 0=disables nagling, 1-6=100-600 ms)

Notes:
Reportedly, the above gaming tweak (disabling nagle's algorithm) can reduce WoW (World of Warcraft) latency by almost half!
XP/2003 needs hotfix or SP2 for it to work (MS KB 815230)
Vista needs hotfix or SP1 for it to work (MS KB 935458)

References:
RFC 2581
Wikipedia: Nagle's algorithm
Technet: TCPNoDelay
MS KB 311833
MS KB 321098
MS KB 321169
Smallvoid: nagle algorithm



Checksum Offloading

This NDIS 5 setting allows for reducing CPU load by offloading some tasks required to maintain the TCP/IP stack to the network card. Theoretically, Widnows should automatically detect capable network hardware.

The tasks offloaded are as follows:
- TCP/IP checksum calculation - each packet sent includes a verification checksum.
- TCP/IP segmentation - also known as "TCP Large Send" where Windows sends a large amount of data to the network card, and the NIC is then responsible for dividing it according to the network MTU. Experimental feature, not enabled by default
- IPSec Encryption cyphers and message digests - provides encryption of packets at the hardware level.

To change the checksum offloading in the Windows Registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
DisableTaskOffload=0
(DWORD value, 0=enable offload, 1=disable offload, default not set)
Recommended: leave at default unless experiencing problems.

Note: Checksum offloading should not be activated together with the Windows Firewall.
Also see: MS KB 888750, MS KB 904946, MS KB 936702


TcpTimedWaitDelay (port allocation)

By default, short-lived (ephemeral) ports between 1024 and 5000 are allocated as needed by the OS. The default settings are usually sufficient under normal load. However, in some instances it may be necessary to adjust the parameters below to tweak the availability of user ports requested by an application.

If the default limits are exceeded under heavy loads, the following error may be observed "address in use: connect exception". By default (when the values are not present in the registry), ports between 1024 and 5000 are allocated, with the OS waiting 4 minutes before reclaiming ports after an application closes the TCP connection. If necessary, the following two registry values may be tweaked:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
MaxUserPort=20000
(DWORD, not in the registry by default. Recommended: 20000 decimal) - maximum port number above 1024 to use.
TcpTimedWaitDelay=30 (DWORD, not in the registry by default. Recommended: 30 decimal, denoting 30 seconds) - time to wait before reclaiming ports, in seconds


For additional tweaks and information, check some of our other related articles:
Windows XP/2k tweaking
Advanced Tweaking
Host Resolution Priority Tweak
Browser Tweaks
LAN Tweaking
Windows Vista / 2008 Tweaks


  User Reviews/Comments:
    rate:
   avg:
by mx - 2006-06-10 10:27
quite good!!
by Mr.187 - 2006-09-02 19:53
Hi there! If I type 80% will it increase my bandwidth and make my download faster?! thank you!
by TripleTaco - 2007-08-21 16:53
I heard Microsoft XP Media Center Edition is built on XP Pro. Do you think it would work on Media Center Edition?
by anonymous - 2007-10-03 23:06
Yes it works the reason for the xp professional limitation statement is because only xp professional and above (media center is above..) have gpedit.msc
by anonymous - 2007-10-04 02:10
Sorry !! The Media center comment above isn't quite true !
take a look :
http://technet2.microsoft.com/windowsserver/en/library/450c1fec-d358-42f4-b7e4-18b3f47ef6ff1033.mspx?mfr=true
by anonymous - 2008-04-01 14:19
just jumped and installed gpedit.msc files on my xphome machines, and it works just fine.
So much on the web says it is only for pro.
It reallllly does not mess you up and gives you more tools we really should have in Home edition.
by blazer9x - 2008-10-27 05:26
wow.. nice tweaking ^^

my connection's response increased ^^

thankz
by Pao - 2009-02-19 08:40
When you say create a new dword value, I right click> new> dword> then where do i input "TcpAckFrequency=1" ?
by Philip - 2009-02-19 11:47
You have to first create/name the new DWORD value TcpAckFrequency.
Then, double-click the newly created dword to edit it, and enter 1 in the dialog.
by praga619 - 2009-11-02 09:57
when u say ur bandwidth increased after u changed it to 80%...in how much time did it increase
News Glossary of Terms FAQs Polls Cool Links SpeedGuide Teams SG Premium Services SG Gear Store
Registry Tweaks Broadband Tools Downloads/Patches Broadband Hardware SG Ports Database Security Default Passwords User Stories
Broadband Routers Wireless Firewalls / VPNs Software Hardware User Reviews
Broadband Security Editorials General User Articles Quick Reference
Broadband Forums General Discussions
Advertising Awards Link to us Server Statistics Helping SG About