You can control the value of ServerAliveInterval in your ~/.ssh/config file. Depending on the version of ssh, the default value of this is either 0 (no keep alive at all) or 3 (which means to send a null packet every 3 seconds to keep the connection alive).
In my case, the default value of this was set to 60 (60 seconds), but I had this overriden (for some unknown reason) to 300 (5 minutes) in the settings for my dreamhost accounts. Evidently, somewhere along the route from my machine to the dreamhost host someone was timing the connection out earlier than 5 minutes.
Does that answer your question? – Eric