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
235
forks
source link
Less code in the sending loop leads to bandwidth decrease. #311
I should probably ask this in libmoon, however since its a general question and here there is a bit more of activity I thought it would be more beneficial.
for i, buf in ipairs(bufs) do
-- packet framework allows simple access to fields in complex protocol stacks
local pkt = buf:getUdpPacket()
pkt.udp:setSrcPort(SRC_PORT_BASE + math.random(0, NUM_FLOWS - 1))
end
However, if I remove the line that sets the src port:
for i, buf in ipairs(bufs) do
-- packet framework allows simple access to fields in complex protocol stacks
local pkt = buf:getUdpPacket()
--pkt.udp:setSrcPort(SRC_PORT_BASE + math.random(0, NUM_FLOWS - 1))
end
Hi Paul,
I should probably ask this in libmoon, however since its a general question and here there is a bit more of activity I thought it would be more beneficial.
This is just out of curiosity. I observed that by having less code in a sending loop I get 9-10 Mpps instead of 14.8. For example if we use https://github.com/libmoon/libmoon/blob/master/examples/pktgen.lua:
When the main sending loop modified the src port:
However, if I remove the line that sets the src port:
I get:
Is this expected? Do you have any explanation for this? I would like to learn what is the optimization that happens here or that "does not happen".
For the test I am using a Intel Corporation Ethernet Controller X710 for 10GbE SFP+, 1 single thread.