TRex是思科研发的一款成熟的基于DPDK的网络测试工具。TRex是一款开源的发包工具,它跑在标准的intel处理芯片上,同时支持stateful和stateless模式,stateful可以描述L4~L7层的应用场景,而stateless主要用来进行定制包的发包。思科官方使用手册:TRex official manual。Github上思科TRex Traffic Generator代码仓库。目前主要利用TRex的DPDK高线速发包能力 Current Stateful TRex Feature sets (STF)
-
High scale of realistic traffic (number of clients, number of server, bandwidth)
-
Latency/Jitter measurements
-
Flow ordering checks
-
NAT, PAT dynamic translation learning
-
Learn TCP SYN sequence randomization - vASA/Firepower use case
-
Cluster mode for Controller tests
-
IPV6 inline replacement
-
Some cross flow support (e.g RTSP/SIP)
1. Trex安装和DPDK安装
安装依赖项。
sudo apt-get update sudo apt-get install -y gcc g++ python git zlib1g-dev pciutils vim kmod strace wget
然后,下载最新的trex release。
cd $P4_HOME mkdir trex cd trex wget --no-cache http://trex-tgn.cisco.com/trex/release/latest tar -zxvf latest cd v2.75 # 本次下载的版本是v2.75
在ubuntu下面执行dpdk安装命令。
sudo apt-get update sudo apt-get install dpdk
配置dpdk网口。
cd $P4_HOME/trex/v2.75 sudo ./dpdk_setup_ports.py -s
返回结果显示,目前主机上Intel X710网卡有两个端口eth1和eth3。网卡还在使用内核驱动,还没绑定dpdk功能。等trex发包程序运行起来,X710网卡的两个网口会加载DPDK-compatible driver,比如igb_uio。
Network devices using DPDK-compatible driver ============================================ <none> Network devices using kernel driver =================================== 0000:00:1f.6 'Ethernet Connection (3) I219-LM' if=eth2 drv=e1000e unused=igb_uio,vfio-pci,uio_pci_generic 0000:02:00.0 'I210 Gigabit Network Connection' if=eth0 drv=igb unused=igb_uio,vfio-pci,uio_pci_generic *Active* 0000:d5:00.0 'Ethernet Controller X710 for 10GbE SFP+' if=eth1 drv=i40e unused=igb_uio,vfio-pci,uio_pci_generic 0000:d5:00.1 'Ethernet Controller X710 for 10GbE SFP+' if=eth3 drv=i40e unused=igb_uio,vfio-pci,uio_pci_generic