tcpreplay使用netmap模式

netmap

  1. 下载netmap代码
git clone https://github.com/luigirizzo/netmap
  1. 编译netmap
./configure --drivers=i40e
make
  1. 安装netmap模块
# rmmod i40e
# insmod ./netmap.ko
# insmod ./i40e/i40e.ko

./configure --drivers=ixgbe
# rmmod ixgbe
# insmod ./netmap.ko
# insmod ./ixgbe/ixgbe.ko

. tcpreplay

  1. 下载代码
git clone https://github.com/appneta/tcpreplay

2.) 编译安装

./configure --with-netmap=/home/zhangm/test/netmap/
make && make install

3. 使用

使用tcpreplay时增加--netmap参数, 则使用netmap模式

如:

tcpreplay -i ens1f0 -tK --loop 50000 --netmap /home/zhangm/pcap/bigFlows.pcap

-K, --preload-pcap Preloads packets into RAM before sending //提升效率

参考:

http://blog.csdn.net/fengfengdiandia/article/details/52594758

http://blog.csdn.net/wwh578867817/article/details/49559453

https://blog.cloudflare.com/kernel-bypass/

附:

如何获取网卡驱动名称, 如ens1f0接口?
[root@localhost build]# ethtool -i ens1f0
driver: i40e
version: 2.3.6
firmware-version: 5.05 0x8000288a 0.0.0
expansion-rom-version: 
bus-info: 0000:02:00.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: yes
[root@localhost build]# lspci  | grep Eth
01:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
01:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
02:00.0 Ethernet controller: Intel Corporation Ethernet Controller X710 for 10GbE SFP+ (rev 02)
02:00.1 Ethernet controller: Intel Corporation Ethernet Controller X710 for 10GbE SFP+ (rev 02)
02:00.2 Ethernet controller: Intel Corporation Ethernet Controller X710 for 10GbE SFP+ (rev 02)
02:00.3 Ethernet controller: Intel Corporation Ethernet Controller X710 for 10GbE SFP+ (rev 02)
[root@localhost build]# lspci  -s 02:00.0 -vvv | grep driver
    Kernel driver in use: i40e

你可能感兴趣的:(tcpreplay使用netmap模式)