Support | TCP/IP Connections


TCP/IP, the protocol of the internet, communicates via relatively long-lived connections between server and client--between a web server and a web browser, for example. This page describes the how such a connection is established, managed, and shutdown.


Figure C: The Life-Cycle of TCP/IP Connections

In the process of opening and closing, a TCP connection progresses through a series of states, as illustrated below.

An HTTP connection is a type of TCP/IP connection. It follows the TCP/IP life-cycle.

A connection opens with a pair of SYNchronization messages. It closes with a pair of FINish messages. The messages are in pairs because they go one in each direction. This is the so-called "handshake" between two TCP/IP stacks.

Note that each state name is associated with a code number, "1 closed" for example. That code is the value used by an SNMP MIB (simple network management protocol, management information base).

 
Client*   Server*
*or vice-versa, though requests typically originate at clients.
 
2 Listening
Awaiting connection request.
3 Syn-Sent
Sent connection-request.1
Awaiting acknowledgement.1
Awaiting connection-request.2
arrow
Received acknowledgement.1
Received connection-request.2
Sent acknowledgement.2

arrow
arrow
4 Syn-Received
Received connection-request.1
Sent acknowledgement.1
Sent connection-request.2
Awaiting acknowledgement.2
 
5 Established
The connection is open.
Data moves both directions.
arrow 5 Established
Received acknowledgement.2
The connection is open.
Data moves both directions.
 
6 Fin-Wait.1
Sent close-request.a
Awaiting acknowledgement.a
Awaiting close-request.b
arrow
  8 Close-Wait
Received close-request.a
Sent acknowledgement.a
When finished sending data,
will send close-request.b
7 Fin-Wait.2
Received acknowledgement.a
Still awaiting close-request.b
arrow
or  
10 Closing
Received close-request.b
Sent acknowledgement.b
Still awaiting acknowledgement.a
arrow 9 Last-Ack
Sent close-request.b
Awaiting acknowledgement.b
 
11 Time-Wait
Received acknowledgement.a
Received close-request.b
Sent acknowledgement.b
Allowing time for delivery
of acknowledgement.b
arrow
 
1 Closed
A "fictional" state;
there is no connection.
  2 Listening
Awaiting connection request.