-
计算校验和
校验和算法描述:为保证网络上传输的数据的可靠性,在许多协议中都设置了校验和项,例如:IPv4、ICMPv4、IGMPV4、ICMPv6、UDP...
计算校验和
校验和算法描述:为保证网络上传输的数据的可靠性,在许多协议中都设置了校验和项,例如:IPv4、ICMPv4、IGMPV4、ICMPv6、UDP和TCP 等等。计算这些校验和的算法称为网际校验和算法,简单来说就是:把被校验的数据16位进行累加,然后取反码,若数据字节长度为奇数,则数据尾部补一个字节的0以凑成偶数。
由于从输入文件读入的数据不能直接满足计算校验和的条件,所以首先对从文件读入缓冲区的数据进行预处理,即读入缓冲区时忽略空格。由于累加是按16位进行的,所以每次从缓冲区中读出4个字符,并将字符转换成对应的16进制数字,如此依次累加,直至数据全部读完。
还有一种情况,即如果数据长度为奇数个字节,则需要判断,并补0累加。程序中利用的是缓冲区长度计数器i和当前读取到计数器j判断数据长度是否为奇数。即如果数据长度为偶数,则读完数据时当前读取到计数器j的值应与缓冲区长度i相等,而如果数据长度为奇数,则读完数据时,当前读取到计数器j>缓冲区长度i,此时需将缓冲区中剩余的两个字符读出,并补0,转换成相应16进制数以后参与累加。
当累加结束后,将累加和的16位以上数据位移下再进行一次累加,并对最后累加和取反即得所求校验和。
-calculated checksum checksum algorithm Description : To ensure the network transmission of data reliability, in many of the agreements are set up and calibration, for example : IPv4, ICMPv4, IGMPV4, ICMPv6. UDP and TCP so on. Calculating checksum algorithm called the Internet checksum algorithm, the simple answer is : as has been the calibration data for 16 cumulative, and then take the anti-code, if the data byte length of the odd, data will make up the tai
- 2022-01-26 06:39:03下载
- 积分:1
-
FTP登陆下载程序VC
FTP登陆下载程序VC-FTP download landing VC
- 2022-02-20 09:03:27下载
- 积分:1
-
是一个获取网络DNS、子网掩码、网卡地址的综合程序,注意该程序包括了第四章的4.2节、4.3节的两个程序。(最好在win98中测试)。
是一个获取网络DNS、子网掩码、网卡地址的综合程序,注意该程序包括了第四章的4.2节、4.3节的两个程序。(最好在win98中测试)。-access to a network of DNS, subnet mask, Ethernet addresses the integrated process, including attention to the procedures of Chapter IV of 4.2, 4.3 of the two procedures. (Preferably in the win98 test).
- 2022-03-10 14:35:19下载
- 积分:1
-
ip helper api简介和源码
ip helper api简介和源码-About ip helper api and source
- 2022-08-06 21:08:07下载
- 积分:1
-
network programming code introduced some basic knowledge, is the main client pro...
这段vc代码介绍网络编程的一些基础知识,主要是客户端程序-network programming code introduced some basic knowledge, is the main client program
- 2022-02-07 10:51:56下载
- 积分:1
-
the procedures for multimedia communications server side of the source (VC versi...
本程序为多媒体通信的server端的源码(
VC++ 6.0 以上版本)-the procedures for multimedia communications server side of the source (VC version 6.0 and above)
- 2022-02-03 04:44:47下载
- 积分:1
-
is peer
是实现点对点的文件传输功能的程序,可以当作模块用-is peer-to-peer file transfer function of the procedure can be used as a module
- 2022-03-18 17:00:27下载
- 积分:1
-
Ping 是Windows系列自带的一个可执行命令。利用它可以检查网络是否能够连通,用好它可以很好地帮助我们分析判定网络故障。应用格式:Ping IP地址。该命...
Ping 是Windows系列自带的一个可执行命令。利用它可以检查网络是否能够连通,用好它可以很好地帮助我们分析判定网络故障。应用格式:Ping IP地址。该命令还可以加许多参数使用,具体是键入Ping按回车即可看到详细说明。 -ping program
- 2022-12-22 16:05:03下载
- 积分:1
-
WebBroker technology of the source
基于Delphi的WebBroker技术的源码-WebBroker technology of the source
- 2023-04-03 11:25:04下载
- 积分:1
-
use XML to sequence objects to network users messaging
运用XML来序列化对象,来进行网络用户之间的消息传递-use XML to sequence objects to network users messaging
- 2022-07-16 11:16:04下载
- 积分:1