wireshark抓包大于1500字节和提示checksum offload的原因

本文介绍Wireshark抓取超过1500字节数据包时出现的问题及原因,详细解释了操作系统中网卡如何通过分段和校验和减轻CPU负担,并提供了禁用网卡分段和校验和卸载功能的方法。

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

问题:

  1. wireshark抓包大于1500字节(如下图所示)
  2. wireshark抓包提示:[incorrect, should be xxxx (maybe caused by "TCP checksum offload"?)]

wireshark抓包大于1500字节和提示checksum offload的原因

原因:
wireshark是在数据包经过cpu,送到网卡处理之前抓取的。现在操作系统上的网卡大多有一个功能,帮助cpu减轻负担,网卡承担了将segment分段和对数据包进行checksum的工作。
wireshark抓取的数据包还需要网卡进行下一步的分段和checksum,所以我们看到数据包有2000多字节。

解决办法:
disable操作系统网卡的large sender offload 和 check sum offload功能。

1. windows操作。在控制面板,网络连接,网卡属性,配置,高级设置,windows 10 截图如下:

wireshark抓包大于1500字节和提示checksum offload的原因

  1. Linux操作。

           查看:ethtool --show-offload  ethX

+++++++++++++++++++++++++++++++++++++++++++++++
[root@syslog-ng ~]# ethtool --show-offload ens33
Features for ens33:
rx-checksumming: off
tx-checksumming: on
tx-checksum-ipv4: off [fixed]
tx-checksum-ip-generic: on
tx-checksum-ipv6: off [fixed]
tx-checksum-fcoe-crc: off [fixed]
tx-checksum-sctp: off [fixed]
scatter-gather: on
tx-scatter-gather: on
tx-scatter-gather-fraglist: off [fixed]
tcp-segmentation-offload: on
tx-tcp-segmentation: on
tx-tcp-ecn-segmentation: off [fixed]
tx-tcp6-segmentation: off [fixed]
tx-tcp-mangleid-segmentation: off
+++++++++++++++++++++++++++++++++++++++++++++++

     配置取消网卡分段功能:  ethtool -K ens33 tso off

+++++++++++++++++++++++++++++++++++++++++++++++
[root@syslog-ng ~]# ethtool -K ens33 tso off
[root@syslog-ng ~]# ethtool --show-offload ens33
Features for ens33:
rx-checksumming: off
tx-checksumming: on
tx-checksum-ipv4: off [fixed]
tx-checksum-ip-generic: on
tx-checksum-ipv6: off [fixed]
tx-checksum-fcoe-crc: off [fixed]
tx-checksum-sctp: off [fixed]
scatter-gather: on
tx-scatter-gather: on
tx-scatter-gather-fraglist: off [fixed]
tcp-segmentation-offload: off
tx-tcp-segmentation: off
tx-tcp-ecn-segmentation: off [fixed]
tx-tcp6-segmentation: off [fixed]
tx-tcp-mangleid-segmentation: off
+++++++++++++++++++++++++++++++++++++++++++++++

参考wireshark wiki : https://wiki.wireshark.org/CaptureSetup/Offloading

转载于:https://blog.51cto.com/jsahz/2061719

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值