这是我对服务器图进行基准测试的设置
Trex 版本 v2.88
Trex 服务器 MAC
ens2f0: f8:f2:1e:5c:bf:78
ens2f1: f8:f2:1e:5c:bf:79
DUT 服务器 MAC
eth0: fa:16:3e:1c:be:82
eth1: fa:16:3e:d5:37:b1
trex_cfg.yaml
cat /etc/trex_cfg.yaml
Config file generated by dpdk_setup_ports.py
- version: 2
#interfaces: ['07:00.0', '07:00.1']
interfaces: ['ens2f0', 'ens2f1']
port_info:
- ip: 10.66.0.100
default_gw: 10.66.1.33
- ip: 10.68.0.100
default_gw: 10.68.3.217
platform:
master_thread_id: 0
latency_thread_id: 8
dual_if:
- socket: 0
threads: [1,2,3,4,5,6,7,16,17,18,19,20,21,22,23]
我的场景文件
- duration : 5
generator :
distribution : "seq"
clients_start : "16.0.0.1"
clients_end : "16.0.0.255"
servers_start : "48.0.0.1"
servers_end : "48.0.255.255"
clients_per_gb : 10
min_clients : 10
dual_port_mask : "1.0.0.0"
tcp_aging : 0
udp_aging : 0
cap_info :
- name: cap2/rtp_160k.pcap
cps : 10.0
ipg : 10000
rtt : 10000
w : 4
- name: cap2/rtp_250k_rtp_only_1.pcap
cps : 10.0
ipg : 10000
rtt : 10000
w : 4
- name: cap2/rtp_250k_rtp_only_2.pcap
cps : 10.0
ipg : 10000
rtt : 10000
w : 4
运行命令
./t-rex-64 --cfg /etc/trex_cfg.yaml -f /tmp/sfr.yaml -d 10 -m 1 -c 1 -k 2 --nc
在测试中,我看到 Trex 发送 UDP 流,但 RX 端没有收到任何数据,结果是 100% 丢包。当我在 DUT 设备上运行 tcpdump 时,我可以看到它使用正确的 MAC 地址将 UDP 流发送到 Trex RX 端。fa:16:3e:d5:37:b1 > f8:f2:1e:5c:bf:79
DUT 服务器 tcpdump
16.0.0.17.58005 > 48.0.0.17.1024: [no cksum] UDP, length 1231
15:38:34.237250 fa:16:3e:d5:37:b1 > f8:f2:1e:5c:bf:79, ethertype IPv4 (0x0800), length 378: (tos 0x0, ttl 125, id 11822, offset 0, flags [none], proto UDP (17), length 364)
16.0.0.18.9873 > 48.0.0.18.1026: [no cksum] UDP, length 336
15:38:34.237260 fa:16:3e:d5:37:b1 > f8:f2:1e:5c:bf:79, ethertype IPv4 (0x0800), length 1492: (tos 0x0, ttl 125, id 11852, offset 0, flags [none], proto UDP (17), length 1478)
16.0.0.15.23195 > 48.0.0.15.1026: [no cksum] UDP, length 1450
15:38:34.237266 fa:16:3e:d5:37:b1 > f8:f2:1e:5c:bf:79, ethertype IPv4 (0x0800), length 434: (tos 0x0, ttl 125, id 11832, offset 0, flags [none], proto UDP (17), length 420)
测试一开始,我就看到了正确的 ARP 条目 mac-ip,但在 2 秒内它变得不完整,即使我的测试正在运行并继续发送数据。
[root@dut-2 ~]# arp -a | grep 10.68.0.100
? (10.68.0.100) at f8:f2:1e:5c:bf:79 [ether] on eth1
[root@dut-2 ~]# arp -a | grep 10.68.0.100
? (10.68.0.100) at <incomplete> on eth1
Any idea why ARP getting incomplete in 2 second?
更新:
当我在 DUT 服务器上运行 tcpdump 然后我发现 Trex RX 端接口请求 ARP 并且 DUI 回复但是当 DUT 请求请求然后 Trex 没有回复(10.68.3.217 是 DUT 服务器的 eth1 IP)
[root@dut-1 ~]# tcpdump -i eth1 -nn arp -e -vv
tcpdump: listening on eth1, link-type EN10MB (Ethernet), capture size 262144 bytes
16:03:26.527165 f8:f2:1e:5c:bf:79 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 60: Ethernet (len 6), IPv4 (len 4), Request who-has 10.68.0.100 (01:03:05:07:09:00) tell 10.68.0.100, length 46
16:03:26.527192 f8:f2:1e:5c:bf:79 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 60: Ethernet (len 6), IPv4 (len 4), Request who-has 10.68.3.217 (01:03:05:07:09:01) tell 10.68.0.100, length 46
16:03:26.527201 fa:16:3e:d5:37:b1 > f8:f2:1e:5c:bf:79, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Reply 10.68.3.217 is-at fa:16:3e:d5:37:b1, length 28
16:03:32.107249 fa:16:3e:d5:37:b1 > f8:f2:1e:5c:bf:79, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 10.68.0.100 tell 10.68.3.217, length 28
16:03:33.131245 fa:16:3e:d5:37:b1 > f8:f2:1e:5c:bf:79, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 10.68.0.100 tell 10.68.3.217, length 28
16:03:34.155245 fa:16:3e:d5:37:b1 > f8:f2:1e:5c:bf:79, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 10.68.0.100 tell 10.68.3.217, length 28
16:03:35.183759 fa:16:3e:d5:37:b1 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 10.68.0.100 tell 10.68.3.217, length 28
16:03:36.203260 fa:16:3e:d5:37:b1 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 10.68.0.100 tell 10.68.3.217, length 28
16:03:37.227240 fa:16:3e:d5:37:b1 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length
对于实验,如果我使用以下命令在服务器模式下运行 t-rex:./t-rex-64 -i --astf
然后我可以看到它创建命名空间,我可以 ping DUT ip 地址,还可以验证 16.0.0.0/8 和 48.0.0.0/8 路由,到目前为止一切看起来都很好。
[root@Trex v2.86]# ip netns list
trex-a-1-0 (id: 1)
trex-a-0-0 (id: 0)
[root@Trex v2.86]# ip netns exec trex-a-1-0 ip a
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
43: trex-a-1-0-L@if44: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9280 qdisc noqueue state UP group default qlen 1000
link/ether f8:f2:1e:5c:bf:79 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 10.68.0.100/32 scope global trex-a-1-0-L
valid_lft forever preferred_lft forever
但是当我使用常规命令运行时,它不会创建任何网络命名空间,这正常吗?
./t-rex-64 --cfg /etc/trex_cfg.yaml -f /tmp/spatel-sfr.yaml -d 60 -m 1 -c 1 -k 2 --nc
