trex-core
trex-core copied to clipboard
stl: pass client object to loaded python profiles
Pass an extra "client" argument to the get_streams() method of python traffic profiles. This allows profiles to dynamically resolve destination mac addresses using the ARP and IPv6ND services.
Add an example l3.py profile that supports both IPv4 and IPv6 left/right addresses and gateways.
Example IPv4:
$ ./ndr --stl --ports 0 1 --force-map --bi-dir --opt-bin-search \
--profile stl/l3.py --prof-tun \
left-ip=172.16.0.1,left-gw=172.16.0.254,right-ip=172.16.1.1,right-gw=172.16.1.254
ARP: ---> who has '172.16.0.254' ? tell '172.16.0.1'
ARP: <--- '172.16.0.254 is at '30:3e:a7:0b:ea:78'
ARP: ---> who has '172.16.1.254' ? tell '172.16.1.1'
ARP: <--- '172.16.1.254 is at '30:3e:a7:0b:ea:79'
Bench Run has finished :-)
{'BW per core [Gbit/sec @100% per core]': '32.16Gbit/Sec @100% per core',
'CPU Utilization [%]': '2.79',
'Drop Rate [%]': '0.0',
'Elapsed Time [Sec]': '175.27',
'Line Utilization [%]': '23.57',
'Max Rate [bps]': '16.8 Gbps',
'NDR points': ['8.98 Gbps'],
'OPT RX Rate [bps]': '4.49 Gbps',
'OPT Rate (Multiplier) [%]': '26.804407187098942',
'OPT TX Rate [bps]': '4.49 Gbps',
'Queue Full [%]': '0.0%',
'RX [MPPS]': '17.54 MPPS',
'RX [bps]': '8.98 Gbps',
'TX [MPPS]': '17.54 MPPS',
'TX [bps]': '8.98 Gbps',
'Title': 'l3',
'Total Iterations': 1,
'Total RX L1': '11.78 Gbps',
'Total TX L1': '11.78 Gbps',
'latency': {},
'valid_latency': True}
Example IPv6:
$ ./ndr --stl --ports 0 1 --force-map --bi-dir --opt-bin-search \
--profile stl/l3.py --prof-tun \
left-ip=fd00:f00::1,left-gw=fd00:f00::254,right-ip=fd00:ba4::1,right-gw=fd00:ba4::254
ND: TX NS: fd00:f00::1,30:3e:a7:0b:f2:54 -> fd00:f00::254 (retry 0)
ND: RX NA: fd00:f00::1 <- fd00:f00::254, 30:3e:a7:0b:ea:78
ND: TX NS: fd00:ba4::1,30:3e:a7:0b:f2:55 -> fd00:ba4::254 (retry 0)
ND: RX NA: fd00:ba4::1 <- fd00:ba4::254, 30:3e:a7:0b:ea:79
Bench Run has finished :-)
{'BW per core [Gbit/sec @100% per core]': '49.99Gbit/Sec @100% per core',
'CPU Utilization [%]': '1.47',
'Drop Rate [%]': '0.05',
'Elapsed Time [Sec]': '280.44',
'Line Utilization [%]': '19.17',
'Max Rate [bps]': '18.63 Gbps',
'NDR points': ['7.35 Gbps'],
'OPT RX Rate [bps]': '3.68 Gbps',
'OPT Rate (Multiplier) [%]': '19.79566845228384',
'OPT TX Rate [bps]': '3.68 Gbps',
'Queue Full [%]': '0.0%',
'RX [MPPS]': '13.92 MPPS',
'RX [bps]': '7.35 Gbps',
'TX [MPPS]': '13.93 MPPS',
'TX [bps]': '7.35 Gbps',
'Title': 'l3',
'Total Iterations': 4,
'Total RX L1': '9.58 Gbps',
'Total TX L1': '9.58 Gbps',
'latency': {},
'valid_latency': True}