Operating System - HP-UX
1758014 Members
2167 Online
108866 Solutions
New Discussion юеВ

Re: TCP Keepalive support

 
Arun Thelakkattu
New Member

TCP Keepalive support

I have to implement TCP keepalive on a unix listener process. I would consequently like to set up the timeout probe interval, keepalive interval at the SOCKET_TCP level like TCP_KEEPIDLE, TCP_KEEPCNT, TCP_KEEPINTVL etc.

But my system is HPUX 11 version 1. But these parameters seem to be available only from version 3 onwards.

Also I do not want to change kernel parameters like tcp_keepalive_detached_interval, tcp_keepalive_interval etc as the effect would be system wide.

Are there any workarounds or patches available to implement this??

Any help would be greatly appreciated.

Rgds
Arun
2 REPLIES 2
bixley
Advisor

Re: TCP Keepalive support

Arun,
11.11 yes, I believe so.
I set other parameters, for security reasons by adding entries into the nddconf file in /etc/rc.config.d.

Follows in an excerpt from a script I created;

#!/bin/ksh
cd /etc/rc.config.d
cat < nddconf
# Increase size of half-open connection queue
TRANSPORT_NAME[0]=tcp
NDD_NAME[0]=tcp_syn_rcvd_max
NDD_VALUE[0]=4096
# Reduce the half-open timeout
TRANSPORT_NAME[1]=tcp
NDD_NAME[1]=tcp_ip_abort_cinterval
NDD_VALUE[1]=60000
# Reduce timeouts on ARP cache
TRANSPORT_NAME[2]=arp
NDD_NAME[2]=arp_cleanup_interval
NDD_VALUE[2]=60000
# Don't send ICMP redirects
TRANSPORT_NAME[3]=ip
NDD_NAME[3]=ip_send_redirects
NDD_VALUE[3]=0

you can query with
# ndd -get /dev/arp arp_cleanup_interval
Where transport names goes after the /dev and the parameter name is last.

nddconf needs a reboot to take affect, or set with -set command and the value last.


rick jones
Honored Contributor

Re: TCP Keepalive support

I'm a triffle surprised but only a triffle that 11iV3 has made those per-socket.

Frankly, the "best" thing to do is to implement an _application-level_ keepalive mechanism and use that. I have heard reports but cannot provide the cites, about firewalls and the like which "recognize" TCP keepalives and will _still_ timeout a connection. An application-level keepalive would not look like a TCP keepalive.
there is no rest for the wicked yet the virtuous have no pillows