码迷,mamicode.com
首页 > 其他好文 > 详细

TCP Three-Way handshake

时间:2015-07-02 17:28:50      阅读:120      评论:0      收藏:0      [点我收藏+]

标签:tcp   三次握手   

initialize TCP variables:

sequence numbers

buffers,flow control info


Client: connection initiator

Socket clientSocket = new Socket("hostname","portnumber");


Server: contacted by client

Socket connectionSocket  = welcomeScoket.accept();


Three-Way handshake:

step1: Client sends TCP SYN segment to server 

specifies initial seqnum = x

no data

step2: server receives SYN replies with SYN/ACK segment

server allocates buffers

specifies server initial seq =y

acknowledgement = x+1

step3: client receives SYN/ACK replies with ACK segment .which my contain data

acknowledgement = y+1


版权声明:本文为博主原创文章,未经博主允许不得转载。

TCP Three-Way handshake

标签:tcp   三次握手   

原文地址:http://blog.csdn.net/susser43/article/details/46728419

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!