tcpreplay.1 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. .TH TCPREPLAY 1 2007-08-26 "(tcpreplay )" "Programmer's Manual"
  2. .\" DO NOT EDIT THIS FILE (tcpreplay.1)
  3. .\"
  4. .\" It has been AutoGen-ed Sunday August 26, 2007 at 01:08:04 PM PDT
  5. .\" From the definitions tcpreplay_opts.def
  6. .\" and the template file agman1.tpl
  7. .\"
  8. .SH NAME
  9. tcpreplay \- Replay network traffic stored in pcap files
  10. .SH SYNOPSIS
  11. .B tcpreplay
  12. .\" Mixture of short (flag) options and long options
  13. .RB [ \-\fIflag\fP " [\fIvalue\fP]]... [" \--\fIopt-name\fP " [[=| ]\fIvalue\fP]]..."
  14. .br
  15. .in +8
  16. <pcap_file(s)>
  17. .PP
  18. tcpreplay is a tool for replaying network traffic from files saved with
  19. tcpdump or other tools which write pcap(3) files.
  20. .SH "DESCRIPTION"
  21. This manual page documents, briefly, the \fBtcpreplay\fP command.
  22. The basic operation of tcpreplay is to resend all packets from the
  23. input file(s) at the speed at which they were recorded, or a specified
  24. data rate, up to as fast as the hardware is capable.
  25. Optionally, the traffic can be split between two interfaces, written to
  26. files, filtered and edited in various ways, providing the means to test
  27. firewalls, NIDS and other network devices.
  28. For more details, please see the Tcpreplay Manual at:
  29. http://tcpreplay.synfin.net/trac/wiki/manual
  30. .SH OPTIONS
  31. .TP
  32. .BR \-d " \fInumber\fP, " \--dbug "=" \fInumber\fP
  33. Enable debugging output.
  34. This option may appear up to 1 times.
  35. This option takes an integer number as its argument.
  36. The value of \fInumber\fP is constrained to being:
  37. .in +4
  38. .nf
  39. .na
  40. in the range 0 through 5
  41. .fi
  42. .in -4
  43. The default \fInumber\fP for this option is:
  44. .ti +4
  45. 0
  46. .sp
  47. If configured with \--enable-debug, then you can specify a verbosity
  48. level for debugging output. Higher numbers increase verbosity.
  49. .TP
  50. .BR \-q ", " \--quiet
  51. Quiet mode.
  52. .sp
  53. Print nothing except the statistics at the end of the run
  54. .TP
  55. .BR \-a ", " \--accurate
  56. Enable more accurate packet timing.
  57. This option may appear up to 1 times.
  58. This option must not appear in combination with any of the following options:
  59. accurate2.
  60. .sp
  61. Enables more accurate timing between packets at the cost of higher
  62. CPU utilization by using the gettimeofday() system call. This method
  63. works better on some systems then others and may have rather non-granular
  64. resolution which makes it problematic for replaying at high rates of speed.
  65. .TP
  66. .BR \--accurate2 "=\fInumber\fP"
  67. Enable even more accurate packet timing.
  68. This option may appear up to 1 times.
  69. This option must not appear in combination with any of the following options:
  70. accurate.
  71. This option takes an integer number as its argument.
  72. .sp
  73. Enables the "even more" accurate timing at the cost of higher CPU
  74. utilization by using a tight loop which increments a counter. This method
  75. provides the most accurate timing of any option, but requires you to specify
  76. a cost for each loop. This cost value is VERY system dependent, so you will
  77. need to run \--loop-test to get this value.
  78. .TP
  79. .BR \-v ", " \--verbose
  80. Print decoded packets via tcpdump to STDOUT.
  81. This option may appear up to 1 times.
  82. .sp
  83. .TP
  84. .BR \-A " \fIstring\fP, " \--decode "=" \fIstring\fP
  85. Arguments passed to tcpdump decoder.
  86. This option may appear up to 1 times.
  87. This option must appear in combination with the following options:
  88. verbose.
  89. .sp
  90. When enabling verbose mode (\fB-v\fP) you may also specify one or more
  91. additional arguments to pass to \fBtcpdump\fP to modify the way packets
  92. are decoded. By default, \-n and \-l are used. Be sure to
  93. quote the arguments like: \-A "-axxx" so that they are not interpreted
  94. by tcpreplay. Please see the tcpdump(1) man page for a complete list of
  95. options.
  96. .TP
  97. .BR \-C ", " \--enable-file-cache
  98. Enable caching of packets to internal memory.
  99. This option must appear in combination with the following options:
  100. loop.
  101. .sp
  102. Cache pcap file(s) the first time they are cached in RAM so that subsequent
  103. loops don't incurr any disk I/O latency in order to increase performance. Make
  104. sure you have enough free RAM to store the entire pcap file(s) in memory or the
  105. system will swap and performance will suffer.
  106. .TP
  107. .BR \-c " \fIstring\fP, " \--cachefile "=" \fIstring\fP
  108. Split traffic via a tcpprep cache file.
  109. This option may appear up to 1 times.
  110. .sp
  111. .TP
  112. .BR \-i " \fIstring\fP, " \--intf1 "=" \fIstring\fP
  113. Server/primary traffic output interface.
  114. This option may appear up to 1 times.
  115. .sp
  116. .TP
  117. .BR \-I " \fIstring\fP, " \--intf2 "=" \fIstring\fP
  118. Client/secondary traffic output interface.
  119. This option may appear up to 1 times.
  120. This option must appear in combination with the following options:
  121. cachefile.
  122. .sp
  123. .TP
  124. .BR \-N ", " \--listnics
  125. List available network interfaces and exit.
  126. .sp
  127. .TP
  128. .BR \-l " \fInumber\fP, " \--loop "=" \fInumber\fP
  129. Loop through the capture file X times.
  130. This option may appear up to 1 times.
  131. This option takes an integer number as its argument.
  132. The value of \fInumber\fP is constrained to being:
  133. .in +4
  134. .nf
  135. .na
  136. greater than or equal to 0
  137. .fi
  138. .in -4
  139. The default \fInumber\fP for this option is:
  140. .ti +4
  141. 1
  142. .sp
  143. .TP
  144. .BR \-S ", " \--pktlen
  145. Override the snaplen and use the actual packet len.
  146. This option may appear up to 1 times.
  147. .sp
  148. By default, tcpreplay will send packets based on the size of the "snaplen"
  149. stored in the pcap file which is usually the correct thing to do. However,
  150. occasionally, tools will store more bytes then told to. By specifying this
  151. option, tcpreplay will ignore the snaplen field and instead try to send
  152. packets based on the original packet length. Bad things may happen if
  153. you specify this option.
  154. .TP
  155. .BR \-L " \fInumber\fP, " \--limit "=" \fInumber\fP
  156. Limit the number of packets to send.
  157. This option may appear up to 1 times.
  158. This option takes an integer number as its argument.
  159. The value of \fInumber\fP is constrained to being:
  160. .in +4
  161. .nf
  162. .na
  163. greater than or equal to 1
  164. .fi
  165. .in -4
  166. The default \fInumber\fP for this option is:
  167. .ti +4
  168. \-1
  169. .sp
  170. By default, tcpreplay will send all the packets. Alternatively, you can
  171. specify a maximum number of packets to send.
  172. .TP
  173. .BR \-m " \fIstring\fP, " \--multiplier "=" \fIstring\fP
  174. Modify replay speed to a given multiple.
  175. This option may appear up to 1 times.
  176. This option must not appear in combination with any of the following options:
  177. pps, mbps, oneatatime, topspeed.
  178. .sp
  179. Specify a floating point value to modify the packet replay speed.
  180. Examples:
  181. .nf
  182. 2.0 will replay traffic at twice the speed captured
  183. 0.7 will replay traffic at 70% the speed captured
  184. .fi
  185. .TP
  186. .BR \-p " \fInumber\fP, " \--pps "=" \fInumber\fP
  187. Replay packets at a given packets/sec.
  188. This option may appear up to 1 times.
  189. This option must not appear in combination with any of the following options:
  190. multiplier, mbps, oneatatime, topspeed.
  191. This option takes an integer number as its argument.
  192. .sp
  193. .TP
  194. .BR \-M " \fIstring\fP, " \--mbps "=" \fIstring\fP
  195. Replay packets at a given Mbps.
  196. This option may appear up to 1 times.
  197. This option must not appear in combination with any of the following options:
  198. multiplier, pps, oneatatime, topspeed.
  199. .sp
  200. Specify a floating point value for the Mbps rate that tcpreplay
  201. should send packets at.
  202. .TP
  203. .BR \-t ", " \--topspeed
  204. Replay packets as fast as possible.
  205. This option must not appear in combination with any of the following options:
  206. mbps, multiplier, pps, oneatatime.
  207. .sp
  208. .TP
  209. .BR \-o ", " \--oneatatime
  210. Replay one packet at a time for each user input.
  211. This option must not appear in combination with any of the following options:
  212. mbps, pps, multiplier, topspeed.
  213. .sp
  214. Allows you to step through one or more packets at a time.
  215. .TP
  216. .BR \-P ", " \--pid
  217. Print the PID of tcpreplay at startup.
  218. .sp
  219. .TP
  220. .BR \-V ", " \--version
  221. Print version information.
  222. .sp
  223. .TP
  224. .BR \-h ", " \--less-help
  225. Display less usage information and exit.
  226. .sp
  227. .TP
  228. .BR \-H , " \--help"
  229. Display usage information and exit.
  230. .TP
  231. .BR \-! , " \--more-help"
  232. Extended usage information passed thru pager.
  233. .TP
  234. .BR \- " [\fIrcfile\fP]," " \--save-opts" "[=\fIrcfile\fP]"
  235. Save the option state to \fIrcfile\fP. The default is the \fIlast\fP
  236. configuration file listed in the \fBOPTION PRESETS\fP section, below.
  237. .TP
  238. .BR \- " \fIrcfile\fP," " \--load-opts" "=\fIrcfile\fP," " \--no-load-opts"
  239. Load options from \fIrcfile\fP.
  240. The \fIno-load-opts\fP form will disable the loading
  241. of earlier RC/INI files. \fI--no-load-opts\fP is handled early,
  242. out of order.
  243. .SH OPTION PRESETS
  244. Any option that is not marked as \fInot presettable\fP may be preset
  245. by loading values from configuration ("RC" or ".INI") file(s).
  246. The \fIhomerc\fP file is "\fI$$/\fP", unless that is a directory.
  247. In that case, the file "\fI.tcpreplayrc\fP"
  248. is searched for within that directory.
  249. .SH "SIGNALS"
  250. tcpreplay understands the following signals:
  251. .sp
  252. .IR "\fBSIGUSR1\fP"
  253. Suspend tcpreplay
  254. .sp
  255. .IR "\fBSIGCONT\fP"
  256. Restart tcpreplay
  257. .br
  258. .SH "SEE ALSO"
  259. tcpdump(1), tcpprep(1), tcprewrite(1), libnet(3)
  260. .SH "BUGS"
  261. tcpreplay can only send packets as fast as your computer's interface,
  262. processor, disk and system bus will allow.
  263. Replaying captured traffic may simulate odd or broken conditions on your
  264. network and cause problems.
  265. In most cases, you can not replay traffic back to/at a server.
  266. Some operating systems by default do not allow for forging source MAC
  267. addresses. Please consult your operating system's documentation and the
  268. tcpreplay FAQ if you experiance this issue.
  269. .SH AUTHOR
  270. Copyright 2000-2007 Aaron Turner
  271. For support please use the tcpreplay-users@lists.sourceforge.net mailing list.
  272. The latest version of this software is always available from:
  273. http://tcpreplay.synfin.net/
  274. .PP
  275. Released under the Free BSD License.
  276. .PP
  277. This manual page was \fIAutoGen\fP-erated from the \fBtcpreplay\fP
  278. option definitions.