免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3060 | 回复: 2
打印 上一主题 下一主题

[网络子系统] TCP的MSS协商, 什么情况下会不成功 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-09-21 23:33 |只看该作者 |倒序浏览
请问TCP的MSS协商,在什么情况下会不成功呢? TCP/IP书上说,如果TCP连接时MSS不能协商成功将用默认大小536。为什么会协商不成功呢?两端的MSS不一样时,只用小的值就可以呀。

论坛徽章:
9
辰龙
日期:2014-08-18 20:38:42未羊
日期:2014-09-04 08:50:45丑牛
日期:2014-09-06 00:12:55寅虎
日期:2014-12-22 20:50:56摩羯座
日期:2015-01-14 22:28:15巳蛇
日期:2015-01-23 20:39:272015年辞旧岁徽章
日期:2015-03-03 16:54:1515-16赛季CBA联赛之青岛
日期:2016-03-13 23:37:1915-16赛季CBA联赛之深圳
日期:2016-03-29 18:52:38
2 [报告]
发表于 2014-09-21 23:49 |只看该作者
下面是从TCP RFC层面去分析,从内核代码层面分析的情况,请自己去看代码。

1.  RFC 879, page 2, Section 3, "The MSS counts only data octets in the segment, it does not count the TCP header or the IP header."
3.  The TCP Maximum Segment Size Option

   TCP provides an option that may be used at the time a connection is
   established (only) to indicate the maximum size TCP segment that can
   be accepted on that connection.  This Maximum Segment Size (MSS)
   announcement (often mistakenly called a negotiation) is sent from the
   data receiver to the data sender and says "I can accept TCP segments
   up to size X". The size (X) may be larger or smaller than the
   default.  The MSS can be used completely independently in each
   direction of data flow.  The result may be quite different maximum
   sizes in the two directions.

   The MSS counts only data octets in the segment, it does not count the
   TCP header or the IP header.

   A footnote:  The MSS value counts only data octets, thus it does not
   count the TCP SYN and FIN control bits even though SYN and FIN do
   consume TCP sequence numbers.


既然是选项,则如果对端的协议没有去实现,就有可能协商不成功了。

2.  RFC 879, page 1, Section 1, "The default TCP Maximum Segment Size is 536."
1.  Introduction

   This memo discusses the TCP Maximum Segment Size and its relation to
   the IP Maximum Datagram Size.  TCP is specified in reference [1].  IP
   is specified in references [2,3].

   This discussion is necessary because the current specification of
   this TCP option is ambiguous.

   Much of the difficulty with understanding these sizes and their
   relationship has been due to the variable size of the IP and TCP
   headers.

   There have been some assumptions made about using other than the
   default size for datagrams with some unfortunate results.

      HOSTS MUST NOT SEND DATAGRAMS LARGER THAN 576 OCTETS UNLESS THEY
      HAVE SPECIFIC KNOWLEDGE THAT THE DESTINATION HOST IS PREPARED TO
      ACCEPT LARGER DATAGRAMS.

         This is a long established rule.

   To resolve the ambiguity in the TCP Maximum Segment Size option
   definition the following rule is established:

      THE TCP MAXIMUM SEGMENT SIZE IS THE IP MAXIMUM DATAGRAM SIZE MINUS
      FORTY.

         The default IP Maximum Datagram Size is 576.
         The default TCP Maximum Segment Size is 536.


这是536的出处。

评分

参与人数 1可用积分 +6 收起 理由
Godbach + 6 赞一个!

查看全部评分

论坛徽章:
0
3 [报告]
发表于 2014-09-23 16:56 |只看该作者
学习了,虽然做交换机的,但网络知识还是很欠缺。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP