[rhn-users] TCP disconnection notification

suresh.thomas at wipro.com suresh.thomas at wipro.com
Wed Mar 24 15:49:35 UTC 2004


 

Disconnection Issues

 

Description:

We have a tcp based socket server, which listens to a connection
oriented tcp clients on a particular port (configurable, but defaulted
5001).  The socket server is a custom made tcp server. A number of
clients can be connected to a server and each one is dedicated with a
thread.

Problem statement:

We need to immediately (within a second) get notified when a client gets
disconnected due to network problems or any other issues and handle the
disconnected players differently.

 

Testing methods :-

a)     Disabling the network at the client side

b)     Removing network connection at client side

c)     Disabling and immediately enabling network connection (the server
has to identify disconnection and reconnection in the SEQUENCE )

 

Solutions adopted :-

The following settings have been done at the socket server 

 

a)     Setting socket options

a.      The socket option SO_KEEPALIVE  is set on the socket 

b.      Also  system level parameters in syctl files of Linux is edited
to the values


Sys control setting

Values

 

Default 

Description


net.ipv4.tcp_keepalive_time

1 sec

7200

Number of seconds to which non responding clients are assumed to be
closed 


net.ipv4.tcp_keepalive_probes

1

3

Number of  ping probes before concluding that the connection is closes 


net.ipv4.tcp_keepalive_intvl

1

3

Interval between 2 ping probes

 

Inferences:-

 

a)     It is found that the read loop fails in approximately 2 seconds
and we are able to identify disconnection around 80-90 %f the time in 5
seconds.

b)     System wide setting of tcp keep alive time is causing frequent
disconnection of the client when the client idles for more than 5-7
seconds and this is not acceptable

c)     Other network application sessions  like ftp, telnet also times
out very frequently

d)     Many of the time, the client (winsock2 implementation) is able to
get notified about disconnection pretty in advance than the server about
the same client. This causes our client gets reconnected before even
server realise about the previous disconnection and this causes problems
in the business implementation.

 

-          A disconnection by one client has to be broadcasted
immediately to many clients

 

e) we tried setting SO_LINGER option as well (oLinger.l_onoff = 1,
oLinger.l_linger = 0;)

 

 

 

 

 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suresh Thomas,
Lead, AGA - a/c,Wipro Technologies 
72, Electronics City, Bangalore 560 100, 
India.
 
Tel: +91 80 8520408 x7113
Cell :+91 98453 76935
Fax : +91 80 8528793
 <http://www.wipro.com/> www.wipro.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/rhn-users/attachments/20040324/d7a75e83/attachment.htm>


More information about the rhn-users mailing list