Networking Forums

Networking Forums > Computer Networking > Linux Networking > Simple TIME_WAIT question

Reply
Thread Tools Display Modes

Simple TIME_WAIT question

 
 
iksrazal@terra.com.br
Guest
Posts: n/a

 
      06-28-2005, 12:35 PM
Hi all,

I've been trying to close a socket and I think it is closing now. Using
'netstat -an' I see:

tcp 0 0 127.0.0.1:1786 127.0.0.1:25
CLOSE_WAIT

Then:

tcp 0 0 127.0.0.1:25 127.0.0.1:1786
TIME_WAIT

My questions are:

1) Is it normal for a socket to transition from CLOSE_WAIT to TIME_WAIT
when the local application clears the CLOSE_WAIT condition - ie, closes
the socket?

2) What is the purpose of TIME_WAIT in Linux?

iksrazal

 
Reply With Quote
 
 
 
 
Neil W Rickert
Guest
Posts: n/a

 
      06-28-2005, 02:19 PM
(E-Mail Removed) writes:

>1) Is it normal for a socket to transition from CLOSE_WAIT to TIME_WAIT
>when the local application clears the CLOSE_WAIT condition - ie, closes
>the socket?


Yes, this commonly happens.

>2) What is the purpose of TIME_WAIT in Linux?


It's tcp/ip, not just linux.

After the connection is closed, there might still be some stray
packets that were delayed and could still arrive. The TIME_WAIT
status retains a record of a recent connection, so that the system
can recognize these as delay packets.

 
Reply With Quote
 
Rick Jones
Guest
Posts: n/a

 
      06-28-2005, 05:57 PM
Neil W Rickert <rickert+(E-Mail Removed)> wrote:
> (E-Mail Removed) writes:


>>1) Is it normal for a socket to transition from CLOSE_WAIT to TIME_WAIT
>>when the local application clears the CLOSE_WAIT condition - ie, closes
>>the socket?


> Yes, this commonly happens.


I thought the transition was CLOSE_WAIT -> LAST_ACK -> gone as
typically it is the first side to send a FIN who does the TIME_WAIT
(FIN_WAIT_1 -> FIN_WAIT_2 -> TIME_WAIT) and CLOSE_WAIT is the state
entered when a FIN is recieved and now awaiting the applcation to
close.

Now, that does not mean that one cannot go to TIME_WAIT from
CLOSE_WAIT, and I suppose there is the case of FIN's that cross in the
net, but I wouldn't expect the connections with crossing FIN's to pass
through CLOSE_WAIT.

rick jones
--
No need to believe in either side, or any side. There is no cause.
There's only yourself. The belief is in your own precision. - Jobert
these opinions are mine, all mine; HP might not want them anyway...
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
TCP: FIN_WAIT1 to TIME_WAIT Radha Linux Networking 0 08-01-2008 07:06 AM
Simple Question Marco Roberto Gonçalves Junior Wireless Networks 0 07-10-2006 07:10 PM
ipp TIME_WAIT DM Linux Networking 0 01-18-2006 07:51 PM
TIME_WAIT in NetStat Jesse Windows Networking 0 04-08-2005 12:18 PM
kernel 2.4.21 and TIME_WAIT Maurizio Lo Bosco Linux Networking 3 03-26-2005 10:57 AM



1 2 3 4 5 6 7 8 9 10 11