The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Special Forums > IP Networking
.
google unix.com



IP Networking Learn TCP/IP, Internet Protocol, Routing, Routers, Network protocols in this UNIX and Linux forum.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Telnet timout question Acleoma UNIX for Dummies Questions & Answers 4 02-23-2005 08:03 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-02-2001
peter.herlihy peter.herlihy is offline
Registered User
  
 

Join Date: Nov 2001
Location: New Zealand
Posts: 333
tcp timout

I am led to understand that there when a port is bound for a tcp connection...once that connection is closed there is a timeout period before that port can be reused ... and the software I am using shows that. How long is this timeout - what affects it and is there anyway to reuce the timeout?
  #2 (permalink)  
Old 12-03-2001
PxT's Avatar
PxT PxT is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2000
Location: Sacramento, CA
Posts: 909
The timeout depends on your kernel. There is an RFC standard which specifies the maximum TIME_WAIT as (I believe) 4 minutes. Note that is a maximum, most times it will be much less than that. The most I have seen under Linux is 2 minutes. YMMV depending on the vendor.
  #3 (permalink)  
Old 12-03-2001
peter.herlihy peter.herlihy is offline
Registered User
  
 

Join Date: Nov 2001
Location: New Zealand
Posts: 333
Okay cool - so no hard and fast rule....especially as I'm working across a number of platforms. I have since noticed that closing the connection has a much shorter time out thank a kill. So I'm happy enough with the delay now. Thanks
  #4 (permalink)  
Old 12-10-2001
PxT's Avatar
PxT PxT is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2000
Location: Sacramento, CA
Posts: 909
Yes, if you close the connection cleanly you should have no (noticeable) TIME_WAIT delay. If you 'kill' the process without a clean shutdown, or if it crashes you will generally get the delay.
  #5 (permalink)  
Old 12-14-2001
developer developer is offline
Registered User
  
 

Join Date: Dec 2001
Location: UK
Posts: 23
The TIME_WAIT state follows the termination of a TCP connection and it lasts for double the time MSL (Maximum Segment Lifetime).
The MSL is the time required for a segment to travel from the source to the destnation. The TIME_WAIT state varies from two to four minutes, usually. If you want to reduce this time period you have to set the SO_LINGER socket option and set the l_linger member of the struct linger to zero. This will cause TCP to send a RST message instead of the normal termination messages, when the close system call is executed.
Allthough that will abort the TIME_WAIT state it is not a good idea to do so, because there is the possibility to receive a segment from the previous connection.

Last edited by developer; 12-14-2001 at 09:27 PM..
  #6 (permalink)  
Old 12-29-2001
WayneYang WayneYang is offline
Registered User
  
 

Join Date: Dec 2001
Posts: 6
Wonderful! developer.

Just as the descripition achieved by Mr. W.Richard Stevens in his famous "UNIX Network programming Volume 1", the TIME_WAIT state is friendly to all of us. So obviously avoiding this port state is not a wise choice!
Closed Thread

Bookmarks

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:40 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0