Logo
ChatTCP

TCP Three-way Handshake and Four-way Teardown Demo

Visualize TCP three-way handshake and four-way teardown process to learn complete TCP connection establishment and termination

Client
State:
CLOSED
Server
State:
CLOSED
Network

TCP Connection States

Handshake States

  • LISTEN: Server waiting for connection
  • SYN_SENT: Client has sent SYN
  • SYN_RCVD: Server received SYN and sent SYN+ACK
  • ESTABLISHED: Connection established

Teardown States

  • FIN_WAIT_1: Client has sent FIN
  • CLOSE_WAIT: Server received FIN
  • FIN_WAIT_2: Client waiting for server FIN
  • LAST_ACK: Server waiting for last ACK
  • TIME_WAIT: Client waiting for timeout
  • CLOSED: Connection closed

Half-Open Connection States

Half-open connections refer to intermediate states during TCP connection establishment, primarily including SYN_SENT and SYN_RCVD states. Connections in these states are not fully established and can be vulnerable to network attacks.

Common Half-Open Connection Issues

SYN Flood

SYN Flood Attack: Attackers send numerous SYN packets without completing handshakes, exhausting server resources

Server Not Responding

Server Not Responding: Server doesn't reply with SYN+ACK after receiving SYN, client remains in SYN_SENT state

Client Not Responding

Client Not Responding: Server doesn't receive ACK after sending SYN+ACK, server remains in SYN_RCVD state

Network Issues

Network Issues: Network latency or packet loss interrupts handshake process, connection remains in half-open state