Keepalive using tcp/ip

Keepalive using tcp/ip

Post by Jon Machtyng » Sun, 21 Nov 1993 02:19:24



How do you set the keepalive value on solaris 2.x?  I can't seem to work
our how to build a kernel (if you can).  The keepalive value seems to be
shown in /usr/include/netinet/tcp_timer.h and is set to (120*60*PR_SLOWHZ)
where PR_SLOWHZ is 2 (ie twice a second).

If you can't build a kernel, and /etc/system is just used on boot, will
modifying this value change the keepalive (as other things in this
area) or will an 'update' program need to be run to make this known.
I would have thought there would be some utility to do this.  Answerbook is
not too helpful in this area.

Thanks in advance

Jon

--
--

Ingres Technology Centre. Wharfedale Rd,
Winnersh, Wokingham. Berks UK.   (0734)-496481

 
 
 

Keepalive using tcp/ip

Post by W. Richard Steve » Sun, 21 Nov 1993 02:54:13


Quote:> How do you set the keepalive value on solaris 2.x?  I can't seem to work
> our how to build a kernel (if you can).  The keepalive value seems to be
> shown in /usr/include/netinet/tcp_timer.h and is set to (120*60*PR_SLOWHZ)
> where PR_SLOWHZ is 2 (ie twice a second).

TCP/IP configurable parameters are set/examined using ndd(1).  What you
want is

        ndd /dev/tcp tcp_keepalive_interval

and the value printed is 7200000 (2 hours in ms).  Change that to
whatever you'd like, *but* it's a system-wide parameter and will
affect all TCP connections that set the keepalive option.



 
 
 

Keepalive using tcp/ip

Post by Dave Peters » Sun, 21 Nov 1993 03:42:21



>How do you set the keepalive value on solaris 2.x?  I can't seem to work
>our how to build a kernel (if you can).  The keepalive value seems to be
>shown in /usr/include/netinet/tcp_timer.h and is set to (120*60*PR_SLOWHZ)
>where PR_SLOWHZ is 2 (ie twice a second).

>If you can't build a kernel, and /etc/system is just used on boot, will
>modifying this value change the keepalive (as other things in this
>area) or will an 'update' program need to be run to make this known.
>I would have thought there would be some utility to do this.  Answerbook is
>not too helpful in this area.

>Thanks in advance

>Jon

>--
>--

>Ingres Technology Centre. Wharfedale Rd,
>Winnersh, Wokingham. Berks UK.   (0734)-496481

Try:

ndd -set /dev/tcp tcp_keepalive_interval <value>

---
===================================================================
Dave Peterson           phone : 612-493-1008
Senior Engineer

===================================================================

 
 
 

1. Tcp/ip Keepalive Timer

I have been attempting to set the tcp/ip Keepalive Timer on a tcp/ip socket
via the TLI API using code from SUNSOLVE FAQ(PSD) Document. (INFODOC ID: 12907,
TLI Programming PSD/FAQ. The code executes successfully however the timings
seem a little astray. The scenario is this:

1) The tcp_keepalive_interval is set down to 5 minutes with ndd. eg:

      $ /usr/sbin/ndd /dev/tcp tcp_keepalive_interval
      300000

2) Open the socket and send and receive some message and wait for all
   message to be acknowledged.

3) Disconnect the client from the network and reboot the client. (Its a windows
   NT machine so it used to being rebooted!)

4) Reconnect the client.

When I monitored the network between the client and server with tcpdump
I got:

08:45:34.297886 192.55.197.27.1830 > 192.55.197.1.6671: . ack 156 win 8605 (DF)
08:45:34.298034 192.55.197.1.6671 > 192.55.197.27.1830: P 156:800(644) ack 408
                                                           win 8760 (DF)
08:45:34.497959 192.55.197.27.1830 > 192.55.197.1.6671: . ack 800 win 7961 (DF)

  (Lask ack so disconnect client here)

08:54:51.005457 192.55.197.1.6671 > 192.55.197.27.1830: P 799:800(1) ack 408
                                                          win 8760 (DF)
08:54:51.006558 192.55.197.27.1830 > 192.55.197.1.6671: R 35133587:35133587(0)
                                                           win 0

The server (192.55.197.1) did not send out the keepalive probe until
9 minutes and 17 seconds after the last activity on the socket. This
is a lot longer than the configured 5 minutes.

   Does anyone have an explanation for the difference?
   Is it just a Solaris Feature(Bug)?
   Is there some other timer that also needs to be considered?

The operating server operating system is Solaris 5.5.1 Generic.
Any information would be appreciated.

Regards,
Peter
--
___________________________________________________________________________

                    Phone: +61 7 364-9999     Fax: +61 7 394-2844
Mincom Pty Ltd      P.O. Box 72, Stones Corner, Queensland, Australia  4120

2. QUESTION: Encryption with write

3. TCP/IP Keepalive

4. Posix compliance level of Solaris 2.5

5. TCP/IP keepalive packets ?!

6. More Questions

7. TCP/IP KeepAlive parameter

8. Snoop for Solaris x86

9. Use of KEEPALIVE on TCP/IP socket

10. Trouble using setsockopt() to set TCP keepalive params under Linux

11. !!DDE->TCP/IP, REAL TIME DATA PUMP, Trans.DDE App.DATA via TCP/IP