Monitoring idle time of TCP connections

Monitoring idle time of TCP connections

Post by C3 » Thu, 29 Jun 2006 09:32:05

I am trying to find a way to monitor all the TCP connections on my box, to
determine the maximum idle time for all connections. The idle time assumes
that data will be sent on the connection after it has been idle. If the
connection is killed after the idle time, I want to count the idle time

Does anyone know of a tool, or tool chain I could use to implement this kind
of monitoring? The initial environment will be Debian 3.0, however, I would
like to do this on a Solaris 9 system, too.


Monitoring idle time of TCP connections

Post by Michael He » Fri, 30 Jun 2006 03:38:35

In comp.os.linux.networking C3 <@>:

Unsure what you are really after but 'man netstat' sounds like a
good start.

Good luck

Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
mail: echo XXXX@XXXXX.COM | perl -pe 'y/a-z/n-za-m/'
#bofh excuse 347: The *** band broke


Monitoring idle time of TCP connections

Post by Rick Jone » Fri, 30 Jun 2006 06:39:24

Well, tcpdump/snoop and a lot of post-processing might work.

If you can "force" all connections to have TCP keepalives enabled, you
could set the TCP keepalive timer to something short enough to give
you the accuracy you want and then count keepalives on a
per-connection basis. That too would probably involve tcpdump/snoop.

I've no idea if tcptrace currently knows to look at idle time on a
connection, but for the post-processing that might be the place to
start - with tcptrace mods.

Of course this all begs the question - why are you curious to know the
maximum idle time on the connections?

rick jones
a wide gulf separates "what if" from "if only"
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to rick.jones2 in but NOT BOTH...

Monitoring idle time of TCP connections

Post by C3 » Fri, 30 Jun 2006 13:08:33

I would like to set an OS-wide TCP connection timeout, or rather reduce it
from its current value. In order to do this, I need to make sure that I
don't impact future connections on the system.