trex是cisco开源的打流仪,可以用pyscapy来编辑pcap包,然后重放数据包,就是说,可以生成任意的网络包,发向对端的网卡。
可以辅助做流量测试。
trex-core为trex的核心,主要分成两部分,一部分是trex server, 用来转发数据包在trex/src目录,一部分是python trex client, 在trex/scripts目录,client 也叫控制面,用来生成各种各样的数据。
运行的时候,会先启动trex-server, 然后client连接到server上。
安装trex server
yum install libstdc++-static zlib-devel
cd linux_dpdk
CC=clang CXX=clang++ ./b configure
./b build
cd ../scripts
启动trex server.
# For stateless:
./t-rex-64 -i --stl
# For advanced stateful:
./t-rex-64 -i --astf
client连接
# python3 connect.py
详情参考https://github.com/cisco-system-traffic-generator/trex-core/blob/master/doc/trex_cookbook.asciidoc
摘自:https://zhuanlan.zhihu.com/p/502999883