Sei sulla pagina 1di 1

TCP/IP State Transition Diagram (RFC793)

Gordon McKinney (10 Feb 2004)

starting point CLOSED

A connection progresses through a series of states during its lifetime (listed below). CLOSED is ctional because it represents the state when there is no TCB, and therefore, no connection. Briey the meanings of the states are:

appl: passive open send: <nothing>


en op ve N c ti : a : SY pl d ap sen

timeout send: RST

LISTEN

represents waiting for a connection request from any remote TCP and port. represents waiting for a matching connection request after having sent a connection request. represents waiting for a conrming connection request acknowledgment after having both received and sent a connection request. represents an open connection, data received can be delivered to the user. The normal state for the data transfer phase of the connection. represents waiting for a connection termination request from the remote TCP, or an acknowledgment of the connection termination request previously sent. represents waiting for a connection termination request from the remote TCP. represents waiting for a connection termination request from the local user. represents waiting for a connection termination request acknowledgment from the remote TCP. represents waiting for an acknowledgment of the connection termination request previously sent to the remote TCP (which includes an acknowledgment of its connection termination request). represents waiting for enough time to pass to be sure the remote TCP received the acknowledgment of its connection termination request. represents no connection state at all.
v rec

; YN :S

d: en

, YN

K AC

LISTEN passive open

SYN-SENT

v rec

:R

ST

ap pl se : se nd nd :S d YN ata

SYN_RCVD

SYN-RECEIVED

recv: SYN send: SYN, ACK simultaneous open

SYN_SENT

se

ESTABLISHED

r nd ecv :< :A no CK th in g>


ESTABLISHED data transfer state

CK ,A N CK Y :S :A cv d re sen
recv: FIN send: ACK

active open

appl: close or timeout

appl: close send: FIN

CLOSE_WAIT

FIN-WAIT-1

e os cl l: FIN p : ap nd se
FIN_WAIT_1 recv: FIN send: ACK re cv se : FIN nd recv: ACK :A ,A send: <nothing> CK CK recv: FIN send: ACK active close simultaneous close CLOSING

appl: close send: FIN

FIN-WAIT-2

LAST_ACK passive close

recv: ACK send: <nothing>

CLOSE-WAIT

recv: ACK send: <nothing>

CLOSING

FIN_WAIT_2

TIME_WAIT 2MSL timeout

LAST-ACK

appl: recv: send:

normal transitions for client normal transitions for server state transitions taken when application issues operation state transitions taken when segment received what is sent for this transition

TIME-WAIT

TCP state transition diagram.

CLOSED

A TCP connection progresses from one state to another in response to events. The events are the user calls, OPEN, SEND, RECEIVE, CLOSE, ABORT, and STATUS; the incoming segments, particularly those containing the SYN, ACK, RST and FIN ags; and timeouts.

Reprinted from TCP/IP Illustrated, Volume 2: The Implementation by Gary R. Wright and W. Richard Stevens, Copyright 1995 by Addison-Wesley Publishing Company, Inc.

Potrebbero piacerti anche