title: Replay pcap file in mininet simulator
body: <p>I am trying to replay a pcap file in mininet simulator. Tcpreplay is there to do this but it can do so only at host level i.e. between two hosts(as far as I know), and I want to do this for the whole network, basically recreate the network as it is in the pcap file and then send the traffic in the network as it was done in the pcap file.</p>
  <p>Till now, for recreating the network I converted the pcap file into csv file and using pandas, I fetched the number of hosts based on unique ip address, fetched switches using PcapViz(<a href="https://github.com/mateuszk87/PcapViz" rel="nofollow noreferrer">https://github.com/mateuszk87/PcapViz</a>), read the mac addresses from the device topology network graph, used NFStream(<a href="https://github.com/nfstream/nfstream" rel="nofollow noreferrer">https://github.com/nfstream/nfstream</a>) to fetch the flow info and for all the ip addresses used with each mac address/switch, created links between switch and host.</p>
  <p>Now I have an idea that I can use some traffic generator(scapy, D-ITG) which can read the pcap file and for each packet in the pcap file, generate the packet , read the hosts involved and send that packet. I know this approach won't be recreating the network as it was in pcap file, but it does look similar.</p>
  <p>My question is that I am not sure how to do the traffic generation part i.e. how to proceed with it, how to code for this part, so can anyone guide me regarding the same.</p>