Time out in Connection established state if no Data flows on that connection
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?
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.)
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 09:18 AM.|