IMac – Problems with Internet connection on the Mac – Gmail, calendar and Skype work but some websites will not open

imacinternetNetwork

I am using OS X Yosemite version 10.10 on my iMac.

For about a week now, I've had problems with my Internet connection. I am connected via ethernet. I can use Gmail, Skype and Google Calendar without problems but when I access other websites, I often get "website doesn't respond" kind of answer. It helps when I restart the computer but the problem returns after a while.

When I do the diagnostic test in System Preferences > Network > Assist me, it tells me that all is fine with my connection. I also tried to restart my router but that did not help either. Other devices that work on wifi (iPad, Dell laptop) work fine on the same Internet network. Also, when I switch connection from Ethernet to wifi, it is the same problem again.

I followed the advice given by Martín Marconcini to this question on the forum: "I cannot connect to internet but my MacBook Pro detects the network and my HP computer works fine on the same network" (Jun 30 '12 at 9:33) but it did not solve the issue. When I go to TCP/IP I see that I am using DHCP. Following the advice by Martín Marconcini I changed my DNS to 8.8.8.8. So that is what I see in the DNS tab now (the others I had there disappeared). Also, everything is unchecked in the Proxies tab.

My IP address is: 192.168.0.13. Subnet mask: 255.255.255.0 Router: 192.168.0.1.

Best Answer

This could be caused by Path MTU Discovery.

Test by changing MTU

To test this, go to System Preferences > Network, click on Ethernet then Advanced... and finally select the Hardware tab.

In there, you should see a Configure option and the drop down menu next to it most likely is set to Automatic. Choose Manual then you'll see the other options become available. Leave all options as they are, but change the bottom one, MTU, from Standard (1500) to Custom and in the field that shows up below type 1400.

Accept all changes and see if you have any more success while browsing.

Test using ping in Terminal

A more definitive test you can do is in the Terminal.app and using the ping command.

If the website that gives you trouble has a URL http://www.troublesomewebsite.com/, you can do the following:

  1. Ping the website by typing: ping www.troublesomewebsite.com. If you get responses, proceed to the next point below; if not, replace the www.troublesomewebsite.com with an address of another website you're having issues with and repeat.
  2. When you find a site that does respond, type the following command and see if you get responses: ping -s 1472 -D www.troublesomewebsite.com. If you DO get responses, then it's NOT a Path MTU Discovery issue.
  3. If you DON'T get responses, decrease the number 1472 to say 1464 and run the command again, like so: ping -s 1464 -D www.troublesomewebsite.com. Keep doing that until you start getting responses. Most likely, if this IS the PMTUd problem, you should get responses again with the packet size set to somewhere between 1464-1456 bytes. Add 28 to the number at which you start getting the responses and that's the MTU you can set on your computer to work around your issue.

Background Information

Path MTU discovery is a mechanism that manifests itself by frequent and seemingly intermittent timeouts when browsing some websites but not others. This has to do with misconfigured firewall rules on the website side, which prevent ICMP traffic to go through, specifically the ICMP unreachable message. That in turn breaks the pmtud behaviour, which is how most of the TCP/IP stacks have been working for at least the last 20 years or so.

The MTU becomes an issue especially if your broadband connection uses DSL - in such case, there is an extra 8 bytes of PPP header that need to be used, and if the Service Provider didn't configure their links to use larger frames, this results in a smaller payload available to your packets - hence the need to decrease the MTU on your computer.

More information available in RFC1191 and this Wikipedia Article