Solution for Weird Communications Issues
I’ve had some recent experience with communications failures and I found the solution was to turn off a setting on my Network Interface Card (NIC) that I never knew existed. This lead me to some personal thoughts on how technicans resolve problems.[Edit: This was originally written a couple months ago. I dunno why I didn’t post it…]
I do a lot of client/server development which requires my client code to connect back onto my localhost to communicate with some server software. Sometimes I use raw sockets, other times I use common protocols. Sometimes I use tools like mv.NET. I’ll also sometimes use Microsoft Virtual PC (VPC) for my testing. This allows me to install and run code, then completely blow it away and start from scratch. This way I don’t have to worry about some prior installation (registry entries, etc) confusing my current testing.
The problem manifested itself in a couple ways. First there were intermittent failures. When client code would just stop talking to server code for no apparent reason. When I had VPC running I eventually started running a Ping test to my host box from the VPC guest environment, and another one from the host back to the VPC. Pings would run for about 3 minutes, then go completely dead for a few minutes more. I thought it was a regular cycle but it wasn’t. To complicate matters, these local pings weren’t working but I could easily telnet between environments, access internet websites with the browser, etc. I found that if I let the environments sit without touching them at all, the communications would remain dead. But if I used the environments for some other network traffic (checking email, browsing, etc) the pings would start back up again after a few minutes. The fact that automated processes check for updates only confused me more, as the pings would startup again at random times without me doing anything at all.
Posting the symptoms to a couple public forums returned no responses. I bumped my inquiries and provided more info, but no one seemed to have any info to offer, until one guy responded with something that I had never heard of. He said many NICs have a feature which caused them to shut-off to save power! He provided information to turn this off. My problems went away. Just today I was helping a client with some similarly weird problems. His DesignBais developer environment wasn’t communicating with his Universe database on the localhost. After trying some other remedies with no joy I decided to hit this switch. I dunno if this was the solution but it certainly was a solution! Because I have verified that this is not just something happening on my own systems I figured I’d share it with you.
Open your Local Area Connection, or whatever you call the Network Connections item for your primary NIC. Go to Properties. Usually we use this dialog to set TCP/IP data, IP address, DNS, etc. But the "Connect Using" box shows the NIC to which all of these settings apply. Click the Configure button. Note my dialog and the available tabs. You might have more or less tabs – you might see Resources or you may not see Power Management. If you don’t see that Power Management tab then this doesn’t apply to your NIC (sorry).
Note the checkboxes – that first one is always checked as the default to "Allow the computer to turn off this device to save power". All you need to do now is uncheck that, click OK to save, and close the other dialogs. I don’t believe a reboot is required.
If you’re not having weird problems as described above, but you find that setting above is checked anyway, it might be a good idea to just leave it. What are the consequences for turning off the NIC? I guess the answer depends on your environment. On a web server, that setting could be a problem but on a laptop it could be helpful. Then again, on a laptop used for development with a localhost webserver, you could be experiencing the problems I had.
Another angle to this issue