I want to test network device code by replaying captured traffic. The middle-box(bridge) has two interfaces, connected to hosts machine-A and machine-B. The captured traffic in the pcap file contains traffic between three different IP addresses. I want to replay traffic originating from 2 of these IP addresses from machine-A(as clients) and replay the traffic originating from the remaining IP address from machine-B(as a server). I want to replay the traffic at top-speed but preserve the relative order of the packets seen by the bridge. That is, if the order of packets in the original capture file is (Time, Soruce, Destination):
1s client1 --> server1
5s client1 --> server1
8s server1 --> client1
I want machine-A to act in the client mode and send first two packets asap. I want machine-B to act in the server mode and it should send third packet as soon as it receives the first two packets and so-on. I will decide which IP addresses are to be treated as clients and which ones are servers.
I looked at tcpreplay and tcpprep tools. But I don't think they support replaying from different machines while preserving a chronological order. Before hacking something like this using scapy, I want to know if there is an easier way to do it?