123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470 |
- <!-- Creator : groff version 1.18.1 -->
- <!-- CreationDate: Wed Dec 22 15:16:41 2004 -->
- <html>
- <head>
- <meta name="generator" content="groff -Thtml, see www.gnu.org">
- <meta name="Content-Style" content="text/css">
- <title>TCPPREP</title>
- </head>
- <body>
- <h1 align=center>TCPPREP</h1>
- <a href="#NAME">NAME</a><br>
- <a href="#SYNOPSIS">SYNOPSIS</a><br>
- <a href="#DESCRIPTION">DESCRIPTION</a><br>
- <a href="#OPTIONS">OPTIONS</a><br>
- <a href="#SEE ALSO">SEE ALSO</a><br>
- <a href="#AUTHOR">AUTHOR</a><br>
- <a href="#BUGS">BUGS</a><br>
- <hr>
- <a name="NAME"></a>
- <h2>NAME</h2>
- <!-- INDENTATION -->
- <table width="100%" border=0 rules="none" frame="void"
- cols="2" cellspacing="0" cellpadding="0">
- <tr valign="top" align="left">
- <td width="10%"></td>
- <td width="89%">
- <p>tcpprep − create a tcpreplay cache file from a
- saved capture file</p>
- </td>
- </table>
- <a name="SYNOPSIS"></a>
- <h2>SYNOPSIS</h2>
- <!-- INDENTATION -->
- <table width="100%" border=0 rules="none" frame="void"
- cols="2" cellspacing="0" cellpadding="0">
- <tr valign="top" align="left">
- <td width="10%"></td>
- <td width="89%">
- <p><b>tcpprep</b> [ <b>−a −n</b> [ <i>bridge</i>
- | <i>router</i> | <i>client</i> | <i>server</i> ] |
- <b>−c</b> <i>CIDR,...</i> | <b>−r</b>
- <i>regex</i> | <b>−p</b> ] [ <b>−h</b> |
- <b>−V</b> ] [ <b>−i</b> <i>pcapfile</i> ] [
- <b>−v</b> ] [ <b>−m</b> <i>minmask</i> ] [
- <b>−M</b> <i>maxmask</i> ] [ <b>−N</b>
- <i>client</i> | <i>server</i> ] [ <b>−R</b>
- <i>ratio</i> ] [ <b>−x</b> <i>include</i> |
- <b>−X</b> <i>exclude</i> ] [ <b>−C</b>
- <i>comment</i> ] <b>−o</b> | <b>−P</b>
- <i>cachefile</i></p>
- </td>
- </table>
- <a name="DESCRIPTION"></a>
- <h2>DESCRIPTION</h2>
- <!-- INDENTATION -->
- <table width="100%" border=0 rules="none" frame="void"
- cols="2" cellspacing="0" cellpadding="0">
- <tr valign="top" align="left">
- <td width="10%"></td>
- <td width="89%">
- <p><i>Tcpprep</i> is a program for creating a cache file for
- later use with <i>tcpreplay(8)</i>. By using tcpprep to
- pre-process a pcap, tcpreplay in dual-nic mode can match the
- performance of the traditional tcpreplay single-nic
- mode.</p>
- <!-- INDENTATION -->
- <p>The basic operation of <i>tcpprep</i> is to compare each
- packet from it’s <i>input file</i> and compare it to
- either a <i>regular expression</i> or against a list of
- <i>CIDR</i>’s. It then writes the result of this
- comparison to the <i>cache file</i> for later use with
- <i>tcpreplay</i>. This <i>cache file</i> is a string of
- characters, with each bit representing a single packet. This
- provides an efficent and portable means of storing the
- necessary data.</p>
- </td>
- </table>
- <a name="OPTIONS"></a>
- <h2>OPTIONS</h2>
- <!-- TABS -->
- <table width="100%" border=0 rules="none" frame="void"
- cols="4" cellspacing="0" cellpadding="0">
- <tr valign="top" align="left">
- <td width="11%"></td>
- <td width="7%">
- <p><b>−a</b></p>
- </td>
- <td width="2%"></td>
- <td width="77%">
- <p>Auto mode. Tcpprep will try to learn the roles of
- systems on the network, and split traffic between the two
- interfaces based upon whether a system is classified as a
- "server" or "client". Servers are sent
- out the primary interface, clients out the secondary.
- Requires the use of -n and excludes the use of -c, -p and
- -r.</p>
- </td>
- <tr valign="top" align="left">
- <td width="11%"></td>
- <td width="7%">
- <p><b>−c</b></p>
- </td>
- <td width="2%"></td>
- <td width="77%">
- <p>CIDR mode. Specify a list of CIDR’s
- (network1/masklen1,network2/masklen2,...) to match against
- the source IP of each packet. Packets matching any of the
- CIDR’s are sent out the primary interface; remaining
- packets are sent out the secondary interface. Can’t be
- used with -r or -a.</p>
- </td>
- <tr valign="top" align="left">
- <td width="11%"></td>
- <td width="7%">
- <p><b>−C</b></p>
- </td>
- <td width="2%"></td>
- <td width="77%">
- <p>Imbed a comment in the tcpprep cache file which can be
- later viewed via -P.</p>
- </td>
- <tr valign="top" align="left">
- <td width="11%"></td>
- <td width="7%">
- <p><b>−h</b></p>
- </td>
- <td width="2%"></td>
- <td width="77%">
- <p>Help.</p>
- </td>
- <tr valign="top" align="left">
- <td width="11%"></td>
- <td width="7%">
- <p><b>−i</b></p>
- </td>
- <td width="2%"></td>
- <td width="77%">
- <p>Input file (pcap format)</p>
- </td>
- <tr valign="top" align="left">
- <td width="11%"></td>
- <td width="7%">
- <p><b>−m</b></p>
- </td>
- <td width="2%"></td>
- <td width="77%">
- <p>Minimum mask length. Used in auto/router mode to set the
- minimum valid network size. Defaults to 30 (bits).</p>
- </td>
- <tr valign="top" align="left">
- <td width="11%"></td>
- <td width="7%">
- <p><b>−M</b></p>
- </td>
- <td width="2%"></td>
- <td width="77%">
- <p>Maximum mask length. Used in auto/router mode to set the
- maximum valid network size. Defaults to 8 (bits).</p>
- </td>
- <tr valign="top" align="left">
- <td width="11%"></td>
- <td width="7%">
- <p><b>−n</b></p>
- </td>
- <td width="2%"></td>
- <td width="77%">
- <p>Network type. Used to specify the network type in auto
- mode as either bridge, client, server or router. Required
- with -a.</p>
- </td>
- </table>
- <!-- INDENTATION -->
- <table width="100%" border=0 rules="none" frame="void"
- cols="2" cellspacing="0" cellpadding="0">
- <tr valign="top" align="left">
- <td width="10%"></td>
- <td width="89%">
- <p>Bridge mode processes each packet to try to determine if
- the sender is a client or server. Once all the packets are
- processed, the results are weighed according to the
- server/client ratio (-R) and systems are assigned an
- interface. If tcpprep is unable to determine what role a
- system plays, tcpprep will abort.</p>
- <!-- INDENTATION -->
- <p>Client mode works just like bridge mode, except that
- unclassified systems are treated as clients.</p>
- <!-- INDENTATION -->
- <p>Server mode works just like bridge mode, except that
- unclassified systems are treated as servers.</p>
- <!-- INDENTATION -->
- <p>Router mode works just like bridge mode, except that
- after weighing is done, systems which are undetermined are
- considered a server if they fall inside a network known to
- contain other servers. Router mode will never abort on
- systems which can’t be determined.</p>
- <!-- INDENTATION -->
- <p>Router mode trys to build a list of networks containing
- only servers and unknown IP’s. It starts out with very
- large networks (8 bit netmask by default, change with -M)
- and works it’s way down to the minimum mask len (-m).
- If tcpprep is unable to determine one or more networks which
- only contains servers and unknowns, tcpprep will abort.</p>
- <!-- INDENTATION -->
- <p>Port mode looks at the source/destination port of the TCP
- or UDP packet. Client traffic goes out the primary
- interface, and server traffic out the secondary interface.
- Non-TCP and UDP traffic goes out the same interface as
- non-IP traffic does. Note that this mode does not track IP
- addresses; so an IP may appear to jump between interfaces
- depending on if it is the client or server.</p>
- <!-- INDENTATION -->
- <p>In all cases, servers are sent out the primary interface,
- and clients out the secondary.</p>
- </td>
- </table>
- <!-- TABS -->
- <table width="100%" border=0 rules="none" frame="void"
- cols="4" cellspacing="0" cellpadding="0">
- <tr valign="top" align="left">
- <td width="11%"></td>
- <td width="4%">
- <p><b>−N</b></p>
- </td>
- <td width="5%"></td>
- <td width="77%">
- <p>Non-IP packet classification. Non-IP datagrams (such as
- arp) currently aren’t handled by tcpprep. This option
- allows you to define an interface to send them out. Default
- is client.</p>
- </td>
- <tr valign="top" align="left">
- <td width="11%"></td>
- <td width="4%">
- <p><b>−o</b></p>
- </td>
- <td width="5%"></td>
- <td width="77%">
- <p>Output file (tcpreplay cache file)</p>
- </td>
- <tr valign="top" align="left">
- <td width="11%"></td>
- <td width="4%">
- <p><b>−p</b></p>
- </td>
- <td width="5%"></td>
- <td width="77%">
- <p>Port mode. Split TCP/UDP traffic based on the
- destination port.</p>
- </td>
- <tr valign="top" align="left">
- <td width="11%"></td>
- <td width="4%">
- <p><b>-P</b></p>
- </td>
- <td width="5%"></td>
- <td width="77%">
- <p>Print the embeded tcpprep cache file comment.</p>
- </td>
- <tr valign="top" align="left">
- <td width="11%"></td>
- <td width="4%">
- <p><b>−r</b></p>
- </td>
- <td width="5%"></td>
- <td width="77%">
- <p>Regex mode. Specifies a regular expression to match
- against the source ip of each packet. Packets matching are
- sent out the primary interface; remaining packets are sent
- out the secondary interface. Can’t be used with -a or
- -c.</p>
- </td>
- <tr valign="top" align="left">
- <td width="11%"></td>
- <td width="4%">
- <p><b>−R</b></p>
- </td>
- <td width="5%"></td>
- <td width="77%">
- <p>The ratio of server connections to client connections
- necessary to be classified as a server in auto mode. A
- system is classified as a server if [# server connections]
- >= ([# client connections] * [ratio]). Default is:
- 2.0</p>
- </td>
- <tr valign="top" align="left">
- <td width="11%"></td>
- <td width="4%">
- <p><b>−x</b></p>
- </td>
- <td width="5%"></td>
- <td width="77%">
- <p>Specifies which packets from the capture file(s) to
- send. Can be one of:</p>
- </td>
- </table>
- <!-- INDENTATION -->
- <table width="100%" border=0 rules="none" frame="void"
- cols="2" cellspacing="0" cellpadding="0">
- <tr valign="top" align="left">
- <td width="21%"></td>
- <td width="77%">
- <p>S:<CIDR1>,... - Src IP must match specified
- CIDR(s)<br>
- D:<CIDR1>,... - Dst IP must match specified
- CIDR(s)<br>
- B:<CIDR1>,... - Both src and dst addresses must
- match<br>
- E:<CIDR1>,... - Either src or dst address must
- match<br>
- P:<list> - Must be one of the listed packets where the
- list corresponds to the packet number in the capture file.
- Ex: -x P:1-5,9,15 would only send packets 1 through 5, 9 and
- 15.<br>
- F:"<filter>" - BPF filter. See the
- tcpdump(8) man page for syntax.</p>
- </td>
- </table>
- <!-- TABS -->
- <table width="100%" border=0 rules="none" frame="void"
- cols="4" cellspacing="0" cellpadding="0">
- <tr valign="top" align="left">
- <td width="11%"></td>
- <td width="2%">
- <p><b>−X</b></p>
- </td>
- <td width="7%"></td>
- <td width="77%">
- <p>Specifies which packets from the capture file(s) to NOT
- send. Can be one of:</p>
- </td>
- </table>
- <!-- INDENTATION -->
- <table width="100%" border=0 rules="none" frame="void"
- cols="2" cellspacing="0" cellpadding="0">
- <tr valign="top" align="left">
- <td width="21%"></td>
- <td width="77%">
- <p>S:<CIDR1>,... - Src IP must match specified
- CIDR(s)<br>
- D:<CIDR1>,... - Dst IP must match specified
- CIDR(s)<br>
- B:<CIDR1>,... - Both src and dst addresses must
- match<br>
- E:<CIDR1>,... - Either src or dst address must
- match<br>
- P:<list> - Must be one of the listed packets where the
- list corresponds to the packet number in the capture file.
- Ex: -X P:1-5,9,15 would send all packets except 1 through 5,
- 9 and 15.</p>
- </td>
- </table>
- <!-- TABS -->
- <table width="100%" border=0 rules="none" frame="void"
- cols="4" cellspacing="0" cellpadding="0">
- <tr valign="top" align="left">
- <td width="11%"></td>
- <td width="2%">
- <p><b>−v</b></p>
- </td>
- <td width="7%"></td>
- <td width="77%">
- <p>Enable verbose status printing to stderr. (Probably only
- interesting for large input files.)</p>
- </td>
- <tr valign="top" align="left">
- <td width="11%"></td>
- <td width="2%">
- <p><b>−V</b></p>
- </td>
- <td width="7%"></td>
- <td width="77%">
- <p>Print version info and exit.</p>
- </td>
- </table>
- <a name="SEE ALSO"></a>
- <h2>SEE ALSO</h2>
- <!-- INDENTATION -->
- <table width="100%" border=0 rules="none" frame="void"
- cols="2" cellspacing="0" cellpadding="0">
- <tr valign="top" align="left">
- <td width="10%"></td>
- <td width="89%">
- <p>tcpdump(8), tcpreplay(8), capinfo(1), editcap(1)</p>
- </td>
- </table>
- <a name="AUTHOR"></a>
- <h2>AUTHOR</h2>
- <!-- INDENTATION -->
- <table width="100%" border=0 rules="none" frame="void"
- cols="2" cellspacing="0" cellpadding="0">
- <tr valign="top" align="left">
- <td width="10%"></td>
- <td width="89%">
- <p>Aaron Turner <aturner@pobox.com></p>
- <!-- INDENTATION -->
- <p>The current version is packaged with tcpreplay which is
- available via HTTP:</p>
- </td>
- </table>
- <!-- INDENTATION -->
- <table width="100%" border=0 rules="none" frame="void"
- cols="2" cellspacing="0" cellpadding="0">
- <tr valign="top" align="left">
- <td width="20%"></td>
- <td width="79%">
- <p><i>http://www.sourceforge.net/projects/tcpreplay/</i></p></td>
- </table>
- <a name="BUGS"></a>
- <h2>BUGS</h2>
- <!-- INDENTATION -->
- <table width="100%" border=0 rules="none" frame="void"
- cols="2" cellspacing="0" cellpadding="0">
- <tr valign="top" align="left">
- <td width="10%"></td>
- <td width="89%">
- <p>There may be a memory leak in the auto mode portion of
- the code. I’m seeing tcpprep growing to almost 15MB on
- a 900MB input file.</p>
- <!-- INDENTATION -->
- <p>Accuracy in auto modes and handling of non-IP datagrams
- could be improved by various means.</p>
- <!-- INDENTATION -->
- <p>It would be nice to support compressed files and other
- file formats than just libpcap.</p>
- <!-- INDENTATION -->
- <p>Please send bug reports to aturner@pobox.com.</p>
- </td>
- </table>
- <hr>
- </body>
- </html>
|