[Devel] tcp keepalive question

Klaus Darilion klaus.mailinglists at pernau.at
Mon Dec 18 12:38:02 CET 2006


Bogdan-Andrei Iancu wrote:
> Hi Juha,
> 
> Juha Heinanen wrote:
> 
>> i did some tcp tests using nokia N80 phone and it turned out that if
>> there was no other activity, it kept on sending 4 byte tcp messages
>> every 20 minutes, which wireshark reported as "continuation" messages.
>> they wre enough to keep linux iptables nat binding open.  i have been
>> told that it is possible to configure the keepalive interval in N80
>> using some special means.
>>  
>>
> but if  understand correctly, this is something different that TCP KEEP 
> ALIVE - actually the phone is sending a data over the TCP connection.
> 
>> > I think there was a discussion on sip-implementors discussing this 
>> topic
>> > and the conclusion was, that this is different an every OS and often 
>> not
>> > configurable (or least only per system, not per 
>> application/connection).
>> > Thus it is to unreliable.
>>
>> my understanding is tcp keepalive options are supported in linux are
>> they are configurable per tcp session.
>>  
>>
> the Klaus's concern is that the keepalive mechanism is not 
> available/accessible an all the OSs; but this be partially solved via 
> defines.
> 
>> > If the client sends keep-alive (like eyebeam) there wont be a 
>> problem. IMO
>> > a client should do this. Of course there should be also an option at 
>> the
>> > server.
>>
>> yes, it is best if tcp keepalives are sent by the UA, like it is the
>> case with N80.  however, because there may be sip UAs that do not sent
>> any keepalives, it might be a good idea if also openser would support
>> sending them.  this would be possible at least on linux, which i believe
>> is the most popular host os for openser.
>>  
>>
> right, but keepalives provided by TCP implementation and not pings at 
> data level.
> 
>> > One workaround would be to set expire to small values forcing 
>> keep-alive
>> > with REGISTER.
>> > > I wonder if the keep-alive from nathelper module can be used to 
>> send keep
>> > alive (CRLF or OPTIONS). I have not tested it yet - maybe it already
>> > works. IMO there is no reason why the UDP mechanisms should not work 
>> with
>> > TCP/TLS too.
>>
>> i consider both of these too heavy and cumbersome when the same effect
>> can be achieved automatically by tcp keepalives.
>>  
>>
> that is true.
> and to answer to Klaus's question - I made some experiments with pinging 
> from nathelper - it works but there are some heavy drawbacks because of 
> TCP nature - for example, if the client  closes the TCP connection and 
> you was to generate a new ping, we will have to open a new TCP 
> connection (that is the default behaviour of tcp_send() function) , 
> which is quite impossible and may lead in longs delays -> timer process 
> will be affected.
> 
> also I agree with Juha - if it is a simple solution, I will prefer that.

thus conclusion:
1. openser should make use of TCP keep-alive mechanism of the TCP stack 
(if available)
2. and clients should use CRLF for keep-alive on application layer

????

regards
klaus


-- 
Klaus Darilion
nic.at




More information about the Devel mailing list