TCP三次握手(Three-Way Handshake)

三次握手简图

TCP建立连接之前要进行三次握手。


三次握手

三次握手的最终目的就是为了establish a reliable connection between two devices

三次握手动态图

This connection is established by using what is known as the Three-way Hand Shake.

  • SYN
    the device initiating the connection will transmit a SYN segment, this synchronises the sequence numbers and specifies what the Initial Sequence Number (ISN) will be, the ISN will be incremented by one for each transmitted segment.
  • SYN-ACK
    The receiver will then reply with a SYN-ACK segment, this acknowledges the request to establish a connection from the initiating device.
  • ACK
    The third segment that completes the Three-way Handshake process is sent from the initiator is an ACK or acknowledgment message.

三次握手详图

三次握手详图

Wireshark抓包

Wireshark抓包之三次握手
  • SYN


    SYN
Sequence number (即x) = 0
  • SYN-ACK


    SYN-ACK
Sequence number (即y) = 0
Acknowledgement number = x + 1 = 1
  • ACK


    ACK
Acknowledgement number = y + 1 = 1

References:

https://nettx.co.uk/tag/three-way-handshake

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 9,807评论 0 23
  • 1、TCP状态linux查看tcp的状态命令:1)、netstat -nat 查看TCP各个状态的数量2)、lso...
    北辰青阅读 9,482评论 0 11
  • 1. 我总是嚷嚷着自己要暴富要变得很有钱,大多数人都以为只不过是一句玩笑话罢了,但我心里明白这之于我而言或许可以...
    冰河入梦_阅读 1,054评论 0 1
  • 妞子是住我家对门的一只短腿小柯基,抱回来还没有多长时间。 知道我家对门新来了一只柯基,是我爸妈告诉我的。我尚在学校...
    金玉Yan阅读 437评论 4 6
  • 最近上海彩虹室内合唱团继《感觉身体被掏空》后,又出神作《春节自救指南》,旋律磅礴大气,歌词通俗易懂,直接唱进了所有...
    草莓爸爸_阅读 641评论 4 2