node6.html 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <!--Converted with LaTeX2HTML 2002-2 (1.70)
  3. original version by: Nikos Drakos, CBLU, University of Leeds
  4. * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
  5. * with significant contributions from:
  6. Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
  7. <HTML>
  8. <HEAD>
  9. <TITLE>5 Common Questions from Users</TITLE>
  10. <META NAME="description" CONTENT="5 Common Questions from Users">
  11. <META NAME="keywords" CONTENT="FAQ">
  12. <META NAME="resource-type" CONTENT="document">
  13. <META NAME="distribution" CONTENT="global">
  14. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
  15. <META NAME="Generator" CONTENT="LaTeX2HTML v2002-2">
  16. <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
  17. <LINK REL="STYLESHEET" HREF="FAQ.css">
  18. <LINK REL="next" HREF="node7.html">
  19. <LINK REL="previous" HREF="node5.html">
  20. <LINK REL="up" HREF="FAQ.html">
  21. <LINK REL="next" HREF="node7.html">
  22. </HEAD>
  23. <BODY >
  24. <DIV CLASS="navigation"><!--Navigation Panel-->
  25. <A NAME="tex2html213"
  26. HREF="node7.html">
  27. <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
  28. <A NAME="tex2html209"
  29. HREF="FAQ.html">
  30. <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
  31. <A NAME="tex2html203"
  32. HREF="node5.html">
  33. <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
  34. <A NAME="tex2html211"
  35. HREF="node1.html">
  36. <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
  37. <BR>
  38. <B> Next:</B> <A NAME="tex2html214"
  39. HREF="node7.html">6 Testing Methodologies</A>
  40. <B> Up:</B> <A NAME="tex2html210"
  41. HREF="FAQ.html">Tcpreplay 3.x FAQ</A>
  42. <B> Previous:</B> <A NAME="tex2html204"
  43. HREF="node5.html">4 Common Error and</A>
  44. &nbsp; <B> <A NAME="tex2html212"
  45. HREF="node1.html">Contents</A></B>
  46. <BR>
  47. <BR></DIV>
  48. <!--End of Navigation Panel-->
  49. <!--Table of Child-Links-->
  50. <A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
  51. <UL CLASS="ChildLinks">
  52. <LI><A NAME="tex2html215"
  53. HREF="node6.html#SECTION00061000000000000000"><SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">1</SPAN> Why is tcpreplay not sending all the packets?</A>
  54. <LI><A NAME="tex2html216"
  55. HREF="node6.html#SECTION00062000000000000000"><SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">2</SPAN> Can tcpreplay read gzip/bzip2 compressed files?</A>
  56. <LI><A NAME="tex2html217"
  57. HREF="node6.html#SECTION00063000000000000000"><SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">3</SPAN> How fast can tcpreplay send packets?</A>
  58. <LI><A NAME="tex2html218"
  59. HREF="node6.html#SECTION00064000000000000000"><SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">4</SPAN> Is tcpreplay stateful?</A>
  60. </UL>
  61. <!--End of Table of Child-Links-->
  62. <HR>
  63. <H1><A NAME="SECTION00060000000000000000">
  64. <SPAN CLASS="arabic">5</SPAN> Common Questions from Users</A>
  65. </H1>
  66. <P>
  67. <H2><A NAME="SECTION00061000000000000000">
  68. <SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">1</SPAN> Why is tcpreplay not sending all the packets?</A>
  69. </H2>
  70. <P>
  71. Every now and then, someone emails the tcpreplay-users list, asking
  72. if there is a bug in tcpreplay which causes it not to send all the
  73. packets. This usually happens when the user uses the -t flag or is
  74. replaying a high-speed pcap file (&gt; 50Mbps, although this number is
  75. dependant on the hardware in use).
  76. <P>
  77. The short version of the answer is: no, we are not aware of any bugs
  78. which might cause a few packets to not be sent.
  79. <P>
  80. The longer version goes something like this:
  81. <P>
  82. If you are running tcpreplay multiple times and are using tcpdump
  83. or other packet sniffer to count the number packets sent and are getting
  84. different numbers, it's not tcpreplay's fault. The problem lies in
  85. one of two places:
  86. <P>
  87. <OL>
  88. <LI>It is well known that tcpdump and other sniffers have a problem keeping
  89. up with high-speed traffic. Furthermore, the OS in many cases <SPAN CLASS="textit">lies</SPAN>
  90. about how many packets were dropped. Tcpdump will repeat this lie
  91. to you. In other words, tcpdump isn't seeing all the packets. Usually
  92. this is a problem with the network card, driver or OS kernel which
  93. may or may not be fixable. Try another network card/driver.
  94. </LI>
  95. <LI>When tcpreplay sends a packet, it actually gets copied to a send buffer
  96. in the kernel. If this buffer is full, the kernel is supposed to tell
  97. tcpreplay that it didn't copy the packet to this buffer. If the kernel
  98. has a bug which squelches this error, tcpreplay will not keep trying
  99. to send the packet and will move on to the next one. Currently I am
  100. not aware of any OS kernels with this bug, but it is possible that
  101. it exists. If you find out that your OS has this problem, please let
  102. me know so I can list it here.
  103. </LI>
  104. </OL>
  105. If for some reason, you still think its a bug in tcpreplay, by all
  106. means read the code and tell me how stupid I am. The do_packets()
  107. function in do_packets.c is where tcpreplay processes the pcap file
  108. and sends all of the packets.
  109. <P>
  110. <H2><A NAME="SECTION00062000000000000000">
  111. <SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">2</SPAN> Can tcpreplay read gzip/bzip2 compressed files?</A>
  112. </H2>
  113. <P>
  114. Yes, but not directly. Since tcpreplay can read data via STDIN, you
  115. can decompress the file on the fly like this:
  116. <P>
  117. <SPAN CLASS="textit">gzcat myfile.pcap.gz | tcpreplay -i eth0 -</SPAN>
  118. <P>
  119. Note that decompressing on the fly will require additional CPU time
  120. and will likely reduce the overall performance of tcpreplay.
  121. <P>
  122. <H2><A NAME="SECTION00063000000000000000">
  123. <SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">3</SPAN> How fast can tcpreplay send packets?</A>
  124. </H2>
  125. <P>
  126. First, if performance is important to you, then upgrading to tcpreplay
  127. 3.x is worthwhile since it is more optimized then the 1.x or 2.x series.
  128. After that, there are a number of variables which effect performance,
  129. including on how you measure it (packets/sec or bytes/sec). 100Mbps
  130. and 120K pps are quite doable. Generally speaking here are some points
  131. to consider:
  132. <P>
  133. <UL>
  134. <LI>Profiling tcpreplay has shown that a significant amount of time is
  135. spent writing packets to the network. Hence, your OS kernel implimentation
  136. of writing to raw sockets is one of the most important aspects since
  137. that is where tcpreplay spends most of it's time.
  138. </LI>
  139. <LI>Like most network based I/O, it is faster to send the same amount
  140. of data in a few large packets then many small packets.
  141. </LI>
  142. <LI>Most operating systems will cache disk reads in RAM; hence making
  143. subsequent access to the file faster the second time.
  144. </LI>
  145. <LI>Re-opening small files repeatly will reduce performance. Consider
  146. using mergecap to generate a single large file.
  147. </LI>
  148. <LI>Network cards and drivers, disk speed (RPM is more important then
  149. seek), amount of RAM and system bus speed are all important.
  150. </LI>
  151. <LI>In general servers with faster disks and bus speeds will be faster
  152. then desktops which will be faster then laptops.
  153. </LI>
  154. </UL>
  155. <P>
  156. <H2><A NAME="SECTION00064000000000000000">
  157. <SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">4</SPAN> Is tcpreplay stateful?</A>
  158. </H2>
  159. <P>
  160. No. Tcpreplay processes each packet in the order it is stored in the
  161. pcap file. The default is to send each packet based on the timestamp
  162. stored in the pcap file. If your pcap file has packets out of order,
  163. tcpreplay will send them out of order. In certain situations a packet
  164. may have an earlier timestamp then the packet before it, tcpreplay
  165. will then send the second packet as soon as possible.
  166. <P>
  167. The basic point is that if your pcap file is well formed and has the
  168. packets in the correct order, then tcpreplay will create a ``stateful''
  169. packet stream. If your pcap file has errors, then tcpreplay will repeat
  170. those errors. Garbage in, garbage out.
  171. <P>
  172. <DIV CLASS="navigation"><HR>
  173. <!--Navigation Panel-->
  174. <A NAME="tex2html213"
  175. HREF="node7.html">
  176. <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
  177. <A NAME="tex2html209"
  178. HREF="FAQ.html">
  179. <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
  180. <A NAME="tex2html203"
  181. HREF="node5.html">
  182. <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
  183. <A NAME="tex2html211"
  184. HREF="node1.html">
  185. <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
  186. <BR>
  187. <B> Next:</B> <A NAME="tex2html214"
  188. HREF="node7.html">6 Testing Methodologies</A>
  189. <B> Up:</B> <A NAME="tex2html210"
  190. HREF="FAQ.html">Tcpreplay 3.x FAQ</A>
  191. <B> Previous:</B> <A NAME="tex2html204"
  192. HREF="node5.html">4 Common Error and</A>
  193. &nbsp; <B> <A NAME="tex2html212"
  194. HREF="node1.html">Contents</A></B> </DIV>
  195. <!--End of Navigation Panel-->
  196. <ADDRESS>
  197. Aaron Turner
  198. 2006-08-07
  199. </ADDRESS>
  200. </BODY>
  201. </HTML>