<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>Hi Gianluca,<br>
<br>
1) According to Section 5.3 and Figures 6,9 in
<a class="moz-txt-link-freetext" href="http://www.winpcap.org/docs/WinPcap-SBAC03.pdf">http://www.winpcap.org/docs/WinPcap-SBAC03.pdf</a> (small packets),<br>
timestamp optimization is switched off in the standard distribution,
which costs *a lot* of cpu processing.<br>
Is it possible to turn on the "rdtsc" instruction on proper cpu´s? (or
even turn off driver-timestamping for special purposes) <br>
<br>
2) To have a better understanding of the bound NIC and the driver in
oder to tune the driver settings (e.g. reduce context switches),<br>
it would be very nice to have some informations about:<br>
# usage of kernel buffer (max, average or anything like that)<br>
# no of frames copied to the kernel buffer during one DPC<br>
# no of frames served by one interrupt<br>
<br>
3) R</tt><tt>egarding performance,</tt><tt> what would you prefer,<br>
pcap_next_ex() or pcap_loop()?<br>
<br>
<br>
Best regards<br>
Helmut<br>
</tt><br>
<br>
Gianluca Varenni schrieb:
<blockquote cite="mid:7DBB8BF83E8C4EB597DEA456B79D94CD@NELSON3"
type="cite">
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta name="GENERATOR" content="MSHTML 8.00.7600.16625">
<div><font face="Calibri">The copies are the following ones:</font></div>
<div> </div>
<div><font face="Calibri">1. from the NIC driver buffers to the
WinPcap kernel buffer (1st copy)</font></div>
<div><font face="Calibri">2. from the kernel buffer to the user
buffer (buffer allocated inside wpcap.dll) (2nd copy)</font></div>
<div> </div>
<div><font face="Calibri">If you copy the packets received from
pcap_next_ex (or any other pcap receive function) to your own
application buffer, that would be a 3rd copy.</font></div>
<div
style="font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"> </div>
<div
style="font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><font
face="Calibri" size="3">GV</font></div>
<div
style="font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"> </div>
<div
style="font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"> </div>
<div
style="font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"> </div>
<div
style="font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">
<div><br>
</div>
<div
style="background: rgb(245, 245, 245) none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<div style=""><b>From:</b> <a moz-do-not-send="true"
title="liu.yulou@zte.com.cn" href="mailto:liu.yulou@zte.com.cn">liu.yulou@zte.com.cn</a>
</div>
<div><b>Sent:</b> Sunday, September 26, 2010 10:49 PM</div>
<div><b>To:</b> <a moz-do-not-send="true"
title="winpcap-users@winpcap.org"
href="mailto:winpcap-users@winpcap.org">winpcap-users@winpcap.org</a> </div>
<div><b>Subject:</b> Re: [Winpcap-users] About the packets loss ,what
is the bottleneck ?</div>
</div>
</div>
<div><br>
</div>
<br>
<font face="sans-serif" size="2">GV> Not at the moment with
WinPcap. Having said that, I've used this double copy mechanism to
bring several Gbps's to user mode without any packet loss (not with
WinPcap, with custom hardware. However the buffering mechanism was the
same).</font> <br>
<br>
<font face="sans-serif" size="2">YL> 'double copy mechanism' ,
Data copy from the user buffer to application(user mode) is the third
copy ? </font> <br>
<br>
<br>
<br>
<br>
<br>
<font face="sans-serif" size="2">GV>Are you dumping the packets to
disk? If so, have you measured the dump-to-disk bandwidth? </font><br>
<br>
<font face="sans-serif" size="2">YL> Yes, Dumping packets to
disk is my final goal. But right now , To avoid the limitation of the
disk write speed , I just count the packets number in the receive
thread. But on the rate of 614 Mbps, sometimes there are still
packets loss. </font><br>
<br>
<font face="sans-serif" size="2">PS. The route of packets
transfer is : FPGA BOARD sends data through ether net --> PC'S
net card --> winpcap kernel buffer --> winpcap user buffer
--> receive thread count . The FPGA's sending packets rate is
about 614 Mbps , the size of each packet is 1460 bytes, every
packet has a sequence number , the sending process's starting and
stopping can be controlled . </font> <br>
<br>
<font face="sans-serif" size="2">The app that I make only counts the
packet's number when a packet comes without saving . While the last
packet comes , the app will compare the number (it counts by itself)
with the sequence number (of the last packet). Then I will know if
there is packets loss. </font><br>
<br>
<br>
<br>
<br>
<br>
<br>
<table width="100%">
<tbody>
<tr valign="top">
<td width="35%"><font face="sans-serif" size="1"><b>"Gianluca
Varenni" <a class="moz-txt-link-rfc2396E" href="mailto:gianluca.varenni@cacetech.com"><gianluca.varenni@cacetech.com></a></b> </font><br>
<font face="sans-serif" size="1">发件人:
<a class="moz-txt-link-abbreviated" href="mailto:winpcap-users-bounces@winpcap.org">winpcap-users-bounces@winpcap.org</a></font>
<p><font face="sans-serif" size="1">2010-09-21 07:41</font>
<table border="1">
<tbody>
<tr valign="top">
<td bgcolor="white">
<div align="center"><font face="sans-serif" size="1">请答复 给<br>
<a class="moz-txt-link-abbreviated" href="mailto:winpcap-users@winpcap.org">winpcap-users@winpcap.org</a></font></div>
</td>
</tr>
</tbody>
</table>
<br>
</p>
</td>
<td width="64%">
<table width="100%">
<tbody>
<tr valign="top">
<td>
<div align="right"><font face="sans-serif" size="1">收件人</font></div>
</td>
<td><font face="sans-serif" size="1"><a class="moz-txt-link-rfc2396E" href="mailto:winpcap-users@winpcap.org"><winpcap-users@winpcap.org></a></font>
</td>
</tr>
<tr valign="top">
<td>
<div align="right"><font face="sans-serif" size="1">抄送</font></div>
</td>
<td> <br>
</td>
</tr>
<tr valign="top">
<td>
<div align="right"><font face="sans-serif" size="1">主题</font></div>
</td>
<td><font face="sans-serif" size="1">Re: [Winpcap-users]
About the packets loss , what is the bottleneck ?</font></td>
</tr>
</tbody>
</table>
<br>
<table>
<tbody>
<tr valign="top">
<td> <br>
</td>
<td><br>
</td>
</tr>
</tbody>
</table>
<br>
</td>
</tr>
</tbody>
</table>
<br>
<br>
<br>
<font size="3"> </font> <br>
<br>
<font size="3"><b>From:</b> </font><a moz-do-not-send="true"
href="mailto:lyulou@gmail.com"><font color="blue" size="3"><u>yulou liu</u></font></a><font
size="3"> </font><br>
<font size="3"><b>Sent:</b> Sunday, September 19, 2010 12:50 AM</font>
<br>
<font size="3"><b>To:</b> </font><a moz-do-not-send="true"
href="mailto:winpcap-users@winpcap.org"><font color="blue" size="3"><u>winpcap-users@winpcap.org</u></font></a><font
size="3"> </font><br>
<font size="3"><b>Subject:</b> [Winpcap-users] About the packets loss
, what is the bottleneck ?</font> <br>
<br>
<font face="Calibri" size="2"><br>
There is still the question about packets loss.<br>
 </font><font size="2"> </font><font face="Calibri" size="2"><br>
According to the essay ' </font><font size="2">Profiling and
Optimization of Software-Based Network-Analysis Applications</font><font
face="Calibri" size="2">' ,   every packet is copied twice in the
main memory before reaching the user. In order to reduce the cost of
CPU and the bus occupying of the SDRAM of pc,  is it possible to
copy data directly from the kernel buffer to the final buffer , which
I want the date kept in ?   </font><br>
<font size="2"> </font> <br>
<font face="Calibri" size="2">GV> Not at the moment with WinPcap.
Having said that, I've used this double copy mechanism to bring several
Gbps's to user mode without any packet loss (not with WinPcap, with
custom hardware. However the buffering mechanism was the same).</font> <br>
<font face="Calibri" size="2"><br>
 </font><font size="2"> </font><font face="Calibri" size="2"><br>
Here is another idea ---Â </font><font size="2">Â allocate several
different user buffers , once </font><font face="Calibri" size="2">aÂ
</font><font size="2">user buffer is fulled , then let the next user
buffer to save the </font><font face="Calibri" size="2">new</font><font
size="2"> datas from kernel buffer. Meanwhile copy datas from the
first user buffer to disk (assume that the hard disk write rate is fast
enough).</font><font face="Calibri" size="2">Â Is this idea work with
the winpcap ?</font><font size="2">Â </font><br>
<font size="2"> </font> <br>
<font face="Calibri" size="3">GV>Are you dumping the packets to
disk? If so, have you measured the dump-to-disk bandwidth? </font><br>
<font size="2"> </font> <br>
<font face="Calibri" size="3">GV</font> <br>
<font size="2"> </font> <br>
<font size="2"> </font> <br>
<font size="2"><tt>_______________________________________________<br>
Winpcap-users mailing list<br>
<a class="moz-txt-link-abbreviated" href="mailto:Winpcap-users@winpcap.org">Winpcap-users@winpcap.org</a><br>
<a class="moz-txt-link-freetext" href="https://www.winpcap.org/mailman/listinfo/winpcap-users">https://www.winpcap.org/mailman/listinfo/winpcap-users</a><br>
</tt></font><br>
<br>
<pre>--------------------------------------------------------
ZTE Information Security Notice: The information contained in this mail is solely property of the sender's organization. This mail communication is confidential. Recipients named above are obligated to maintain secrecy and are not permitted to disclose the contents of this communication to others.
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the originator of the message. Any views expressed in this message are those of the individual sender.
This message has been scanned for viruses and Spam by ZTE Anti-Spam system.
</pre>
<p>
</p>
<hr>_______________________________________________<br>
Winpcap-users mailing list<br>
<a class="moz-txt-link-abbreviated" href="mailto:Winpcap-users@winpcap.org">Winpcap-users@winpcap.org</a><br>
<a class="moz-txt-link-freetext" href="https://www.winpcap.org/mailman/listinfo/winpcap-users">https://www.winpcap.org/mailman/listinfo/winpcap-users</a><br>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
Winpcap-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Winpcap-users@winpcap.org">Winpcap-users@winpcap.org</a>
<a class="moz-txt-link-freetext" href="https://www.winpcap.org/mailman/listinfo/winpcap-users">https://www.winpcap.org/mailman/listinfo/winpcap-users</a></pre>
</blockquote>
</body>
</html>