ethtool maybe caused by "TCP checksum offload"

作者: 2hei 发表于2010年3月 3日 15:14
版权声明: 可以转载, 转载时务必以超链形式标明文章原始出处和作者信息及版权声明
http://www.2hei.net/mt/2010/03/ethtool-maybe-caused-by-tcp-checksum.html

使用tcpdump抓包时发现有这样的错误信息:

Transmission Control Protocol, Src Port: 44937 (44937), Dst Port: https (443), Seq: 111, Ack: 147, Len: 6

Checksum: 0x5edd [incorrect, should be 0x15db (maybe caused by "TCP checksum offload"?)]
 Good Checksum: False
 Bad Checksum: True

或许是TCP checksum offload的原因

查看本机的网卡信息
2hei# ethtool -k eth0
Offload parameters for eth0:
Cannot get device rx csum settings: Operation not supported
Cannot get device udp large send offload settings: Operation not supported
rx-checksumming: off
tx-checksumming: on
scatter-gather: on
tcp segmentation offload: off
udp fragmentation offload: off
generic segmentation offload: off

其他一些帮助
ethtool -K|--offload DEVNAME    Set protocol offload
                [ rx on|off ]
                [ tx on|off ]
                [ sg on|off ]
                [ tso on|off ]
                [ ufo on|off ]
                [ gso on|off ]

关闭rx和tx
#ethtool -K rx off
#ethtool -K tx off
#ethtool -K eth0 rx off tx off tso off gso off

也可用这个命令
#ethtool -K eth0 tx off tso off

打开
#ethtool -K eth0 tx on
#ethtool -K eth0 tso on

关闭tx和rx后,再次抓包,结果显示正常。

CheckSum Offload实际上是将传输层的一部分工作交给了硬件完成,以节约系统的CPU资源。wireshark在本地抓包时看到是系统随机填充的校验和,所以会显示Checksum Offload,实际并不影响数据包的正常传输。
微软的测试表明它可以最多节约30%的CPU资源。IBM里AIX的文档则指出:对于PCI接口的千兆网卡来说还不如让400Mhz以上的CPU来计算校验和,而PCI-X的千兆网卡启用此项后可以达到线路速度,从而节约CPU资源。

详细可见: http://www.microsoft.com/whdc/device/network/taskoffload.mspx

| | Comments (0) | TrackBacks (0)

发表一个评论

关于这篇文章

这篇文章由2hei2010年3月 3日 15:14发布.

上一篇:request.getScheme cann't get https in nginx proxy with apache

下一篇:nginx代理模式下,伪造X-Forwarded-For头的测试

回到首页 或者查看归档文章

  • Powered by FeedBurner
  • Add to Google Reader or Homepage
  • Add to My AOL
  • Subscribe in NewsGator Online
  • del.icio.us/2heidel.icio.us/2hei
  • Subscribe to feed feeds