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

TCP

时间:2016-04-06 11:18:14      阅读:123      评论:0      收藏:0      [点我收藏+]

标签:

本文讲解了TCP协议的一些原理性东西

 一、3次握手

    连接建立时需要3次握手,3次握手需要商议请求方和服务方的编号以及其他的字段,如MSS。

    To avoid fragmentation in the IP layer, a host must specify the maximum segment size as equal to the largest IP datagram that the host can handle minus the IP header size and TCP header sizes.

   The default TCP Maximum Segment Size is 536.[6] Where a host wishes to set the maximum segment size to a value other than the default, the maximum segment size is specified as a TCP option,           initially in the TCP SYN packet during the TCP handshake. The value cannot be changed after the connection is established.

   默认MSS是536(如果没有协商),但是为了能最大化的利用网络资源,同时避免ip层的分片,最好设置MSS为IP层和MAC层能容纳的数据部分大小,当然MSS的协商不只是由发送方pac和接受方server决定,还有中间的路由器      和其他的网络等。MSS的协商受数据链路层和网络层的影响。如下图说明了MSS的协商:

                           技术分享

 

                                                        MSS的协商过程(在3次握手的时候协商,之后不能更改)

 

    MSS是可选的,而且只是在建立连接3次握手的时候协商,建立连接之后MSS就不能再次改变了。

2、拥塞控制

     初始cwnd为10MSS

     

TCP

标签:

原文地址:http://www.cnblogs.com/YDDMAX/p/5358204.html

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