Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 04-10-2005, 11:38 AM   #1
LQ Newbie
Registered: Apr 2005
Posts: 10

Rep: Reputation: 0
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?

Surya Santosh
Old 04-10-2005, 04:31 PM   #2
Registered: Aug 2001
Location: ChristChurch New Zealand
Distribution: Ubuntu
Posts: 351

Rep: Reputation: 78
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.)
Old 04-10-2005, 04:54 PM   #3
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Disconnect An Established Connection metallica1973 Linux - Security 11 08-31-2005 10:15 PM
Time out in Connection established state asurya Linux - Newbie 1 04-10-2005 04:48 PM
How to reset established connection? G-Fox Linux - Networking 4 10-02-2003 03:53 PM
Will select fail if connection couldn't be established? ruchika Linux - Software 0 09-10-2003 12:39 PM
problems with established connection nbc Linux - Newbie 1 08-16-2001 02:11 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:09 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration