python - Pcap file replay based on the packet timestamp using scapy -


i have 1 pcap file (~90m), , want replay file. came across scapy , provides way read pcap file , replay it. tried following 2 ways replay packets

sendp(rdpcap(<filename>) 

and

pkts = pcapreader(<filename>); pkt in pkts:      sendp(pkt) 

first 1 game me memory error, memory consumption of python process went 3 gig , died. second option worked fine me because did not read whole file memory. have following 3 question

  1. is 90m pcap file big scapy replay?

  2. whenever use tcpdump/wireshark, every packet has timestamp associated it. assume packet 1 came @ time t , packet 2 came @ time t+10, scapy replay packets in similar manner, first packet @ time t , second @ t+10? or keep sending them in loop, think later case pcapreader.

  3. if answer no above question ( replay in loop, without considering packet inter arrival time), have other python library can job me? python not constraint me.

to answer first question, sounds answered yourself! try running first option again on pcap file that's 40-50 mb instead , see if errors out. way can @ least check file big system in combination scapy handle (not enough ram in system handle how scapy runs algorithms built handle few packets @ time, not 90mb pcap file) or if it's in code.

to answer second question, based off of reading's i've been doing on scapy on past few weeks believe yes. however, don't know of sources off top of head verification.

ninja edit - saw on stackoverflow question - specify timestamp on each packet in scapy?

while single packet - if every packet timestamped within scapy imagine same every packet in large pcap file read in. in way when replay packets should go in same order.

a lot of educated guessing going on in answer, hope helps though!


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -