public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Bhavesh P. Davda" <bhavesh@avaya.com>
To: linux-kernel@vger.kernel.org
Subject: TCPv4 State Transition questions
Date: Mon, 17 Sep 2001 17:20:14 -0600	[thread overview]
Message-ID: <3BA6852E.ED734E9E@avaya.com> (raw)

Here's what's going on...

client & server on two separate hosts, running 2.2.17 kernel.

1. client <-> server connection in ESTABLISHED state
2. kill -TERM server; respawn server
3. client does select(), gets read event, reads 0 bytes
4. client closes socket
5. client creates new socket, tries non-blocking connect()
6. client gets EINPROGRESS, puts socket on write set, does select
7. select says write event
8. client does getsockopt(SOL_SOCKET, SO_ERROR), gets 0
9. client puts socket on read set, does select
10.client gets read event, reads 0 bytes
11.client repeats sequence of steps from step 4.

Running tcpdump on the server end, this is what I see:
a. server -> client: FIN,ACK
b. client -> server: ACK (of FIN)
c. client -> server: FIN, ACK (of FIN again)
d. server -> client: ACK (of client FIN)
e. client -> server: SYN (new src port)
f. server -> client: RST, ACK
e. & f. repeat forever...


Questions:
1. Why did I get a writable event on select, and the getsockopt telling
me that connect() succeeded, when the SYN, SYN-ACK, ACK handshake has
not completed?

2. Why right after that did I get a readable event on the "connected"
socket, telling me that there was EOF to read?

3. Why is the server sending RSTs back to the client, when the client is
trying to connect to the server from different TCP ports every time? The
new server's socket is in LISTEN state, yet I see this happening.

- Bhavesh
-- 
Bhavesh P. Davda
Avaya Inc
Room B3-B16                     E-mail : bhavesh@avaya.com
1300 West 120th Avenue          Phone  : (303) 538-4438
Westminster, CO 80234           Fax    : (303) 538-3155

                 reply	other threads:[~2001-09-17 23:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3BA6852E.ED734E9E@avaya.com \
    --to=bhavesh@avaya.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox