When you're having the problem...
1.) Try pinging your router. Do you get a reply?
2.) Try pinging a common website, like
www.google.com. Do you get a reply?
3.) Try pinging an external IP address, like 74.125.127.104 (Google). Do you get a reply?
If no reply for #1, then most likely your router is the problem, possibly rebooting for no reason.
If reply for #1, but no reply for #2 and #3, then it's your actual Internet connection that's the problem.
If reply for #1, no reply for #2, but reply for #3, then it's likely a problem with the DNS servers that is being used.