The tcp/ip stack is called a stack because it contains 4 layers chained together. Sometimes the links between layers can become broken resulting in total loss of connection to the network. If you experience total connection loss and you get no reply when you type "ping 127.0.0.1" at the command prompt your stack has probably become corrupted. If you get a reply from the ping, but still can't connect to the network your problem is elsewhere.
With Windows XP the tcp/ip stack can be reset by following the instructions here.
If the problem occurs with Windows XP when trying to renew a dynamically assigned address and the error is "An operation was attempted on something that is not a socket" the repair is described here
With other OS versions there are free utilities to help repair the stack. Most of them are covered in section 3.0 of this FAQ.
If all else fails it is time to remove the drivers for the network card and reboot. Upon restarting Windows will start the "Found New Hardware" wizard. Reinstall the card with the latest drivers if possible. Then rebind TCP/IP to the card.
Feedback received on this FAQ entry: