11 States of TCP Transition Explained
TCP or transmission control protocol operates at the transport layer of the OSI model. It facilitates transmission between packets from source to destination in a reliable manner as it is a connection-oriented protocol. TCP operations are divided into three phases namely –
- connection establishment,
- data transfer phase and
- connection termination.
TCP connection is managed by the operating system through a resource which represents the local end point for communications. The lifetime of a TCP connection goes through various stages.
Today we look more in detail about 11 states of TCP connection, how it works, and its diagrammatic presentation for ease of understanding.
TCP Transition
A TCP connection is full duplex and established using a three-way handshake.
A connection in TCP passes through a series of states during its timespan. These states are namely –
- LISTEN,
- SYN-SENT,
- SYN-RECEIVED,
- ESTABLISHED,
- FIN-WAIT-1,
- FIN-WAIT-2,
- CLOSE-WAIT,
- CLOSING,
- LAST-ACK,
- TIME-WAIT and
- Fictional state CLOSED.
11 States of TCP
Let’s look more in detail about each of the connection states.
LISTEN – LISTEN is state I and it represents waiting for a connection request from any remote TCP host.
SYN-SENT – SYN-SENT is state II and it represents waiting for a machine connection request after sending a connecting request.
SYN-RECEIVED – SYN-RECEIVED is state III and it represents waiting for confirmation of connection acknowledgement after both sender and receiver has sent / received connection request.
ESTABLISHED – It is state IV and represents an open connection, data received to be delivered to the user.
FIN-WAIT 1 – FIN-WAIT 1 is state V and it represents waiting for a connection termination request from remote TCP host or acknowledgment of connection termination request sent previously.
FIN-WAIT 2 – It is state VI and represents waiting for connection termination request from remote TCP host.
CLOSE-WAIT – CLOSE-WAIT is state VII and it represents waiting for a connection termination request from local user.
CLOSING – It is state VIII that represents waiting for a connection termination request acknowledgement from remote TCP host.
LAST-ACK – LAST-ACK is state IX of TCP, which represents waiting for connection termination request acknowledgement previously sent to remote TCP host including its acknowledgement of connection termination request.
TIME-WAIT – It is state X and represents waiting sufficient time to pass to ensure remote TCP host received acknowledgement of its request for connection termination.
CLOSED – CLOSED is state XI. It is a fictional state and represents no connection state
A TCP connection moves from one state to another in response to events.
Continue Reading:
TCP/IP MODEL vs OSI MODEL: Detailed Comparison
HTTP vs TCP : Detailed Comparison
Tag:Protocols