Please Whitelist This Site?
I know everyone hates ads. But please understand that I am providing premium content for free that takes hundreds of hours of time to research and write. I don't want to go to a pay-only model like some sites, but when more and more people block ads, I end up working for free. And I have a family to support, just like you. :)
If you like The TCP/IP Guide, please consider the download version. It's priced very economically and you can read all of it in a convenient format without ads.
If you want to use this site for free, I'd be grateful if you could add the site to the whitelist for Adblock. To do so, just open the Adblock menu and select "Disable on tcpipguide.com". Or go to the Tools menu and select "Adblock Plus Preferences...". Then click "Add Filter..." at the bottom, and add this string: "@@||tcpipguide.com^$document". Then just click OK.
Thanks for your understanding!
Sincerely, Charles Kozierok
Author and Publisher, The TCP/IP Guide
NOTE: Using software to mass-download the site degrades the server and is prohibited.
If you want to read The TCP/IP Guide offline, please consider licensing it. Thank you.
TCP Connection Preparation: Transmission Control Blocks (TCBs) and Passive and Active Socket OPENs
(Page 2 of 2)
Active and Passive OPENs
TCP/IP is based on the client/server
model of operation, and TCP connection setup is based on the existence
of these roles as well. The client and server each prepare for the connection
by performing an OPEN operation. However, there are two different
kinds of OPEN:
- Active OPEN: A client process using
TCP takes the active role and initiates the connection by
actually sending a TCP message to start the connection (a SYN
- Passive OPEN: A server process
designed to use TCP, however, takes a more laid-back approach.
It performs a passive OPEN by contacting TCP and saying I
am here, and I am waiting for clients that may wish to talk to me to
send me a message on the following port number. The OPEN
is called passive because aside from indicating that the process
is listening, the server process does nothing.
A passive OPEN can in fact
specify that the server is waiting for an active OPEN from a
specific client, though not all TCP/IP APIs support this capability.
More commonly, a server process is willing to accept connections from
all comers. Such a passive OPEN is said to be unspecified.
Key Concept: A client process initiates a TCP connection by performing an active OPEN, sending a SYN message to a server. A server process using TCP prepares for an incoming connection request by performing a passive OPEN. Both devices create for each TCP session a data structure used to hold important data related to the connection, called a transmission control block (TCB).
Preparation For Connection
Both the client and the server create
the TCB for the connection at the time that they perform the OPEN.
The client already knows the IP addresses and port numbers for both
the client process and the server process it is trying to reach, so
it can use these to uniquely identify the connection and the TCB that
goes with it.
For the server, the concept of a
TCB at this stage of the game is a bit more complex. If the server is
in fact waiting for a particular client, it can identify the connection
using its own socket and the socket of the client for which it is waiting.
Normally, however, the server doesn't know what client is trying to
reach it. In fact, it could be contacted by more than one client nearly
at the same time.
In this case, the server creates
a TCB with an unspecified (zero) client socket number, and waits for
an active OPEN to be received. It then binds the socket
number of the client to the TCB for the passive OPEN as part
of the connection process. To allow it to handle multiple incoming connections,
the server process may in fact perform several unspecified passive OPENs
The transmission control block for
a connection is maintained throughout the connection and destroyed when
the connection is completely terminated and the device returns to the
CLOSED state. TCP does include a procedure to handle the situation
where both devices perform an active OPEN simultaneously. This
is discussed in more detail in the
next topic on the connection establishment process.
|If you find The TCP/IP Guide useful, please consider making a small Paypal donation to help the site, using one of the buttons below. You can also donate a custom amount using the far right button (not less than $1 please, or PayPal gets most/all of your money!) In lieu of a larger donation, you may wish to consider purchasing a download license of The TCP/IP Guide. Thanks for your support!|
Table Of Contents - Contact Us
The TCP/IP Guide (http://www.TCPIPGuide.com)
Version 3.0 - Version Date: September 20, 2005
© Copyright 2001-2005 Charles M. Kozierok. All Rights Reserved.
Not responsible for any loss resulting from the use of this site.