Problem
I need to modify a .pcap file captured over a timespan of 5 minutes such that it simulates a .pcap file captured over a timespan of 20 minutes. The problem is that I don't know how to do this.
Example
To illustrate the problem, suppose I have a .pcap file with 4 captured packets p1
-p4
and t
as a start time such that:
p1
is sent att
+ 0 minutesp2
is sent att
+ 1 minutesp3
is sent att
+ 2 minutesp4
is sent att
+ 3 minutes
I want my resulting .pcap file to contain the same four packets but with the timestamps scaled (from 5 minutes to 20 minutes) such that they represent the following:
p1
is sent att
+ 0 minutesp2
is sent att
+ 4 minutesp3
is sent att
+ 8 minutesp4
is sent att
+ 12 minutes
Tried solution(s)
editcap
, however the only option I could find here is to adjust all timestamps with a set value using the-t
option.
Background
I am using tcpreplay
to replay a scenario in which a user browsers a webpage. I simultaniously inject some packets which are dependent on the .pcap file I replayed, i.e. the packets are injected by live monitoring of the replayed traffic and subsequently adjusting the packets it sends out. This entire traffic trace - i.e. both the replayed traffic and the injected packets - are captured using tcpdump
. As there are a lot of large .pcap files I want to replay, I use the tcpreplay --multiplier
option to speed up the process. However, this means the final capture is a compressed version of the original .pcap file. I would like to 'stretch' the newly created .pcap to be the same size as the original.