TCP/IP

TCP header

0001020304050607 0809101112131415 1617181920212223 2425262728293031
Source Port 16 bits Destination Port 16 bits
sequence Number 32 bits
Acknowledgment Number 23 bits
Data Offset 4 bits reserved 3 bits ECN 3 bits Control Bits 6 bits Window 16 bits
Checksum 16 bits Urgent Pointer 16 bits
Options and padding 0 to 40 bytes
Data

TCP Layers / IP

  • Application
  • Transport
  • Internet
  • Link / Network

TCP States

LISTEN
Waiting for connection request
SYN-SENT
Waiting for a matching connection request after sending a connection request
SYN-RECEIVED
Waiting for a confirming connection request acknowledgment after having both received and sent a connection request.
ESTABLISHED
represents an open connection, data received can be delivered to the user. The normal state for the data transfer phase of the connection.
FIN-WAIT-1
represents waiting for a connection termination request from the remote TCP, or an acknowledgment of the connection termination request previously sent.
FIN-WAIT-2
represents waiting for a connection termination request from the remote TCP.
CLOSE-WAIT
represents waiting for a connection termination request from the local user.
CLOSING
represents waiting for a connection termination request acknowledgment from the remote TCP.
LAST-ACK
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).
TIME-WAIT
represents waiting for enough time to pass to be sure the remote TCP received the acknowledgment of its connection termination request.
CLOSED
represents no connection state at all.
*ietf.org