You got a play with exanic-replay
There are a couple solutions which can play back a pcap but they fall short in having advanced features. e.g they can’t deliver the packets in time, or are able to achieve line rate or play back based on a given timestamp.
This is what exanic-replay is capable of:
exanic-replay — A PCAP Network Traffic Replay Tool for Linux and Windows designed for ExaNICs.
In addition, it allows for specifying the message rate. It supports both Windows and Linux.
By reading the pcaps into memory first, here we show how to play back, as fast as possible :
exanic-replay.exe -i 10 -m my_pcap.pcapnp
Reading packets into memory
Read 13000 packets into memory
Thread 0> Packets: 130000
Thread 0> Skipped Packets: 0
Thread 0> Bytes: 662360000
Thread 0> Rate: 0.21 Mpps
Thread 0> Throughput: 9.382 Gbps in 5.648 secs
Using multi-threaded playback :
exanic-replay.exe -t 2 -v -i 10000 -m my_pcap.pcapnp
Reading packets into memory
Read 130 packets into memory
[0] Pinned to CPU 0 [Core 1]
[1] Pinned to CPU 1 [Core 2]
Opening Device exanic0
Opening Device exanic0
Thread 1> Packets: 1300000
Thread 1> Skipped Packets: 0
Thread 1> Bytes: 6623600000
Thread 1> Rate: 0.12 Mpps
Thread 1> Throughput: 4.973 Gbps in 10.655 secs
Thread 0> Packets: 1300000
Thread 0> Skipped Packets: 0
Thread 0> Bytes: 6623600000
Thread 0> Rate: 0.12 Mpps
Thread 0> Throughput: 4.973 Gbps in 10.656 secs
Aggregate packet send information for 2 threads:
All threads> Packets: 2600000
All threads> Skipped Packets: 0
All threads> Bytes: 13247200000
All threads> Rate: 0.24 Mpps
All threads> Throughput: 9.946 Gbps in 10.656 secs
Other options are to play back at a given rate or bandwidth.
Usage :
Usage: exanic_replay [options] <file.pcap>
-v: Print verbose output
-d <device>: ExaNIC Device to use [exanic0]
-p <port>: ExaNIC port number to use [0]
-m: Prefetch pcap data into memory first
-n <count>: Maximum number of packets to send from pcap file
-t <nthreads>: Number of threads to concurrently send (max: 8)
-i <iters>: Number of times to replay the file on each thread
-r <x.y>: Replay at x.y Gbits/s (per thread, not aggregate)
-R <x.y>: Replay at x.y Mpps (per thread, not aggregate)
-z: Replay according to packet timestamp
References:
exanic-replay is developed and supported by NEIO Systems, Ltd. http://www.fastsockets.com