tcpreplay.1 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. .TH TCPREPLAY 1 2008-05-15 "(tcpreplay )" "Programmer's Manual"
  2. .\" DO NOT EDIT THIS FILE (tcpreplay.1)
  3. .\"
  4. .\" It has been AutoGen-ed Thursday May 15, 2008 at 08:51:21 AM 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 \-T " \fIstring\fP, " \--timer "=" \fIstring\fP
  56. Select packet timing mode: select, ioport, rdtsc, gtod, nano, abstime.
  57. This option may appear up to 1 times.
  58. The default \fIstring\fP for this option is:
  59. .ti +4
  60. gtod
  61. .sp
  62. Allows you to select the packet timing method to use:
  63. .sp
  64. .IR "nano"
  65. - Use nanosleep() API
  66. .sp
  67. .IR "select"
  68. - Use select() API
  69. .sp
  70. .IR "ioport"
  71. - Write to the i386 IO Port 0x80
  72. .sp
  73. .IR "rdtsc "
  74. - Use the x86/x86_64/PPC RDTSC
  75. .sp
  76. .IR "gtod [default]"
  77. - Use a gettimeofday() loop
  78. .sp
  79. .IR "abstime"
  80. - Use OS X's AbsoluteTime API
  81. .br
  82. .TP
  83. .BR \--sleep-accel "=\fInumber\fP"
  84. Reduce the amount of time to sleep by specified usec.
  85. This option takes an integer number as its argument.
  86. The default \fInumber\fP for this option is:
  87. .ti +4
  88. 0
  89. .sp
  90. Reduce the amount of time we would normally sleep between two packets by the
  91. specified number of usec. This provides a "fuzz factor" to compensate for
  92. running on a non-RTOS and other processes using CPU time. Default is disabled.
  93. .TP
  94. .BR \--rdtsc-clicks "=\fInumber\fP"
  95. Specify the RDTSC clicks/usec.
  96. This option may appear up to 1 times.
  97. This option takes an integer number as its argument.
  98. The default \fInumber\fP for this option is:
  99. .ti +4
  100. 0
  101. .sp
  102. Override the calculated number of RDTSC clicks/usec which is often the speed of the
  103. CPU in Mhz. Only useful if you specified \fB--timer=rdtsc\fP
  104. .TP
  105. .BR \-v ", " \--verbose
  106. Print decoded packets via tcpdump to STDOUT.
  107. This option may appear up to 1 times.
  108. .sp
  109. .TP
  110. .BR \-A " \fIstring\fP, " \--decode "=" \fIstring\fP
  111. Arguments passed to tcpdump decoder.
  112. This option may appear up to 1 times.
  113. This option must appear in combination with the following options:
  114. verbose.
  115. .sp
  116. When enabling verbose mode (\fB-v\fP) you may also specify one or more
  117. additional arguments to pass to \fBtcpdump\fP to modify the way packets
  118. are decoded. By default, \-n and \-l are used. Be sure to
  119. quote the arguments like: \-A "-axxx" so that they are not interpreted
  120. by tcpreplay. Please see the tcpdump(1) man page for a complete list of
  121. options.
  122. .TP
  123. .BR \-K ", " \--enable-file-cache
  124. Enable caching of packets to internal memory.
  125. This option must appear in combination with the following options:
  126. loop.
  127. .sp
  128. Cache pcap file(s) the first time they are cached in RAM so that subsequent
  129. loops don't incurr any disk I/O latency in order to increase performance. Make
  130. sure you have enough free RAM to store the entire pcap file(s) in memory or the
  131. system will swap and performance will suffer.
  132. .TP
  133. .BR \-c " \fIstring\fP, " \--cachefile "=" \fIstring\fP
  134. Split traffic via a tcpprep cache file.
  135. This option may appear up to 1 times.
  136. .sp
  137. .TP
  138. .BR \-i " \fIstring\fP, " \--intf1 "=" \fIstring\fP
  139. Server/primary traffic output interface.
  140. This option may appear up to 1 times.
  141. .sp
  142. .TP
  143. .BR \-I " \fIstring\fP, " \--intf2 "=" \fIstring\fP
  144. Client/secondary traffic output interface.
  145. This option may appear up to 1 times.
  146. This option must appear in combination with the following options:
  147. cachefile.
  148. .sp
  149. .TP
  150. .BR \-l " \fInumber\fP, " \--loop "=" \fInumber\fP
  151. Loop through the capture file X times.
  152. This option may appear up to 1 times.
  153. This option takes an integer number as its argument.
  154. The value of \fInumber\fP is constrained to being:
  155. .in +4
  156. .nf
  157. .na
  158. greater than or equal to 0
  159. .fi
  160. .in -4
  161. The default \fInumber\fP for this option is:
  162. .ti +4
  163. 1
  164. .sp
  165. .TP
  166. .BR \--pktlen
  167. Override the snaplen and use the actual packet len.
  168. This option may appear up to 1 times.
  169. .sp
  170. By default, tcpreplay will send packets based on the size of the "snaplen"
  171. stored in the pcap file which is usually the correct thing to do. However,
  172. occasionally, tools will store more bytes then told to. By specifying this
  173. option, tcpreplay will ignore the snaplen field and instead try to send
  174. packets based on the original packet length. Bad things may happen if
  175. you specify this option.
  176. .TP
  177. .BR \-L " \fInumber\fP, " \--limit "=" \fInumber\fP
  178. Limit the number of packets to send.
  179. This option may appear up to 1 times.
  180. This option takes an integer number as its argument.
  181. The value of \fInumber\fP is constrained to being:
  182. .in +4
  183. .nf
  184. .na
  185. greater than or equal to 1
  186. .fi
  187. .in -4
  188. The default \fInumber\fP for this option is:
  189. .ti +4
  190. \-1
  191. .sp
  192. By default, tcpreplay will send all the packets. Alternatively, you can
  193. specify a maximum number of packets to send.
  194. .TP
  195. .BR \-x " \fIstring\fP, " \--multiplier "=" \fIstring\fP
  196. Modify replay speed to a given multiple.
  197. This option may appear up to 1 times.
  198. This option must not appear in combination with any of the following options:
  199. pps, mbps, oneatatime, topspeed.
  200. .sp
  201. Specify a floating point value to modify the packet replay speed.
  202. Examples:
  203. .nf
  204. 2.0 will replay traffic at twice the speed captured
  205. 0.7 will replay traffic at 70% the speed captured
  206. .fi
  207. .TP
  208. .BR \-p " \fInumber\fP, " \--pps "=" \fInumber\fP
  209. Replay packets at a given packets/sec.
  210. This option may appear up to 1 times.
  211. This option must not appear in combination with any of the following options:
  212. multiplier, mbps, oneatatime, topspeed.
  213. This option takes an integer number as its argument.
  214. .sp
  215. .TP
  216. .BR \-M " \fIstring\fP, " \--mbps "=" \fIstring\fP
  217. Replay packets at a given Mbps.
  218. This option may appear up to 1 times.
  219. This option must not appear in combination with any of the following options:
  220. multiplier, pps, oneatatime, topspeed.
  221. .sp
  222. Specify a floating point value for the Mbps rate that tcpreplay
  223. should send packets at.
  224. .TP
  225. .BR \-t ", " \--topspeed
  226. Replay packets as fast as possible.
  227. This option must not appear in combination with any of the following options:
  228. mbps, multiplier, pps, oneatatime.
  229. .sp
  230. .TP
  231. .BR \-o ", " \--oneatatime
  232. Replay one packet at a time for each user input.
  233. This option must not appear in combination with any of the following options:
  234. mbps, pps, multiplier, topspeed.
  235. .sp
  236. Allows you to step through one or more packets at a time.
  237. .TP
  238. .BR \-P ", " \--pid
  239. Print the PID of tcpreplay at startup.
  240. .sp
  241. .TP
  242. .BR \-V ", " \--version
  243. Print version information.
  244. .sp
  245. .TP
  246. .BR \-h ", " \--less-help
  247. Display less usage information and exit.
  248. .sp
  249. .TP
  250. .BR \-H , " \--help"
  251. Display usage information and exit.
  252. .TP
  253. .BR \-! , " \--more-help"
  254. Extended usage information passed thru pager.
  255. .TP
  256. .BR \- " [\fIrcfile\fP]," " \--save-opts" "[=\fIrcfile\fP]"
  257. Save the option state to \fIrcfile\fP. The default is the \fIlast\fP
  258. configuration file listed in the \fBOPTION PRESETS\fP section, below.
  259. .TP
  260. .BR \- " \fIrcfile\fP," " \--load-opts" "=\fIrcfile\fP," " \--no-load-opts"
  261. Load options from \fIrcfile\fP.
  262. The \fIno-load-opts\fP form will disable the loading
  263. of earlier RC/INI files. \fI--no-load-opts\fP is handled early,
  264. out of order.
  265. .SH OPTION PRESETS
  266. Any option that is not marked as \fInot presettable\fP may be preset
  267. by loading values from configuration ("RC" or ".INI") file(s).
  268. The \fIhomerc\fP file is "\fI$$/\fP", unless that is a directory.
  269. In that case, the file "\fI.tcpreplayrc\fP"
  270. is searched for within that directory.
  271. .SH "SIGNALS"
  272. tcpreplay understands the following signals:
  273. .sp
  274. .IR "\fBSIGUSR1\fP"
  275. Suspend tcpreplay
  276. .sp
  277. .IR "\fBSIGCONT\fP"
  278. Restart tcpreplay
  279. .br
  280. .SH "SEE ALSO"
  281. tcpreplay-edit(1), tcpdump(1), tcpprep(1), tcprewrite(1), libnet(3)
  282. .SH "BUGS"
  283. tcpreplay can only send packets as fast as your computer's interface,
  284. processor, disk and system bus will allow.
  285. Packet timing at high speeds is a black art and very OS/CPU dependent.
  286. Replaying captured traffic may simulate odd or broken conditions on your
  287. network and cause all sorts of problems.
  288. In most cases, you can not replay traffic back to/at a server.
  289. Some operating systems by default do not allow for forging source MAC
  290. addresses. Please consult your operating system's documentation and the
  291. tcpreplay FAQ if you experience this issue.
  292. .SH AUTHOR
  293. Copyright 2000-2008 Aaron Turner
  294. For support please use the tcpreplay-users@lists.sourceforge.net mailing list.
  295. The latest version of this software is always available from:
  296. http://tcpreplay.synfin.net/
  297. .PP
  298. Released under the Free BSD License.
  299. .PP
  300. This manual page was \fIAutoGen\fP-erated from the \fBtcpreplay\fP
  301. option definitions.