安装
$modeprobe pktgen
遇到“Could not open moddep file ‘/lib/modules/XXX/modules.dep.bin’”是dep问题,一般是由于kernel变后导致module依赖不对,可试着$sudo apt-get install –reinstall linux-image-3.13.0
or 运行$depmod -a后就可以了。
从github上下载example的script:
测试:使用2个CPU测试发包速率
1. 测试过程:client 1调用pktgen不断发包给client 2。
client 1 pkt size | client 1 pps | client1 Mb/Sec | Client 1 CPU Usage | Client 2 CPU Usage | Vyos CPU Usage |
64 | 1242692 | 636 | core1: 100% | core1:100% | core6:100% |
128 | 1235203 | 1264 | core1:100% | core1:100% | core6:100% |
256 | 1200064 | 2457 | core1:100% | core1:100% | core6:100% |
512 | 1195420 | 4896 | core1:100% | core1:100% | core6:100% |
1024 | 1191516 | 9760 | core1:100% | core1:100% | core6:100% |
1472 | 835227 | 9835 | core1:100% | core1:30% | core6:5% |
2048
|
603254 | 9883 | core1:100% | not recv | not recv |
2. 测试过程:client 1和client 2都调用pktgen不断发包给对方。
client pkt size | client 1 pps | client1 Mb/Sec | client 2 pps | client 2 Mb/Sec | Client 1 CPU Usage | Client 2 CPU Usage | Vyos CPU Usage |
64 | 1211888 | 620 | 688195 | 352 | core1: 100% | core1:100% | core6:100% |
128 | 1204561 | 1233 | 674198 | 690 | core1:100% | core1:100% | core6:100% |
256 | 1183999 | 2424 | 599256 | 1227 | core1:100% | core1:100% | core6:100% |
512 | 1170995 | 4796 | 635350 | 2602 | core1:100% | core1:100% | core6:100% |
1024 | 1174766 | 9623 | 605108 | 4957 | core1:100% | core1:100% | core6:100% |
1472 | 832268 | 9800 | 714634 | 8415 | core1:100% | core1:30% | core6:less than5% |
Pktgen-dpdk
client2: pktgen-dpdk, client1: nothing, vyos: nothing
在vyos中可使用iptraf监控,或自己写脚本。
1. client2->vyos->client1. client 1 is receiver, client 2 is sender. Single Steam
client pkt size | client 1 pps | client1 Mb/Sec | client 2 pps | client 2 Mb/Sec | Client 1 CPU Usage | Client 2 CPU Usage | Vyos CPU Usage |
64 | 2799360 | 127 | 14390041 | 9671 | 1: 100% | all:100% | 3:100% |
128 | 2843584 | 335 | 8445573 | 9999 | 1:100% | all:100% | 3:100% |
256 | 2721728 | 651 | 4528806 | 9999 | 1:100% | all:100% | 3:100% |
512 | 3073600 | 1487 |
2349520
|
9999 | 1:100% | all:100% | 3:100% |
1024 | 3075456 | 2995 | 1197265 | 9999 | 1:100% | all:100% | 3:100% |
1472 | 2008020 | 2809 | 837765 | 9999 | 1:50% | all:100% | 3: less than 5% |
2. client2->vyos->client1. client 1 is receiver, client 2 is sender. Multiple Steam
config:
src.mac start 0 00:00:00:00:00:00
src.ip start 0 10.0.2.1
src.ip min 0 10.0.2.1
src.ip max 0 10.0.2.254
src.port start 0 22
src.port min 0 22
src.port max 0 9999
dst.port start 0 22
dst.port min 0 22
dst.port max 0 9999
client pkt size | client 1 pps | client1 Mb/Sec | client 2 pps | client 2 Mb/Sec | Client 1 CPU Usage | Client 2 CPU Usage | Vyos CPU Usage |
64 | 2843713 | 162 | 14384361 | 9666 | 1: 100% | all:100% | 3:100% |
128 | 2835264 | 334 | 8445586 | 9999 | 1:100% | all:100% | 3:100% |
256 | 2712828 | 653 | 4520795 | 9999 | 1:100% | all:100% | 3:100% |
512 | 3079104 | 1491 |
2349521
|
9999 | 1:100% | all:100% | 3:100% |
1024 | 3072960 | 2997 | 1197266 | 9999 | 1:100% | all:100% | 3:100% |
1472 | 2010541 | 2802 | 837767 | 9999 | 1:50% | all:100% | 3: less than 5% |
3. Huge Route Table Entry
Manually add 50. No much big differences.
TODO: please use the big data in www.routeviews.org
Parameter Tuning: only a small perf difference
Reference: Tuning 10Gb network cards on Linux
Jumbo frame: mtu=9000.
transmission queue size from 500 to 3000