Difference between revisions of "3 way handshake"

From Hackepedia
Jump to navigationJump to search
m
 
(2 intermediate revisions by one other user not shown)
Line 6: Line 6:
  
 
When this is done the connection is thought of as connected.
 
When this is done the connection is thought of as connected.
At the same time the states change in this three way handshake
+
At the same time the [[tcp states|states]] change in this three way handshake
 
like so.
 
like so.
  
  1. Host A == SYN_SENT, Host B LISTEN
+
  1. Host A == SYN_SENT, Host B == LISTEN
 
  2. Host A == SYN_RCPT, Host B == SYN_SENT
 
  2. Host A == SYN_RCPT, Host B == SYN_SENT
 
  3. Host A -- ESTABLISHED, Host B == SYN_RCPT
 
  3. Host A -- ESTABLISHED, Host B == SYN_RCPT
Line 15: Line 15:
 
Finally all of them are in ESTABLISHED state.
 
Finally all of them are in ESTABLISHED state.
  
To tear this connection down properly a [[four way close]] is done.
+
To tear this connection down properly a [[4 way close]] is done.

Latest revision as of 06:15, 27 April 2010

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.