简体   繁体   English

基于IP协议的校验和

[英]Checksum in an IP based protocol

Just out of curiosity I was wondering if not having a checksum field in the application layer of the protocol is a major design issue? 出于好奇,我想知道协议的应用层中是否没有校验和字段是主要的设计问题? Or since the IP has the inbuilt checksum part in it, shouldn't it be an issue at all? 或者,由于IP中包含内置的校验和部分,这根本不是问题吗? Or you think is a dumb question as there is never a checksum in application layer? 还是您认为这是一个愚蠢的问题,因为应用程序层中从来没有校验和?

Unless I am much mistaken FTP doesn't have a checksum, and neither does HTTP, and both are used to download enormous pieces of software by the million. 除非我非常误解,否则FTP没有校验和,HTTP也没有校验和,并且两者都被用来下载上百万的软件。 Draw your own conclusion. 得出自己的结论。 Neither does RMI, or IIOP, or XDR, or ... In fact I can't think of an application protocol that does, other than one I wrote in 1994. RMI或IIOP或XDR或...都没有。事实上,除了我在1994年编写的应用程序协议之外,我都无法想到具有此功能的应用程序协议。

It depends on the integrity requirements of the application. 这取决于应用程序的完整性要求。

IP's checksum won't protect the application against packets that are lost or misordered. IP的校验和不能保护应用程序免受丢失或错误排序的数据包的侵害。 Applications that seek reliability usually use TCP (which provides a checksum over the data as well as recovering from loss and misordering). 寻求可靠性的应用程序通常使用TCP(TCP提供数据校验和以及从丢失和错误排序中恢复)。

The question then becomes whether an application needs its own checksum when TCP already provides one? 那么问题就变成了当TCP已经提供校验和时,应用程序是否需要自己的校验和? That depends on whether the 16b checksum of TCP is sufficient for the integrity needs of the application. 这取决于TCP的16b校验和是否足以满足应用程序的完整性需求。 eg financial or other applications that are very sensitive to data changes might need to use a CRC or message digest to double-check the information after TCP has checked it. 例如,对数据更改非常敏感的金融或其他应用程序可能需要使用CRC或消息摘要来在TCP检查信息之后再次检查信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM