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

Measuring latency with custom headers #286

Open harshgondaliya opened 3 years ago

harshgondaliya commented 3 years ago

I am trying to adapt l2-load-latency.lua to measure latency for packets that have the following structure:

Eth / Custom Header 1 (2 bytes) / Custom Header 2 (10 bytes) / Custom Header 3 (10 bytes) / Custom Header 4 (4 bytes) / Custom Header 5 (4 bytes)

I have followed the directions given in newProtocolTemplate.lua. I have modifiedgetEthernetPacket() andgetPtpPacket() function in packet.lua so that the createStack() has the appropriate parameters.

After making all these changes I get nan ns readings on running l2-load-latency.lua. Also when I see packets at the receiving end, they do not have the custom headers that I have created.

Are there any more code changes that I need to make? Also, does MoonGen support this? Measuring latency for packets with custom headers?