Some time ago, I experienced some connectivity issues from my host machines. SSH connections got dropped as well as other connections like irc.
Since the disconnections occurred very randomly, it was not easy to determine what the problem was.
Thanks to @svg, I used used a tool called MTR. MTR is a great network diagnostic tool that combines the functionality of traceroute and ping. Mtr investigates the connection between the host and the target by sending packets with low TTL’s. The best part is, it keeps track of possible packet loss.
That seemed to be the problem in my case. One of the links at the datacenter seemed to have a pretty high loss rate. So opening a ticket and the problem got solved quickly.
Installation on Linux
Installing mtr on Debian machines is straightforward using aptitude:
# apt-get install mtr
Installation on OS X
For installing additional software on OS X, I always use brew:
$ brew install mtr --no-gtk
Using the –no-gtk installs mtr without the GUI, since I prefer using it from terminal.
Keep in mind that when using mtr in OS X, you’ll need to run it as root!