A suite of tools to edit and replay captured network traffic. It allows to classify traffic as client or server, rewrite Layer 2, 3 and 4 headers and replay the traffic back onto the network and through network devices.
Questions tagged [tcpreplay]
64 questions
5
votes
0 answers
Replaying pcap on loopback
I have a set of pcap files containing UDP traffic from two hosts, and have to perform some analysis on this traffic on a regular basis.
Ideally, I would want to avoid having to frequently setup local interfaces with specific IPs and such to replay…

NewbiZ
- 2,395
- 2
- 26
- 40
5
votes
2 answers
replay captured udp traffic
I am trying to send packets using TCP replay. The file was captured in another network and contains UDP packets. In order to replay, I've changed the src and destination address, etc...using the following command:
tcprewrite --infile=original.cap…

rgoncalves
- 171
- 1
- 1
- 7
4
votes
1 answer
tcpreplay not work client not receive the data
In server
# nc -lp 2424
hi server
hi client
1
2
3
In client
➜ ~ nc 139.224.xxx.xx 2424
hi server
hi client
1
2
3
Then in client
➜ ~ sudo tcpdump -i en0 -nn -s0 -v src port 2424 -c 10 -w 2424.pcap
tcpdump: listening on en0, link-type EN10MB…

zhuguowei
- 8,401
- 16
- 70
- 106
3
votes
2 answers
Continue despite failed packet when using tcpreplay
I am trying to use tcpreplay to send the contents of a pcap file. It is refusing to send some packets because they are too long. However, instead of continuing with the next packet, it stops:
$ tcpreplay -i p4p1 multi.pcap
Warning: May need to run…

wrgrs
- 2,467
- 1
- 19
- 24
3
votes
2 answers
Why does this script that uses tcpreplay not wait for user input?
The following snippet will only wait for the user to hit Enter the first time; after that, it cycles through all the rest of the .pcap files without waiting for user input.
$| = 1;
while (<*.pcap>) {
print "$_";
;
…

packetie
- 4,839
- 8
- 37
- 72
2
votes
1 answer
tcpreplay traffic not being seen in localhost with netcat
I have a pcap file that I modified with tcprewrite to set source and destination IP = 127.0.0.1, while the port numbers are different. I also set both mac addresses to 00:00:00:00:00:00 as I understand that comms over localhost ignore MAC. I made…

Cosmo
- 491
- 7
- 14
2
votes
1 answer
Packets getting dropped with Libpcap in C on 1 Gig Traffic
I'm writing a packets parser in C using libpcap library. Here is the simple code
int main(int argc, char *argv[])
{
pcap_t *pcap;
const unsigned char *packet;
char errbuf[PCAP_ERRBUF_SIZE];
struct pcap_pkthdr header;
clock_t…

Alamgir Qazi
- 763
- 1
- 11
- 25
2
votes
1 answer
use tcpreplay for real trace internet dataset
I have CAIDA internet trace dataset and it contain more than 200000 unique IPv4 addresses and almost 1 million flows.
Im currently using mininet to emulate my SDN project and i wish that i could use this dataset in my simulation.
What i plan is tou…

user3085445
- 95
- 2
- 10
2
votes
1 answer
How to add Tcpreplay as a library in C language or any other programming language?
I am trying to add tcpreplay library in C so that I can rewrite the data in the packet. I have been searching for a library in C programming. The result was to add TCPreplay and start using it's methods. Unfortunately it is not there for C…

b0b
- 33
- 5
1
vote
0 answers
Should I change source IP for tcpreplay to wlan?
I'm using tcpreplay and tcprewrite in openwrt.
And I want to resend captured packet to another node.
Bellow is my description.
External OpenWRT Computer1
eth0 …

YoonPD
- 11
- 2
1
vote
1 answer
tcpreplay: replay a pcap in reverse order
is there any way to replay a pre-recorded pcap file in reverse order? That is, starting from the last packet in the file and without changing the delay between packets?
I also tried reversing the pcap itself using scapy as follows:
>>> from…

tano
- 836
- 1
- 10
- 25
1
vote
1 answer
tcpreplay is sending packets out of order?
When I use 'tcpreplay' to send packets to my switch, I found that packets are out of order. For example, using tcpreplay -i eth1 test.pcap, I get:
I send packets like **[1,2,3,4,5,……]**,
but switch received **[1,3,4,2,5,……]**.
Does this problem…

WuDangWangYe
- 23
- 5
1
vote
1 answer
tcpprep: Command line arguments not allowed
I'm not sure, why executing below command on ubuntu terminal throws error. tcpprep syntax and options are mentioned as per in help doc, still throws error.
root@test-vm:~# /usr/bin/tcpprep --cachefile='cachefile1' —-pcap='/pcaps/http.pcap'…

Darknight
- 1,132
- 2
- 13
- 31
1
vote
2 answers
GoReplay - replay from .log instead of .gor
I am looking into GoReplay as to reproduce part of the production traffic that occurred yesterday.
The traffic I want to reproduce has been recorded with nginx, and I can save it as a .log or .csv file.
From what I can tell from the replay http…

Rafael Marques
- 1,335
- 4
- 22
- 35
1
vote
1 answer
tcpdump of tcpreplay output does not match input
I am having an issue in which on certain machines the number of bytes that tcpdump reports tcpreplay has output does not match tcpreplay's input.
Specifically, tcpdump always reports 14 bytes more than the pcap given to tcpreplay.
To replicate, I've…

I.Ped
- 108
- 1
- 12