The tools¶
The suite is six focused command-line tools built from a shared codebase. Each does one job well; you compose them into a workflow.
-
Replay pcap files onto the network at arbitrary speeds — original timing, a fixed rate, or line rate.
-
tcpreplaywithtcprewrite's editing folded in — rewrite headers and replay in a single pass. -
Rewrite Layer 2–4 headers in a pcap: MACs, IPs, ports, VLANs, checksums, DLT.
-
Classify each packet as client or server and write a cache file the other tools consume.
-
Bridge two segments, rewriting packets in flight with the same engine as
tcprewrite. -
Replay a captured TCP session against a live server, exercising the full stack.
-
Decode and debug the raw structure of a pcap file.
How they fit together¶
The tools are designed to pipe into one another through files:
flowchart LR
cap[".pcap<br/>capture"] --> prep["tcpprep"]
prep -->|cache file| replay["tcpreplay"]
cap --> rewrite["tcprewrite"]
rewrite -->|edited .pcap| replay
prep -->|cache file| rewrite
cap --> replay
replay --> wire(["network<br/>interface"])
cap --> live["tcpliveplay"]
live --> server(["live server"])
tcpprepreads a capture once and writes a compact cache file that labels every packet client-to-server or server-to-client.tcprewriteandtcpreplaycan both read that cache (-c) to make direction-aware edits — for example sending client packets out one NIC and server packets out another.tcprewriteedits a capture into a new file;tcpreplayputs packets on the wire.tcpliveplayis the exception: it doesn't just push Layer 2 frames, it carries on a real TCP conversation with a live server.
See The tcpprep cache pipeline for the full story.
tcpreplay and tcpreplay-edit¶
When the suite is built with editing support, tcpreplay-edit
is produced alongside tcpreplay. It is tcpreplay plus every rewriting
option from tcprewrite, so you can edit and replay in a single pass without an
intermediate file. Plain tcpreplay omits the editing engine and is the lean
choice when you only need to send an unmodified capture. See its
own page for details.
Full option reference¶
These pages are task-oriented. For the complete, authoritative list of every option a tool accepts, see the man pages or run: