pktgen / Pktgen-DPDK

DPDK based packet generator
Other
390 stars 120 forks source link

Question regardless of Pktgen PCAP replaying #250

Closed Paullgk closed 6 months ago

Paullgk commented 7 months ago

Hello community,

I am currently using Pktgen for replaying PCAP files at the maximum line rate of my nic (1Gbit/s), to a receiver directly connected to the bound DPDK nic. This is a very great tool for our use. I am using it by replaying PCAP files composed of packets based on a custom level 2 protocol.

I would like to add some pacing when sending my packets: I want them to be sent with the timestamp described in the PCAP file (my goal is to reproduce the same behavior of app such as tcpreplay or bittwist). Other than the rate parameter, I didn't found any way to reduce timing between packets sending. Would you think Pktgen capable of this feature? If yes, how hard would it be?

Thanks in advance, Paul Le Guen de Kerneizon, Savoir-faire Linux

KeithWiles commented 7 months ago

Pktgen does not attempt to send packets from a PCAP using the timestamp data. It could be possible and would require some thought on how to design the code. When sending PCAP frames with a single lcore seems reasonable as pacing the packets, but if you try to add multiple lcores to get a high performance it would be tricky and not sure it would work. For one lcore sending a given PCAP it could be done I think.

Paullgk commented 7 months ago

Thanks for your reply. My use case is to send 1 packet of 136 bytes size every 250µs. Theoretically, this configuration would require a 4.35Mbit/s rate with a continuous packets sending, but I am seeing that Pktgen is sending packets as burst of 128 or 256 packets. Is there any way to send packets at a regular pace instead bursting them? I tried the txburst parameter, but I can see no changes.