Troubleshooting Network Problems
From Mac Guides
A wide variety of network problems can occur while using your Mac. The causes are just as diverse, however a few techniques can fix a large number of problems.
Identifying a Slow Connection
Sometimes, the internet may appear slow, and unresponsive, or webpages tend to load more slowly. The causes may be varied, but if all webpages appear to load equally slow, and you suspect the problem might be on your LAN, try this.
Identifying excessive LAN traffic
- Install a bandwidth monitoring tool, such as MenuMeters. With no internet applications running, it should show zero traffic.
- Use the shell. Type this into the Terminal:
This will ask for the root password (as it is running through sudo) and will dump out all tcp traffic for the specified interface. "en1" is typically, but not always, the Airport. Typing ctrl-q and ctrl-s will pause and unpause the output. Ideally, you should be able to identify any domain listed in tcpdump's output. Identifying domains is tricky, but look for ".com" and ".net'.
- If tcpdump shows lots of unrecognizable domains, it may mean your computer or a computer on your LAN is running a net-intensive program. Common causes are filesharers (BitTorrent, Acquisition) or spyware (more common on Windows-based machines).
Identifying bad paths to remote sites
Sometimes, a remote website is unresponsive for others, but not the local machine. This is likely due to a bad node in the path between the local and remote machines.
- Open /Applications/Utilities/Network Utility
- Open the Traceroute tab
- Type in the remote website, such as "google.com" and hit Trace
- After a while, you'll see a list of every node between the local machine and remote. The output looks like this:
Traceroute has started ... traceroute: Warning: google.com has multiple addresses; using 184.108.40.206 traceroute to google.com (220.127.116.11), 64 hops max, 40 byte packets 1 10.114.32.1 (10.114.32.1) 914.657 ms 846.880 ms 941.103 ms 2 stagflstag-rtr1-3.se.rr.com (18.104.22.168) 868.670 ms 883.073 ms 509.596 ms 3 pos10-0.tampflerl-rtr2.tampabay.rr.com (22.214.171.124) 370.200 ms 143.648 ms 228.678 ms 4 pos6-0-oc-192.tampflerl-rtr4.tampabay.rr.com (126.96.36.199) 796.923 ms 282.122 ms 893.738 ms 5 pop2-tby-p0-1.atdn.net (188.8.131.52) 1288.203 ms 905.030 ms 456.472 ms 6 bb1-tby-p0-3.atdn.net (184.108.40.206) 67.447 ms 75.024 ms 66.814 ms 7 bb2-atm-p7-0.atdn.net (220.127.116.11) 51.564 ms 321.921 ms 904.427 ms 8 pop2-atm-p5-0.atdn.net (18.104.22.168) 908.132 ms 520.248 ms 100.082 ms 9 google.atdn.net (22.214.171.124) 342.928 ms 53.205 ms 54.449 ms 10 126.96.36.199 (188.8.131.52) 124.733 ms 108.714 ms 686.391 ms 11 184.108.40.206 (220.127.116.11) 922.571 ms 937.112 ms 920.293 ms 12 18.104.22.168 (22.214.171.124) 866.052 ms 941.489 ms 919.744 ms 13 126.96.36.199 (188.8.131.52) 958.012 ms 924.657 ms 931.739 ms 14 184.108.40.206 (220.127.116.11) 970.860 ms 831.862 ms 732.118 ms 15 18.104.22.168 (22.214.171.124) 370.619 ms 822.449 ms 888.695 ms 16 126.96.36.199 (188.8.131.52) 812.530 ms 830.257 ms 624.533 ms 17 184.108.40.206 (220.127.116.11) 343.272 ms 18.104.22.168 (22.214.171.124) 1113.232 ms 962.343 ms
The local machine is first (hop #1) and the remote machine is last (hop #17, in this case). It means the connection to the remote machine went through 17 nodes (computers, routers...). The three numbers following the node name are 3 times. The lower this time is, the better. If a time shows as simply "* * *" it means that node didn't reply to the traceroute request in 5 seconds.
Identifying Internet-related issues
Sometimes, the local net connection will be fine, but no remote sites will respond. Here are some common problems, and solutions
Bad DNS Cache
DNS Cache is a copy of the domain names and their corresponding addresses of the web servers accessed by a user in a computer on the LAN. Retrieving an IP address from the local cache is almost instantaneous. This eliminates many delays and speeds up browsing for the end user.
If some (or all) remote websites fail to respond, and the connection to the internet is valid, the DNS cache may be old or out of date. To reset the cache, and hopefully restore internet conenction, type the following into the Terminal:
For Mac OS 10.5 and above:
sudo dscacheutil -flushcache
(You'll be asked for the root password, since sudo is being used).
That action has the effect of making all internet queries ask for the actual IP address of the remote server, again, rather than relying on a previously recorded IP address.
Incorrect MTU Settings
MTU or Maximum Transmission Unit refers to the size (in bytes) of the largest packet or frame that a given layer of a communications protocol can pass onwards.
If partial internet connectivity is experienced including corrupt web pages and downloads with https:/ site problems, the internet connection is fine but a possible incorrect MTU value defined by default in Mac OS.
The solution is to manually change the MTU in Mac OS after confirming the value from the ISP. To change the value manually:
In Mac OS X 10.5: Open Network Preferences (by selecting Apple Menu in the menubar and choosing System Preferences). Select the active connection through which you are connected to the internet, click Advanced and select Ethernet. From the Configure drop down menu, choose Manually. From the MTU drop down menu choose Custom and enter the MTU value provided by the ISP in the box below it. Click OK and click Apply.
In Mac OS X 10.4:
- Open the Terminal located in the Applications folder, inside the Utilities folder.
- At the command prompt, type the following command. In place of "<value>" enter the number for the MTU value provided by the ISP.
sudo ifconfig en1 mtu <value>
Enter password when prompted for.
The MTU changes made through the Terminal are not persistent and must be repeated each time Mac OS is restarted.
Additional details at Apple's support page for MTU