Networking Forums

Networking Forums > Computer Networking > Linux Networking > Problem with TCP Connection Close

Reply
Thread Tools Display Modes

Problem with TCP Connection Close

 
 
Madhur
Guest
Posts: n/a

 
      05-05-2007, 12:23 PM
I am currently developing a tool using Python 2.4.2 which will be used
as a sink to pump TCP messages. Something is going wrong while closing
the connection.
This i confirmed by looking at the ethereal logs, which show proper 3
way FIN ACK Handshake. But the netstat reports TIME_WAIT state for the
TCP connection, which is hindering the messages to be pumped later. I
would like to know the probable cause for the problem.

 
Reply With Quote
 
 
 
 
Lew Pitcher
Guest
Posts: n/a

 
      05-06-2007, 01:12 AM
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Madhur wrote:
> I am currently developing a tool using Python 2.4.2 which will be used
> as a sink to pump TCP messages. Something is going wrong while closing
> the connection.
> This i confirmed by looking at the ethereal logs, which show proper 3
> way FIN ACK Handshake. But the netstat reports TIME_WAIT state for the
> TCP connection, which is hindering the messages to be pumped later. I
> would like to know the probable cause for the problem.


What problem? According to the RFCs (RFC793, aka STD7), TIME-WAIT is the
standard state that the closing end of a TCP connection should go to, once the
closing handshake is complete.

The RFC says:

TIME-WAIT - represents waiting for enough time to pass to be sure
the remote TCP received the acknowledgment of its connection
termination request.

Your connection is going into TIME-WAIT, just as it should. It will wait for a
2MSL interval, just to make sure that the final ACK has made it to the other
end, completing the close.

/If/ you have need to reuse the TCP port in another connection, you should
establish the *initial* connection with the SO_REUSEADDR socket option. In
this way, sockets will not prevent you from reusing the port while the
original user is in TIME-WAIT state.

HTH
- --
Lew Pitcher

Master Codewright & JOAT-in-training | Registered Linux User #112576
http://pitcher.digitalfreehold.ca/ | GPG public key available by request
- ---------- Slackware - Because I know what I'm doing. ------


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Armoured with GnuPG

iD8DBQFGPR2DagVFX4UWr64RAvvTAJ9ama8VDSgEYrmxFxZFNm ZjeiRuxACfe4sF
1bCh6w5VwK3FPJ6dwqg94LI=
=45DB
-----END PGP SIGNATURE-----
 
Reply With Quote
 
Kalyan Manchikanti
Guest
Posts: n/a

 
      05-07-2007, 03:23 PM
On May 5, 6:23 am, Madhur <madhurr...@gmail.com> wrote:
> I am currently developing a tool using Python 2.4.2 which will be used
> as a sink to pump TCP messages. Something is going wrong while closing
> the connection.
> This i confirmed by looking at the ethereal logs, which show proper 3
> way FIN ACK Handshake. But the netstat reports TIME_WAIT state for the
> TCP connection, which is hindering the messages to be pumped later. I
> would like to know the probable cause for the problem.


As long as the connection stays in TIME_WAIT for <= 2 MSL ( max.
segment life time)..it is considered normal behavior..

Kalyan

 
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
Close TCP connections ? wpher56 Windows Networking 3 04-24-2009 08:24 PM
Windows 2003 server doesn't close TCP connection how can I prevent warning mesage Windows Networking 0 10-03-2006 04:41 PM
The SSH Close Connectoin Problem Based on Clustering Kim Ji WOok Linux Networking 0 04-05-2005 01:39 PM
Illegal operation systemwill close down problem excists sagepeg Windows Networking 0 12-20-2003 06:15 AM
Internet Connection Sharing: "Generic Host Process... has encountered a problem and needs to close..." error when client connects Philip Herlihy Home Networking 15 09-02-2003 10:28 PM



1 2 3 4 5 6 7 8 9 10 11