TCP三次握手和四次握手

TCP三次握手建立连接

TCP三次握手

发生的事件:

  • Host A sends a TCP SYNchronize packet to Host B
  • Host B receives A’s SYN
  • Host B sends a SYNchronize-ACKnowledgement
  • Host A receives B’s SYN-ACK
  • Host A sends ACKnowledge
  • Host B receives ACK.
  • TCP socket connection is ESTABLISHED.

建立连接时, 请求方发生 [SYN]报文, 响应方的回复[ACK] 报文.

seq (sequence number): 有双方各自维护的自己的 TCP 消息序列号 ack (acknowledgement): 响应方响应收到了多少消息

  • A: [SYN] seq:x
  • B: [ACK] ack:x+1 seq:y
  • A: [SYN] ack:y+1 seq:x+1

TCP四次握手释放连接

TCP4次握手释放连接.png