emmericp / MoonGen

MoonGen is a fully scriptable high-speed packet generator built on DPDK and LuaJIT. It can saturate a 10 Gbit/s connection with 64 byte packets on a single CPU core while executing user-provided Lua scripts for each packet. Multi-core support allows for even higher rates. It also features precise and accurate timestamping and rate control.
MIT License
1.04k stars 234 forks source link

Unexpected Behavior in l2-loadlatency.lua #254

Closed sarsanaee closed 4 years ago

sarsanaee commented 4 years ago

Hello,

I send some packets with l2-loadlatency.lua example to dump.lua. I actually tried to change the rate with different numbers but it seems it doesn't work! Like I tried the script with different rates from 1 to 10000 but always get the same number from the counters!!!!

[Device: id=1] RX: 10.49 (StdDev 0.11) Mpps, 5037 (StdDev 54) Mbit/s (6716 Mbit/s with framing), total 6165916709 packets with 369955002540 bytes (incl. CRC)
[Device: id=0] TX: 10.49 (StdDev 0.11) Mpps, 6045 (StdDev 64) Mbit/s (7724 Mbit/s with framing), total 6166629945 packets with 443997356040 bytes (incl. CRC)

I assume that the rate is in Mbit/s, however, I get only a number around 6045 Mbps as the sender queue rate. I actually checked if the input is really a different number each time and there is no issue in that regard!

Thanks

sarsanaee commented 4 years ago

Actually, I'm using vdev as my ports, so I think the rate-limiting won't be possible with that function at all.

emmericp commented 4 years ago

rate limiting is a hardware feature, check out the software rate limiter here: https://github.com/emmericp/MoonGen/blob/master/examples/rate-control-methods.lua