LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Time out in Connection established state if no Data flows on that connection (http://www.linuxquestions.org/questions/linux-networking-3/time-out-in-connection-established-state-if-no-data-flows-on-that-connection-311699/)

asurya 04-10-2005 11:38 AM

Time out in Connection established state if no Data flows on that connection
 
Hi All,

I have a doubt regarding the TCP state machine handling.
When the connection is in ESTABLISHED state ( After Three way Hand-Shake) and no data is flowing on that connection, for how much time, will that connection be in that state.
Will it remain in that state forever ? If no, to which state it will be moved?

Is this time out documented somewhere in Linux source code.(Is there any way to know the timeout)
Is the time out different for each application like FTP,Telnet etc or same for all TCP Connections?

Regards
Surya Santosh

cyent 04-10-2005 04:31 PM

By no data, do you mean, no data being pushed into an end of the TCP data pipe, or do you mean, someone cut a wire somewhere.

I suspect it also depends on the SO_KEEPALIVE socket option.
ie. If the SO_KEEPALIVE option is not set, it should stay up indefinitely even if the wire is cut. If the keep alive option is set, and if the wire is not cut, then it should stay up indefinitely so long as the keep alive packets keep coming. (And that is at a TCP level, not application level.)

http://www.unixguide.net/network/socketfaq/4.7.shtml

Mara 04-10-2005 04:54 PM

There's no timeout in TCP specification, if I remember correctly. Most implementations have a timer, however. It's about 2 hours. It's set somewhere in the kernel (network stack), because apps can change behaviour (SO_KEEPALIVE option), but don't have to.


All times are GMT -5. The time now is 08:37 PM.