From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,30f7dbc137470c88 X-Google-Attributes: gidfee84,public From: Glen Turner Subject: Re: keep-alive on tcp/ip-socket connections Date: 1996/10/22 Message-ID: <326C1187.446B@itd.adelaide.edu.au>#1/1 X-Deja-AN: 192614304 references: <54fqd5$m4e@news.uni-c.dk> <54g21p$fum@rit.cs.rit.edu> content-type: text/plain; charset=us-ascii organization: IT Division, University of Adelaide, South Australia mime-version: 1.0 newsgroups: comp.unix.osf.osf1 x-mailer: Mozilla 3.0 (X11; I; OSF1 V3.2 alpha) David P Cutter wrote: > > In article <54fqd5$m4e@news.uni-c.dk>, Ole Joergensen wrote: > >Does anybody know how to control sending of 'keep-alives' on > >tcp-connections > >(OSF/1 - alpha platforms) ? > >... > >The question is then: How does one change this? How can you make the > >probing start as soon > >as the connection is established? > > > 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/ 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). This is because most network programmers, me included, see keep-alives as something to be discouraged in a global internet. (Try asking this question in comp.protocols.tcpip and you'll see what I mean.) If the user is using the application, there will be traffic enough to see if the link goes down. If the user isn't using the application, than what does it matter if the link goes down and is restored before the next packet? At the program level, network problems can't be predicted, so network programs need to be robust enough to cope with errors at any I/O. So there is no difference to the programmer if a network error is delivered instantaneously, or when convenient. A classic mistake of C programmers is to write: (void)fclose(output_file); as if no error could occur on closing a file, whereas that is where most I/O errors are reported, as it forces an end-to-end write of buffers. >From what I have seen in the past, TCP keep-alives are usually a substitute for a lack of design for robustness. This can be best seen in the SQL stacks of database manufacturers, where they maintain large amounts of inappropiate state information on the servers. Some applications, escpecially authentication protocols, need keep-alives to log out users of rebooted machines. However, this is a matter for the protocol, not for TCP, as these keep-alives need to be authenticated to prevent session capture. -- glen.turner@itd.adelaide.edu.au Network Support Specialist Tel: (08) 8303 3936 Information Technology Division Fax: (08) 8303 4400 University of Adelaide SA 5005 -- There are two major products that came out of Berkeley: LSD and UNIX. This is no coincidence.