网卡LRO测试

TSO、UFO、GSO、LRO、GRO和RSS介绍
https://blog.csdn.net/yeasy/article/details/19204639

LRO测试:
1、关闭本端网卡的gro功能,开启lro功能;

ethtool -K ethx lro on
ethtool -K eth1 gro off

2、使用TCP从对端发送文件到测试端,文件大小要求大于MSS值(例如文件大小为9000字节左右),在测试端进行抓包。
测试端:

nc -l 9999 >lro.txt    # 9999 为端口号
tcpdump -i ethX

对端发包:

nc 192.1.1.11 9999 < lro.txt      #192.1.1.11 为测试网口IP , lro.txt 为待发送的文件

通过tcpdump抓到的包来看,有长度大于MSS值的报文。

tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on p1p1, link-type EN10MB (Ethernet), capture size 262144 bytes
10:57:06.587546 IP 192.1.1.10.40834 > localhost.localdomain.distinct: Flags [S], seq 4085210956, win 29200, options [mss 1460,sackOK,TS val 13419579 ecr 0,nop,wscale 7], length 0
10:57:06.587648 IP localhost.localdomain.distinct > 192.1.1.10.40834: Flags [S.], seq 482742982, ack 4085210957, win 28960, options [mss 1460,sackOK,TS val 51916238 ecr 13419579,nop,wscale 7], length 0
10:57:06.590481 IP 192.1.1.10.40834 > localhost.localdomain.distinct: Flags [.], ack 1, win 229, options [nop,nop,TS val 13419580 ecr 51916238], length 0
10:57:06.590567 IP 192.1.1.10.40834 > localhost.localdomain.distinct: Flags [P.], seq 1:8193, ack 1, win 229, options [nop,nop,TS val 13419580 ecr 51916238], length 8192
10:57:06.590595 IP localhost.localdomain.distinct > 192.1.1.10.40834: Flags [.], ack 8193, win 355, options [nop,nop,TS val 51916241 ecr 13419580], length 0
10:57:06.590612 IP 192.1.1.10.40834 > localhost.localdomain.distinct: Flags [FP.], seq 8193:9342, ack 1, win 229, options [nop,nop,TS val 13419580 ecr 51916238], length 1149
10:57:06.590781 IP localhost.localdomain.distinct > 192.1.1.10.40834: Flags [F.], seq 1, ack 9343, win 376, options [nop,nop,TS val 51916241 ecr 13419580], length 0
10:57:06.593488 IP 192.1.1.10.40834 > localhost.localdomain.distinct: Flags [.], ack 2, win 229, options [nop,nop,TS val 13419580 ecr 51916241], length 0

tcpdump是一个用来抓取linux网络数据包的工具,它和网卡之间的工作顺序是:
进来的顺序 Wire -> NIC -> tcpdump -> netfilter/iptables
出去的顺序 iptables -> tcpdump -> NIC -> Wire
可见,CPU无需对接收的报文进行聚合操作,网卡接管了这部分工作。
如果关闭lro功能,则该部分的工作由操作系统进行。tcpdump抓到的报文理应小于1514Byte。

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值