Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: mogul@actitis.pa.dec.com (Jeffrey Mogul)
Subject: Re: keep-alive on tcp/ip-socket connections
Date: 1996/10/23	[thread overview]
Message-ID: <54jq2b$cgt@usenet.pa.dec.com> (raw)
In-Reply-To: 54g21p$fum@rit.cs.rit.edu


In article <54g21p$fum@rit.cs.rit.edu>, dpc6787@illinois.cs.rit.edu (David P Cutter) writes:
|> In article <54fqd5$m4e@news.uni-c.dk>, Ole Joergensen <oj@dk-online.dk> wrote:
|> >Does anybody know how to control sending of 'keep-alives' on 
|> >tcp-connections (OSF/1 - alpha platforms) ?
|> >
|> >The problem arises when programming tcp at the socket-level (in C). 
|> >
|> [...stuff deleted...]
|> >
|> Yes!  I've been complaining about this one for a while.  We have to solve
|> the same type of problems as described above.
|> 
|> Most TCP/IP vendors do not allow a programmer to specify a timer value
|> for keep-alives.  And on top of that, there is no way to specify a
|> different timer per/socket - it's global value based per net interface.
|> For that reason most vendors implement these values in the kernel.  On
|> Solaris we can use the ndd utility to change these values, on DUnix
|> edit /sys/conf/<SYSNODE> and add/change the tcp_keepidle, tcp_keepintvl
|> values [...opps, I never did try this on DUnix...].  If the kernel
|> config doesn't work, you may have to "adb" the kernel and change the
|> values by hand (yuk).

Actually, in Digital UNIX V4.0, you can indeed set the TCP keepalive
parameters per-socket.  See "man 7 tcp", wherein it is written:

  TCP_KEEPIDLE
      When the SO_KEEPALIVE option is enabled, TCP probes a connection that
      has been idle for some amount of time.  The default value for this idle
      period is 2 hours.  The TCP_KEEPIDLE option can be used to affect this
      value for a given socket, and specifies the number of seconds of idle
      time between keepalive probes.  This option takes an int value, with a
      range of 1 to N (where N is tcp_keepidle divided by PR_SLOWHZ).  For
      more information on tcp_keepidle see the information on the inet sub-
      system configuration attributes in the System Tuning and Performance
      Management guide.  PR_SLOWHZ is defined in the <sys/protosw.h> header
      file.

Similarly for TCP_KEEPINTVL and TCP_KEEPCNT, and a few other knobs
to twiddle.

-Jeff



      parent reply	other threads:[~1996-10-23  4:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-10-21  4:00 keep-alive on tcp/ip-socket connections Ole Joergensen
1996-10-21  4:00 ` David P Cutter
1996-10-22  4:00   ` Glen Turner
1996-10-23  4:00   ` Jeffrey Mogul [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox