1834155 Members
2427 Online
110064 Solutions
New Discussion

KEEPALIVE enabled??

 
vijay_37
Occasional Advisor

KEEPALIVE enabled??

Hi,

I am using 3rd party software running in HP-UX 11. As I do not have access to the source code, how do I find whether the KEEPALIVE is enabled or not..?

Any answers are much appreciated....
Vijay
9 REPLIES 9
Stefan Farrelly
Honored Contributor

Re: KEEPALIVE enabled??

I dont think TCP keepalive is controlled from an application, its set on by default in the TCP stack on the operating system (HP-UX). The application may be able to alter it I guess. You can check the TCP keepalive values using ndd, eg;

ndd -h supported|grep -i keepalive
tcp_keepalive_detached_interval - Send keepalive probes for detached TCP
tcp_keepalive_interval - Interval for sending keepalive probes

see manpage for ndd, you can then see these values. I would check them on a system boot before your app is started, then start your app and check again if theyve been changed (by your app).
Im from Palmerston North, New Zealand, but somehow ended up in London...
vijay_37
Occasional Advisor

Re: KEEPALIVE enabled??


Well , I am aware that ndd command is used to change tcp parameters changes and nddconf for tcp parameters changes during reboot. But even though this value is changed, the KEEPALIVE has to be enabled first inorder to use the changes. Though in application we have setsockopt to enable Keepalive and set the interval, I do not have access to the code. So finding out how can it be enabled outside the application.

Vijay
Zigor Buruaga
Esteemed Contributor

Re: KEEPALIVE enabled??

Hi,

Not an expert, but maybe this could help.
Recently I needed to add KEEPALIVE "feature" to my monitoring application, and I tested it by pulling the network cable ( client side ).
Before the KEEPALIVE setting, when pulling the network cable my application never noticed that. By adding KEEPALIVE setting in my C program ( in HP-UX ) and VB program ( in windows ), that sort of events are now detected. So, try to pull the network cable, and wait ( the default value in HP-UX is 7.200 secs, if I remember correctly ) to see if the connection still remains active or not.
Only an idea.

Are you experiencing disconnections due to inactivity?

Hope this helps.
Kind regards,
Zigor
vijay_37
Occasional Advisor

Re: KEEPALIVE enabled??

Hi,

The client connects to server through load balancer(a virtual machine). It is multithreaded environment in client side and 3rd party software used in the server. We traced through Ethereal and found that after certain period, Load balancer disconnects from the server. But ports in server are still alive. So I thought I can introduce KEEPALIVE in Server side, but as it is 3rd party,not sure how to set the keepalive enable.

from
Vijay
Stefan Farrelly
Honored Contributor

Re: KEEPALIVE enabled??

ndd is also used to enable or disable tcp values such as keepalive. By defauly keepalive is ON when an HP server boots (without anything in nddconf). But you, or an app with root priveleges, can modify its timeout period, or disable it. So ndd is what you want.
Im from Palmerston North, New Zealand, but somehow ended up in London...
vijay_37
Occasional Advisor

Re: KEEPALIVE enabled??

Hi,

I tried to set params using ndd and then using nddconf. But Keepalive does not work...I see the ports are still alive in server.. So thats why I try to find out how it can be enabled....?

Vijay
Brian Hackley
Honored Contributor

Re: KEEPALIVE enabled??

Vijay,

Uh oh, app must do the setsocketopt() to enable SO_KEEPALIVE, as the man page indicates. This is code within the application that needs to do this. The application is also responsible for any polling of clients. You cannot do this from outside the application space e.g. with ndd.

If you want to verify the socket options, you can do so by examining socket.h programmatically.

Hope that helps,
-> Brian Hackley
Ask me about telecommuting!
vijay_37
Occasional Advisor

Re: KEEPALIVE enabled??


Thanks for your answers. what about inet subsystem, will that help in enabling KEEPALIVE outside the application??
rick jones
Honored Contributor

Re: KEEPALIVE enabled??

One way to see if keepalives are enabled by the application would be to take a system call trace of the application with tusc. If you start from the beginning, you should see the setsockopt() call(s).

The other way would be to take a packet trace while the application was idle for at least tcp_keepalive_interval time units.

I _suppose_ that with enough knowledge of the datastructures and a lot of help from q4 one could look at the socket structures, but that probably aught to happen under the close personal supervision of an HP support type.

I'd start with the tusc trace. ftp://ftp.cup.hp.com/dist/networking/tools/
there is no rest for the wicked yet the virtuous have no pillows