Repair TCP/IP Stack in Windows Vista

July 2, 2009 by Robert Owen  
Filed under MicroSoft, Support, Vista Quest

virusYou had a virus, drive corruption, or some other OS altering situation.  But, being the hero you are, you resolved it and your PC is up and running again.  That is, until you try to access the internet or some other network resource.  The computer sits there trying to access that web page but nothing is happening… (Much like a MAC and its “spinning wheel of death“).  First you check your network connection… Then check to see if you have obtained an IP address and other credentials.  All good.  What gives?

One possibility is that you have a corrupt TCP/IP stack.  What is the TCP/IP stack?  First, TCP/IP  is an important part of the operating system that allows it to communicate across a network.  (Transmission Control Protocol /Internet Protocol)  Network architectures are designed in layers, such as TCP/IP, OSI and SNA, and are called “stacks.” (See TCP/IP, OSI model and protocol stack)

What can causes a corrupt TCP/IP stack?  Drive corruption can cause this, or sometimes a virus can re-write your TCP/IP stack to suit it’s purposes – Bend it to it’s will, so to speak.  So when you remove said virus your TCP/IP layer is rendered unusable to the operating system (corrupted).

To fix this issue we use the NetShell utility.  The NetShell utility (netsh) is a command-line scripting interface for the configuring and monitoring of Windows XP, Server 2003 and Windows Vista networking services.  This will reinstall and reset the TCP/IP stack (Internet Protocol) to its original state.  To do this in Windows XP or Server 2003 we used the following command:

netsh int ip reset [ log_file_name ]

Example:
netsh int ip reset resetlog.txt

The above command will reset the TCP/IP stack and write a log file called resetlog.txt, recording it’s actions.

Windows Vista, adds a little hitch to the process because of the UAC (User Access Control).

To reset the Stack in Windows Vista there are a few more steps:

  1. Click the Start Pearl.
  2. Type Cmd in the  Search box.
  3. Press the Ctrl-Shift-Enter (this is a shortcut that will run the Command Prompt as Administrator. )
  4. Type netsh int ip reset at the Command Prompt then press the Enter key.
  5. You will then have to restart the computer to complete the reset.

The command will remove all user configured settings on TCP/IP stack and return it to original default state.  After the reboot completes, your network and internet browsing and use should return.



If you facing network connection issue, or more accurately unable to access or connect to Internet

or network problem in Windows Vista, Windows 2003 and Windows XP, and repair WinSock settings plus workaround for Vista IE7 strange no connection problem do not save your from Internet woes, you can try to reinstall and reset TCP/IP stack or Internet Protocol, one of the core component of the operating system

, which cannot be uninstalled.

Again, with a corrupt TCP/IP stack, the same woes may happen – unable to establish a connection to the server, unable to load a web page, unable to browse and surf the Internet, even though network connection to broadband router

or wireless router appear to be OK.

When all means run out, try to reinstall the IP stack with NetShell utility. NetShell utility (netsh) is a command-line scripting interface for the configuring and monitoring of Windows XP

, 2003 and Vista networking service.

To reinstall and reset the TCP/IP stack (Internet Protocol) to its original state as same as when the operating system was installed in Windows XP and Windows 2003, simply use the following command in command prompt shell. A log file name must be specified where actions taken by netsh will be recorded on newly created or appended if already existed file..

netsh int ip reset [ log_file_name ]

Example:

netsh int ip reset resetlog.txt

For Windows Vista, things work a little different due to introduction of UAC (Guide: Disable UAC). Use this guide to perform a reinstalling of TCP/IP protocol in Vista:

  1. Click on Start button.
  2. Type Cmd in the Start Search text box.
  3. Press Ctrl-Shift-Enter keyboard shortcut to run Command Prompt as Administrator. Allow elevation request.
  4. Type netsh int ip reset in the Command Prompt shell, and then press the Enter key.
  5. Restart the computer.

The command will remove all user configured settings on TCP/IP stack and return it to original default state by rewriting pertinent registry keys that are used by the Internet Protocol (TCP/IP) stack to achieve the same result as the removal and the reinstallation of the protocol

Possibly Related Posts:


Remote Desktop Slow in Vista

I am using my Vista Ultimate machine primarily now for day-to-day work.. And everything is running quite smoothly to be honest. No crashes, no freezes, no spyware.. Everything is great.

I help manage SEVERAL servers across my WAN and use Remote Desktop to great effect. But, last week a new Server was added. I logged in with my trusty Remote desktop to start setting up an SFTP server. Only, this time everything was WAY WAY WAY Slow… I mean I was waiting a good thirty seconds between clicks. I thought it might be my connection so I logged off, ran some speed tests, logged into another server and everything was great. So, I logged back into the server in question. SLOW! What’s going on?? On a whim I tried to log in to the server from my XP machine… It was Super Speedy??

Time to hit Google. Did a search and ran across the VoIP & Gadgets Blog. Looks like Tom was having the same trouble and found a solution.

Remote Desktop 6.0 leverages a new feature called auto-tuning for the TCP/IP receive window that could be causing the trouble. What is auto-tuning for the TCP/IP receive window? Well, the new Microsoft TCP/IP stack supports Receive Window Auto-Tuning. Receive Window Auto-Tuning continually determines the optimal receive window size by measuring the bandwidth-delay product and the application retrieve rate, and adjusts the maximum receive window size based on changing network conditions.

In Vista, Receive Window Auto-Tuning enables TCP window scaling by default, allowing up to a 16 MB window size. As the data flows over the connection, the TCP/IP stack monitors the connection, measures the current bandwidth-delay product for the connection and the application receive rate, and adjusts the receive window size to optimize throughput. The new TCP/IP stack no longer uses the TCPWindowSize registry values which many third-party utilities used to “tweak”.

Receive Window Auto-Tuning has a number of benefits. It automatically determines the optimal receive window size on a per-connection basis. In Windows XP, the TCPWindowSize registry value applies to all connections. Applications no longer need to specify TCP window sizes through Windows Sockets options. And IT administrators no longer need to manually configure a TCP receive window size for specific computers.

This setting can be turned off in Vista. First open a command prompt (cmd) as Administrator.. It’s not good enough for your user to have Administrative privileges… Right click on the Icon and select “Run as Administrator”
Then when the command window opens type:

netsh interface tcp set global autotuninglevel=disabled

To re-enable this feature you need to type:

netsh interface tcp set global autotuninglevel=normal

Tom also says that in some cases you may need to type:

netsh interface tcp set global rss=disabled

But I did not have to.. The first command solved my problem immediately!!

This also makes this my Site of the Week! Because it was WAY handy, Go by and check it out.. Maybe Tom has some answers for you?

Possibly Related Posts: