Wireshark错误Headerchecksum0x0000(incorrect,sh
Wireshark抓主机自身的包时,某些情况下会发现IP包头中出现如标题所示的错误提示。
原因如下:
a lot of modern network cards use TCP/IP checksum offloading, in which case Windows doesn’t bother generating a checksum for each outbound packet and the network card adds them just before transmission.
This reduces the amount of work that the computer’s CPU has to do, but the problem is that Wireshark can only intercept packets at the OS level, and hence thinks the checksums are invalid (when in fact the problem is that they haven’t been added yet).
中文大意是操作系统将计算校验和的工作丢给网卡,网卡会在发包的时候为在IP头中添加checksum值。但是Wireshark抓包是工作在OS层,是在数据包丢给网卡之前,而这是的数据包checksum为0x0000。
当然,可以手动设定操作系统事先计算checksum。对于Windows系统,可以参见https://support.microsoft.com/kb/904946。大致的操作为:
单击 开始、 单击 运行,键入 regedit,然后单击 确定。
找到并单击以下注册表子项:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
在右窗格中确保 DisableTaskOffload 注册表项存在。如果此项不存在,请按照下列步骤以将项添加操作:
在 编辑 菜单上指向 新建,然后单击 DWORD 值。
键入 DisableTaskOffload,然后按 ENTER 键。
单击 DisableTaskOffload。
在 编辑 菜单上单击 修改。
在 数值数据 框中键入 1,然后按 ENTER 键。
退出注册表编辑器,重启。