3 way handshake

A three way handshake is part of TCP to create an established connection between two hosts. It is based on sequence numbers and acknoledgements.

1. Host A writes SYN sequence 999 to Host B. 2. Host B writes SYN sequence 444 to host A and acks 1000. 3. Host A writes ACK sequence 1000 ack 445 to host B.

When this is done the connection is thought of as connected. At the same time the states change in this three way handshake like so.

1. Host A == SYN_SENT, Host B == LISTEN 2. Host A == SYN_RCPT, Host B == SYN_SENT 3. Host A -- ESTABLISHED, Host B == SYN_RCPT

Finally all of them are in ESTABLISHED state.

To tear this connection down properly a 4 way close is done.