trex配置文件
trex_cfg.yaml
- port_limit : 2
version : 2
#List of interfaces. Change to suit your setup. Use ./dpdk_setup_ports.py -s to see available options
interfaces : [“00:09.0”,“00:0a.0”]
port_info : # Port IPs. Change to suit your needs. In case of loopback, you can leave as is.
- ip : 10.1.1.2
default_gw : 10.1.1.1
- ip : 10.1.1.1
default_gw : 10.1.1.2
启动trex 服务
./t-rex-64 -i --software --emu
启动trex-console
./trex-console
trex>plugins load emu
加载profile
trex>emu_load_profile -f emu/simple_icmp.py -t --ns 1 --clients 3
Converting file to profile [SUCCESS]
Converting profile took: 3.53 [ms]
Removing old emu profile [SUCCESS]
Sending emu profile
[SUCCESS]
Sending profile took: 20.41 [ms]
26.36 [ms]
simple_icmp.py文件如下:在trex emu目录下
ping模拟的设备
trex>portattr -a
Port Status
port | 0 | 1
----------------±---------------------±--------------------
driver | net_e1000_em | net_e1000_em
description | 82545EM Gigabit Et | 82545EM Gigabit Et
link status | UP | UP
link speed | 1 Gb/s | 1 Gb/s
port status | IDLE | IDLE
promiscuous | off | off
multicast | off | off
flow ctrl | none | none
vxlan fs | - | -
– | |
layer mode | IPv4 | IPv4
src IPv4 | 10.1.1.2 | 10.1.1.1
IPv6 | off | off
src MAC | 00:0c:29:49:2d:16 | 00:0c:29:49:2d:0c
— | |
Destination | 10.1.1.1 | 10.1.1.2
ARP Resolution | 00:0c:29:49:2d:0c | 00:0c:29:49:2d:16
---- | |
VLAN | - | -
----- | |
PCI Address | 0000:02:08.0 | 0000:02:07.0
NUMA Node | 0 | 0
RX Filter Mode | hardware match | hardware match
RX Queueing | off | off
Grat ARP | off | off
------ | |
trex>emu_show_all
Namespace #1 Information
Port | Vlan tags | Tpids | Plugins | #Clients
-----±----------±------±----------±--------
0 | - | - | arp, icmp | 3
Clients Information
MAC | IPv4 | DG-IPv4 | MTU | Plugins
------------------±--------±--------±-----±---------
00:00:00:70:00:03 | 1.1.1.3 | 1.1.1.1 | 1500 | arp, icmp
00:00:00:70:00:04 | 1.1.1.4 | 1.1.1.1 | 1500 | arp, icmp
00:00:00:70:00:05 | 1.1.1.5 | 1.1.1.1 | 1500 | arp, icmp
48.55 [ms]
trex>emu_icmp_ping -p 0 --mac 00:00:00:70:00:03
Starting to ping : [SUCCESS]
Progress: 100.00%, Sent: 5/5, Rcv: 0/5, Err: 0/5, RTT min/avg/max = 0.00/0.00/0.00 ms
Completed
参考https://www.cnblogs.com/liudf0716/p/15796785.html
收到的报文是0,RTT都是0,说明没有收到ping的回复报文,需要排查是什么原因