《TCP/IP详解 卷一:协议》第5章的IPv4数据报的总长度字段出现“不需要大于576字节的IPv4数据报“相关内容的解释

文章讨论了IPv4数据报的TotalLength字段,指出576字节限制源于1981年的技术条件。这个限制确保大多数主机能处理,且避免因数据过大导致的分片问题。随着技术进步,虽然MTU可变,但IPv4保持此限制是为了适应协议封装情况。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

《TCP/IP详解 卷一:协议》第5章的IPv4数据报的总长度字段的一些解释,出现以下内容(有省略):

....另外,主机不需要接收大于576字节的IPv4数据报.....以避免576字节的IPv4限制。

英文原文的内容(有省略):

Furthermore, a host is not required to be able to receive an IPv4 datagram larger than 576 bytes. ....Many applications that use the UDP protocol (see Chapter 10) for data transport (e.g., DNS, DHCP, etc.) use a limited data size of 512 bytes to avoid the 576-byte IPv4 limit. 

首先说明一下,这就是作者和译者不假思索,照搬RFC文档的结果,又没有任何解释。

RFC791文档里面说

  Total Length:  16 bits

    Total Length is the length of the datagram, measured in octets,
    including internet header and data.  This field allows the length of
    a datagram to be up to 65,535 octets.  Such long datagrams are
    impractical for most hosts and networks.  All hosts must be prepared
    to accept datagrams of up to 576 octets (whether they arrive whole
    or in fragments).  It is recommended that hosts only send datagrams
    larger than 576 octets if they have assurance that the destination
    is prepared to accept the larger datagrams.

    The number 576 is selected to allow a reasonable sized data block to
    be transmitted in addition to the required header information.  For
    example, this size allows a data block of 512 octets plus 64 header
    octets to fit in a datagram.  The maximal internet header is 60
    octets, and a typical internet header is 20 octets, allowing a
    margin for headers of higher level protocols.

然后我找了一些资料,最合理的解释就是,

在1981年9月通过RFC 791和RFC 793的发布,TCP/IP正式标准化。

在1981年,内存还是很贵的,一次最多发为576字节就够了。

——不是说现在MTU最大就是576字节啊,因为TCP/IP标准也是持续更新的,RFC文档也是不断增加的,更新的内容是在新文档的,不会在旧文档里面改的。

2023-11-23 补充,对于后续发展,保持在576之内,有一点很重要的原因是,

IP数据报可能被封装在其他协议来传输,比如IPSec(用于VPN),如果原来的数据报过大,再封装时容易导致分片。

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值