Consultor Eletrônico



Kbase P73431: How does a TCP session works
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   23/03/2004
Status: Unverified

GOAL:

How does a TCP session works

GOAL:

A typical TCP Session

FIX:

Assume a client needs to connect with a server.
First, the client must contact the server and request a connection.
After the connection is established, various control parameters for the connection are negotiated. After data transmission begins, a sliding window flow-control scheme is used to manage data transfer.

A connection is established via a three-way handshake, as described next. This handshake helps define the start of a new TCP connection, and prevents a host from being confused by duplicate packets generated by a previous connection that arrives late.

Host A (the sender) sends a TCP segment to host B with the SYN flag set to 1 and the ACK flag set to 0.

Host B returns a segment to host A in which both the SYN and ACK flags are set to 1.

Host A can now acknowledge to host B that it received its ACK. It sends a segment in which ACK=1 and SYN=0.

Included these steps is a negotiation of an initial sequence number for the client and for the server (each uses its own sequence number scheme). Host A sends its starting number to host B and host B acknowledges that number by incrementing it and returning the number to host A. The same process is used to negotiate host B's starting sequence number.

After data is transmitted, the session is terminated. Host A sends a FIN=1 to host B. Host B then responds with ACK=1 and FIN=1 and host A responds to that with ACK=1.

TCP uses a keep-alive feature to keep connections open and manage connections. Keep-alive verifies that the computer at the other end of a connection is still available.

A single host can set up multiple connections over the TCP/IP network at any time. This is called multiplexing. If multiple applications or network processes are running, each may set up a connection to a different computer. For example, you can simultaneously open multiple Web browsers and connect with multiple sites.

TCP uses flow controls, sliding windows, and various other mechanisms to manage sessions. These are discussed further under the following headings:

"Connection Establishment"

"Flow-Control Mechanisms"

"Congestion Control Mechanism"
The topic congestion control discusses techniques that TCP uses to control congestion. Specifically, TCP relies on dropped packets as a signal that the receiver or network is overloaded! Much work has gone into improving this technique.

A number of IETF Working Groups are developing extensions to TCP or working on updates. Refer to the IETF Web site (listed on the related entries page) and see the Transport Area section.