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.03k stars 234 forks source link

Cannot replay the pcap file in loop mode #296

Closed LibinLiu0189 closed 2 years ago

LibinLiu0189 commented 3 years ago

I use the latest MoonGen version and meet the same problem. It cannot solve the problem using the solution below.

$ sudo ./build/MoonGen ./examples/pcap/replay-pcap.lua 0 trace/caida16.pcap -r 1 -l Like the command above, I run it and only the first time, the trace is played according to the pcap file, in the following, the sending rate is 0 Mbps and not packets are sent.

Could you help check this? Thanks.

Fix that. Change line 65 from "if rateLimiter then" to "if rateLimiter and n > 0 then".

Junzhi

Originally posted by @Gavindeed in https://github.com/emmericp/MoonGen/issues/240#issuecomment-479721181

GrehXscape commented 3 years ago

Do I need to set the prev back to 0 while resetting pcap file?